Ejemplo n.º 1
0
 public void saveKullaniciRapor() throws DBException {
   if (isEmpty(getList())) {
     createGenericMessage(KeyUtil.getMessageValue("kayit.bulunamadi"), FacesMessage.SEVERITY_WARN);
   } else if (isEmpty(getKullaniciRaporAdi())) {
     createGenericMessage(
         KeyUtil.getMessageValue("kullaniciRaporAdi.giriniz"), FacesMessage.SEVERITY_ERROR);
   } else {
     Kullanicirapor rapor = new Kullanicirapor();
     rapor.setKullaniciRef(getSessionUser().getKullanici());
     rapor.setRaporadi(getKullaniciRaporAdi());
     rapor.setTarih(new Date());
     rapor.setRaporTuru("Kişi");
     rapor.setWherecondition(getWhereCondition());
     if (getDBOperator()
             .recordCount(
                 Kullanicirapor.class.getSimpleName(),
                 "o.kullaniciRef.rID="
                     + rapor.getKullaniciRef().getRID()
                     + " AND o.raporadi='"
                     + rapor.getRaporadi()
                     + "'")
         > 0) {
       createGenericMessage(
           KeyUtil.getMessageValue("kullaniciRaporAdi.mukerrer"), FacesMessage.SEVERITY_WARN);
       return;
     }
     getDBOperator().insert(rapor);
     createGenericMessage(KeyUtil.getMessageValue("kayit.eklendi"), FacesMessage.SEVERITY_INFO);
     setKullaniciRaporAdi("");
   }
 }
Ejemplo n.º 2
0
 @Override
 public String getValue() {
   StringBuilder value = new StringBuilder("");
   if (getSehirRef() != null) {
     value.append(
         KeyUtil.getLabelValue("ilce.sehirRef") + " : " + getSehirRef().getUIString() + "<br />");
   }
   if (getAd() != null) {
     value.append(KeyUtil.getLabelValue("ilce.ad") + " : " + getAd() + "");
   }
   if (getIlcekodu() != null) {
     value.append(KeyUtil.getLabelValue("ilce.ilcekodu") + " : " + getIlcekodu() + "");
   }
   return value.toString();
 }
Ejemplo n.º 3
0
 @Override
 public String getValue() {
   StringBuilder value = new StringBuilder("Veri : <br />");
   if (getUstRef() != null) {
     value.append(
         KeyUtil.getLabelValue("dosyakodu.ustRef") + " : " + getUstRef().getUIString() + "<br />");
   }
   if (getKod() != null) {
     value.append(KeyUtil.getLabelValue("dosyakodu.kod") + " : " + getKod() + "<br />");
   }
   if (getAd() != null) {
     value.append(KeyUtil.getLabelValue("dosyakodu.ad") + " : " + getAd() + "<br />");
   }
   if (getErisimKodu() != null) {
     value.append(KeyUtil.getLabelValue("dosyakodu.erisimKodu") + " : " + getErisimKodu() + "");
   }
   return value.toString();
 }
Ejemplo n.º 4
0
 public String getKomisyonDonemUyeText() {
   if (getUyeRef() != null) {
     return getUyeRef().getUIString();
   } else {
     return getKisiRef().getUIStringShort()
         + " ("
         + KeyUtil.getLabelValue("komisyonDonemUye.uyeDegil")
         + ")";
   }
 }
Ejemplo n.º 5
0
 @Override
 public String getValue() {
   StringBuilder value = new StringBuilder("Veri : <br />");
   if (getKomisyonDonemRef() != null) {
     value.append(
         KeyUtil.getLabelValue("komisyonDonemUye.komisyonDonemRef")
             + " : "
             + getKomisyonDonemRef().getUIString()
             + "<br />");
   }
   if (getUyeRef() != null) {
     value.append(
         KeyUtil.getLabelValue("komisyonDonemUye.uyeRef")
             + " : "
             + getUyeRef().getUIString()
             + "<br />");
   }
   if (getKisiRef() != null) {
     value.append(
         KeyUtil.getLabelValue("komisyonDonemUye.kisiRef")
             + " : "
             + getKisiRef().getUIString()
             + "<br />");
   }
   if (getKomisyonGorev() != null) {
     value.append(
         KeyUtil.getLabelValue("komisyonDonemUye.komisyonGorev")
             + " : "
             + getKomisyonGorev().getLabel()
             + "");
   }
   if (getUyeTuru() != null) {
     value.append(
         KeyUtil.getLabelValue("komisyonDonemUye.uyeTuru") + " : " + getUyeTuru().getLabel() + "");
   }
   if (getDurum() != null) {
     value.append(
         KeyUtil.getLabelValue("komisyonDonemUye.durum") + " : " + getDurum().getLabel() + "");
   }
   if (getKomisyonUyelikDurumu() != null) {
     value.append(
         KeyUtil.getLabelValue("komsiyonDonemUye.komsiyonUyelikDurumu")
             + " : "
             + getKomisyonUyelikDurumu().getLabel()
             + "");
   }
   if (getDurumtarihi() != null) {
     value.append(
         KeyUtil.getLabelValue("komisyonDonemUye.durumtarihi") + " : " + getDurumtarihi() + "");
   }
   return value.toString();
 }
