示例#1
0
 internal bool uygunMu(IlklendirCalisanEkleIstekViewModel istek)
 {
     return(!(istek == null));
 }
示例#2
0
 internal string alHataKodu(IlklendirCalisanEkleIstekViewModel istek)
 {
     return("");
 }
示例#3
0
        public IlklendirCalisanEkleYanitViewModel IlklendirCalisanEkle(IlklendirCalisanEkleIstekViewModel istek)
        {
            try
            {
                IlklendirCalisanEkleYanitViewModel yanit     = new IlklendirCalisanEkleYanitViewModel(false);
                List <SelectListItem>     akademikUnvanListe = null;
                List <SelectListItem>     cinsiyetListe      = null;
                List <SelectListItem>     kanGrubuListe      = null;
                List <SelectListItem>     phDegeriListe      = null;
                List <SelectListItem>     ogrenimDurumuListe = null;
                List <SelectListItem>     unvanListe         = null;
                List <SelectListItem>     sinifListe         = null;
                List <SelectListItem>     medeniDurumuListe  = null;
                List <SelectListItem>     kadrosuListe       = null;
                IlklendirCalisanEkleYanit modelYanit         = null;
                IlklendirCalisanEkleIstek modelIstek         = null;
                int kullaniciId = int.MinValue;

                if (!this._kontrol.uygunMu(istek))
                {
                    yanit.IsaretleGecemediIlkKontrolu(this._kontrol.alHataKodu(istek));
                    return(yanit);
                }

                kullaniciId = istek.KullaniciId ?? int.MinValue;

                if (kullaniciId == int.MinValue)
                {
                    throw new ArgumentException();
                }

                modelIstek = new IlklendirCalisanEkleIstek(kullaniciId);

                modelYanit = this._calisanServis.IlklendirCalisanEkle(modelIstek);

                if (modelYanit == null)
                {
                    throw new ApplicationException();
                }

                if (!modelYanit.BasariliMi)
                {
                    throw new ApplicationException();
                }

                akademikUnvanListe = this._cevir.cevir(modelYanit.AkademikUnvanListe.ToList());

                if (akademikUnvanListe == null)
                {
                    throw new ApplicationException();
                }

                cinsiyetListe = this._cevir.cevir(modelYanit.CinsiyetListe.ToList());

                if (cinsiyetListe == null)
                {
                    throw new ApplicationException();
                }

                kanGrubuListe = this._cevir.cevir(modelYanit.KanGrubuListe.ToList());

                if (kanGrubuListe == null)
                {
                    throw new ApplicationException();
                }

                phDegeriListe = this._cevir.cevir(modelYanit.PhDegeriListe.ToList());

                if (phDegeriListe == null)
                {
                    throw new ApplicationException();
                }

                ogrenimDurumuListe = this._cevir.cevir(modelYanit.OgrenimDurumuListe.ToList());

                if (ogrenimDurumuListe == null)
                {
                    throw new ApplicationException();
                }

                unvanListe = this._cevir.cevir(modelYanit.UnvanListe.ToList());

                if (unvanListe == null)
                {
                    throw new ApplicationException();
                }

                sinifListe = this._cevir.cevir(modelYanit.SinifListe.ToList());

                if (sinifListe == null)
                {
                    throw new ApplicationException();
                }

                medeniDurumuListe = this._cevir.cevir(modelYanit.MedeniDurumuListe.ToList());

                if (medeniDurumuListe == null)
                {
                    throw new ApplicationException();
                }

                kadrosuListe = this._cevir.cevir(modelYanit.KadrosuListe.ToList());

                if (kadrosuListe == null)
                {
                    throw new ApplicationException();
                }

                yanit = new IlklendirCalisanEkleYanitViewModel(akademikUnvanListe, cinsiyetListe, kanGrubuListe, phDegeriListe, ogrenimDurumuListe,
                                                               unvanListe, sinifListe, medeniDurumuListe, kadrosuListe);

                return(yanit);
            }
            catch (Exception hata)
            {
                this._hataServis.YazHata(hata);
                return(new IlklendirCalisanEkleYanitViewModel(hata));
            }
        }