Пример #1
0
 public String uyeodeme() {
   if (!setSelected()) {
     return "";
   }
   getSessionUser().setLegalAccess(1);
   putObjectToSessionFilter(ApplicationDescriptor._UYEAIDAT_MODEL, getUyeaidat());
   return ManagedBeanLocator.locateMenuController().gotoPage("menu_Uyeodeme");
 }
 @Override
 public Object getAsObject(FacesContext facesContext, UIComponent uIComponent, String value) {
   if (value == null || value.trim().equalsIgnoreCase("")) {
     return null;
   }
   // DBOperator dbOperator = new DBOperator();
   return ManagedBeanLocator.locateSessionController()
       .getDBOperator()
       .find("KomisyonDonemUyeKatilimci", "rID", value)
       .get(0);
 }
 @Override
 public String backToMaster() {
   /*
    * if(getMasterObjectName() != null) { super.removeObjectFromSessionFilter(getMasterObjectName()); }
    */
   if (getMasterOutcome() != null) {
     return ManagedBeanLocator.locateMenuController()
         .gotoPage("menu_" + StringUtil.makeFirstCharLowerCase(getMasterOutcome()));
   } else {
     return ApplicationDescriptor._DASHBOARD_OUTCOME;
   }
 }
 @Override
 public SessionUser getSessionUser() {
   return ManagedBeanLocator.locateSessionUser();
 }
Пример #5
0
  @SuppressWarnings("unchecked")
  public void finishWizard() throws DBException {
    DBOperator dbOperator = getDBOperator();
    try {
      //  Tum Save'ler yapilacak
      this.personel.setKisiRef(getKisi());
      this.personel.setBaslamatarih(new Date());
      this.personel.setDurum(PersonelDurum._CALISIYOR);
      this.personel.setBirimRef(getSessionUser().getPersonelRef().getBirimRef());
      this.personel.setTumUyeSorgulama(EvetHayir._HAYIR);
      dbOperator.insert(this.personel);
      if (getPersonelController().isLoggable()) {
        logKaydet(this.personel, IslemTuru._EKLEME, "");
      }
      if (this.personel != null) {
        getPersonelGorev().setPersonelRef(this.personel);
      }
      dbOperator.insert(getPersonelGorev());
      if (getPersonelBirimGorevController().isLoggable()) {
        logKaydet(this.personelGorev, IslemTuru._EKLEME, "");
      }

      if (!isEmpty(this.telefon1.getTelefonno())) {
        if (getDBOperator()
                .recordCount(
                    Telefon.class.getSimpleName(),
                    "o.kisiRef.rID="
                        + getKisi().getRID()
                        + " AND o.telefonturu="
                        + this.telefon1.getTelefonturu().getCode())
            > 0) {
          List<Telefon> telefon2Listesi =
              getDBOperator()
                  .load(
                      Telefon.class.getSimpleName(),
                      "o.kisiRef.rID="
                          + getKisi().getRID()
                          + " AND o.telefonturu="
                          + this.telefon1.getTelefonturu().getCode(),
                      "");
          for (Telefon entity : telefon2Listesi) {
            if (entity.getTelefonno().equals(this.telefon1.getTelefonno())) {
              entity.setVarsayilan(EvetHayir._EVET);
              getDBOperator().update(entity);
            } else {
              entity.setVarsayilan(EvetHayir._HAYIR);
              getDBOperator().update(entity);
            }
          }
        } else {
          this.telefon1.setKisiRef(getKisi());
          this.telefon1.setVarsayilan(EvetHayir._HAYIR);
          dbOperator.insert(telefon1);
        }
      }
      if (!isEmpty(this.telefon2.getTelefonno())) {
        if (getDBOperator()
                .recordCount(
                    Telefon.class.getSimpleName(),
                    "o.kisiRef.rID="
                        + getKisi().getRID()
                        + " AND o.telefonturu="
                        + this.telefon2.getTelefonturu().getCode())
            > 0) {
          List<Telefon> telefon2Listesi =
              getDBOperator()
                  .load(
                      Telefon.class.getSimpleName(),
                      "o.kisiRef.rID="
                          + getKisi().getRID()
                          + " AND o.telefonturu="
                          + this.telefon2.getTelefonturu().getCode(),
                      "");
          for (Telefon entity : telefon2Listesi) {
            if (entity.getTelefonno().equals(this.telefon2.getTelefonno())) {
              entity.setVarsayilan(EvetHayir._EVET);
              getDBOperator().update(entity);
            } else {
              entity.setVarsayilan(EvetHayir._HAYIR);
              getDBOperator().update(entity);
            }
          }
        } else {
          this.telefon2.setKisiRef(getKisi());
          this.telefon2.setVarsayilan(EvetHayir._HAYIR);
          dbOperator.insert(telefon2);
        }
      }
      if (!isEmpty(this.telefon3.getTelefonno())) {
        if (getDBOperator()
                .recordCount(
                    Telefon.class.getSimpleName(),
                    "o.kisiRef.rID="
                        + getKisi().getRID()
                        + " AND o.telefonturu="
                        + this.telefon3.getTelefonturu().getCode())
            > 0) {
          List<Telefon> telefon3Listesi =
              getDBOperator()
                  .load(
                      Telefon.class.getSimpleName(),
                      "o.kisiRef.rID="
                          + getKisi().getRID()
                          + " AND o.telefonturu="
                          + this.telefon3.getTelefonturu().getCode(),
                      "");
          for (Telefon entity : telefon3Listesi) {
            if (entity.getTelefonno().equals(this.telefon3.getTelefonno())) {
              entity.setVarsayilan(EvetHayir._EVET);
              getDBOperator().update(entity);
            } else {
              entity.setVarsayilan(EvetHayir._HAYIR);
              getDBOperator().update(entity);
            }
          }
        } else {
          this.telefon3.setKisiRef(getKisi());
          this.telefon3.setVarsayilan(EvetHayir._EVET);
          dbOperator.insert(telefon3);
        }
        // Personel sayfasina gidiyor...
        if (this.personel.getRID() != null) {
          getPersonelController().setSelectedRID(this.personel.getRID() + "");
          ManagedBeanLocator.locateSessionUser()
              .addToSessionFilters(Personel.class.getSimpleName(), this.personel);
          FacesContext.getCurrentInstance().getExternalContext().redirect("personel_Detay.xhtml");
        } else {
          FacesContext.getCurrentInstance().getExternalContext().redirect("personel.xhtml");
        }
      }
    } catch (Exception e) {
      logYaz("Error @finishWizard:" + e.getMessage());
      logYaz("Exception @" + getModelName() + "Controller :", e);
      createGenericMessage(KeyUtil.getMessageValue("islem.hata"), FacesMessage.SEVERITY_ERROR);
    }
  }