Ejemplo n.º 6
0
  @Override
  public void wizardForward() {
    if (this.wizardStep == 1) {
      // Kisi ve kisikimlik bilgileri kaydedilecek...
      try {

        if (!kisiVeritabanindaBulundu && getKisi().getRID() == null) {
          getDBOperator().insert(getKisi());
          if (getKisiController().isLoggable()) {
            logKaydet(getKisi(), IslemTuru._EKLEME, "");
          }
          this.kisikimlik.setKisiRef(getKisi());
          getDBOperator().insert(getKisikimlik());
          if (getKisikimlikController().isLoggable()) {
            logKaydet(this.kisikimlik, IslemTuru._EKLEME, "");
          }
          createGenericMessage(
              KeyUtil.getMessageValue("kisi.kaydedildi"), FacesMessage.SEVERITY_INFO);
        } else {
          if (this.kisikimlikPojo.getTcKimlikNo() != null) {
            this.kisi.setKimlikno(this.kisikimlikPojo.getTcKimlikNo());
          }
        }
        try {
          this.personelGorev = new PersonelBirimGorev();
          this.personelGorev.setBirimRef(getSessionUser().getPersonelRef().getBirimRef());
          this.personelGorev.setDurum(PersonelGorevDurum._AKTIF);
        } catch (Exception e) {
          // TODO Auto-generated catch block
          logYaz("Exception @" + getModelName() + "Controller :", e);
        }
        wizardStep++;
      } catch (DBException e) {
        createGenericMessage(KeyUtil.getMessageValue("kisi.hata"), FacesMessage.SEVERITY_ERROR);
        logYaz("Exception @" + getModelName() + "Controller :", e);
      }
    } else {
      wizardStep++;
    }
  }
Ejemplo n.º 7
0
 @SuppressWarnings("unchecked")
 public void executeKullaniciRapor() {
   if (getKisiRaporlamaFilter().getKullanicirapor() != null) {
     logYaz(
         "Calistirilacak rapor adi = "
             + getKisiRaporlamaFilter().getKullanicirapor().getRaporadi());
     Kullanicirapor rapor =
         (Kullanicirapor)
             getDBOperator()
                 .find(
                     Kullanicirapor.class.getSimpleName(),
                     "rID",
                     getKisiRaporlamaFilter().getKullanicirapor().getRID() + "")
                 .get(0);
     setList(getDBOperator().load(Kisi.class.getSimpleName(), rapor.getWherecondition(), "o.rID"));
   }
   if (isEmpty(getList())) {
     createGenericMessage(KeyUtil.getMessageValue("kayit.bulunamadi"), FacesMessage.SEVERITY_WARN);
   }
   getKisiRaporlamaFilter().setKullanicirapor(null);
 }
Ejemplo n.º 8
0
 @Override
 public String toString() {
   return KeyUtil.getMessageValue(label);
 }
Ejemplo n.º 9
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);
    }
  }
Ejemplo n.º 10
0
  @SuppressWarnings("unchecked")
  public void filterKisi() throws DBException {

    if (getCalistirilacakRaporRID() != null && getCalistirilacakRaporRID() != 0L) {
      logYaz("Calistirilacak rapor id = " + getCalistirilacakRaporRID());
      Kullanicirapor rapor =
          (Kullanicirapor)
              getDBOperator()
                  .find(
                      Kullanicirapor.class.getSimpleName(), "rID", getCalistirilacakRaporRID() + "")
                  .get(0);
      setList(getDBOperator().load(Kisi.class.getSimpleName(), rapor.getWherecondition(), "o.rID"));
      return;
    }

    getKisiRaporlamaFilter().setKullanicirapor(null);
    StringBuilder whereCon = new StringBuilder(" 1 = 1 ");

    if (getKisiRaporlamaFilter().getKurumadi() != null) {
      whereCon.append(
          " AND (SELECT COUNT(krmkisi.rID) FROM KurumKisi AS krmkisi WHERE krmkisi.kisiRef.rID = o.rID AND "
              + "(UPPER(krmkisi.kurumRef.ad) LIKE UPPER('%"
              + getKisiRaporlamaFilter().getKurumadi()
              + "%')))>0");
    }

    if (getKisiRaporlamaFilter().getCinsiyet() != null
        && getKisiRaporlamaFilter().getCinsiyet() != Cinsiyet._NULL) {
      whereCon.append(
          " AND (SELECT COUNT(kmlk.rID) FROM Kisikimlik AS kmlk WHERE kmlk.kisiRef.rID = o.rID AND kmlk.cinsiyet="
              + getKisiRaporlamaFilter().getCinsiyet().getCode()
              + " ) > 0 ");
    }
    if (getKisiRaporlamaFilter().getYasadigiIl() != null) {
      whereCon.append(
          " AND (SELECT COUNT(evadres.rID) FROM Adres AS evadres WHERE evadres.kisiRef.rID = o.rID AND evadres.adresturu="
              + AdresTuru._EVADRESI.getCode()
              + " AND evadres.sehirRef.rID="
              + getKisiRaporlamaFilter().getYasadigiIl().getRID()
              + ") > 0 ");
    }
    if (getKisiRaporlamaFilter().getCalistigiIl() != null) {
      whereCon.append(
          " AND (SELECT COUNT(adrs.rID) FROM Adres AS adrs WHERE adrs.kisiRef.rID = o.rID AND adrs.adresturu="
              + AdresTuru._ISADRESI.getCode()
              + " AND adrs.sehirRef.rID="
              + getKisiRaporlamaFilter().getCalistigiIl().getRID()
              + " ) > 0 ");
    }

    if (getKisiRaporlamaFilter().getDogumtarih() != null
        && getKisiRaporlamaFilter().getDogumtarihMax() != null) {
      whereCon.append(
          " AND (SELECT COUNT(kisikmlk.rID) FROM Kisikimlik AS kisikmlk WHERE kisikmlk.kisiRef.rID = o.rID  AND"
              + " to_char(kisikmlk.dogumtarih, 'yyyy-mm-dd') >= '"
              + DateUtil.dateToYMD(getKisiRaporlamaFilter().getDogumtarih())
              + "' AND to_char(kisikmlk.dogumtarih, 'yyyy-mm-dd') <= '"
              + DateUtil.dateToYMD(getKisiRaporlamaFilter().getDogumtarihMax())
              + "') > 0 ");
    }

    if (getKisiRaporlamaFilter().getTelefonYok()) {
      whereCon.append(
          " AND (SELECT COUNT(tlfn.rID) FROM Telefon AS tlfn WHERE tlfn.kisiRef.rID=o.rID AND tlfn.varsayilan="
              + EvetHayir._EVET.getCode()
              + ") = 0");
    }

    if (getKisiRaporlamaFilter().getEpostaYok()) {
      whereCon.append(
          " AND (SELECT COUNT(eposta.rID) FROM Internetadres AS eposta WHERE eposta.kisiRef.rID=o.rID AND eposta.varsayilan="
              + EvetHayir._EVET.getCode()
              + ") = 0");
    }

    //		logYaz("SORGU KRITERI : " + whereCon.toString());
    int count = getDBOperator().recordCount(Kisi.class.getSimpleName(), whereCon.toString());
    //		logYaz("BULUNAN UYE SAYISI :" + count);
    if (count > 1500) {
      createGenericMessage(
          "DIKKAT! C*k fazla kayit (" + count + ") bulundu! Lutfen daha fazla kriter giriniz!",
          FacesMessage.SEVERITY_ERROR);
      return;
    }
    setList(getDBOperator().load(Kisi.class.getSimpleName(), whereCon.toString(), "o.rID"));

    if (isEmpty(getList())) {
      createGenericMessage(KeyUtil.getMessageValue("kayit.bulunamadi"), FacesMessage.SEVERITY_WARN);
    } else {
      setWhereCondition(whereCon.toString());
    }
  }