Exemplo n.º 1
0
        public ActionResult ProfilGuncelle(PersonellerTBL p)
        {
            if (!ModelState.IsValid)
            {
                return(View("ProfilGunGetir"));
            }

            var kullanici = (string)Session["Mail"];
            //string olrak maili taşıycaz
            var personel = db.PersonellerTBL.FirstOrDefault(x => x.Mail == kullanici);

            personel.Sifre1        = p.Sifre1;
            personel.Sifre2        = p.Sifre2;
            personel.PersonelAd    = p.PersonelAd;
            personel.PersonelSoyad = p.PersonelSoyad;
            personel.KullanıcıAdi  = p.KullanıcıAdi;


            var d1 = db.PersonelTurTBL.Where(x => x.PersonelTurID == p.PersonelTurTBL.PersonelTurID).FirstOrDefault();

            p.PersonelTurTBL = d1;


            var d2 = db.LaboratuvarlarTBL.Where(y => y.LabID == p.LaboratuvarlarTBL.LabID).FirstOrDefault();

            p.LaboratuvarlarTBL = d2;

            personel.PersonelTurID = d1.PersonelTurID;
            personel.LabID         = d2.LabID;

            db.SaveChanges();


            return(RedirectToAction("ProfilGunGetir"));
        }
        public ActionResult Kayit(PersonellerTBL p)
        {
            if (!ModelState.IsValid)
            {
                return(View("Kayit"));
            }



            p.PersonelDurum      = false;
            p.PersonelSilmeDurum = true;
            db.PersonellerTBL.Add(p);
            db.SaveChanges();
            ViewBag.BasariliKayit = "Kayıt İşlemi Başarılı";
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult PersonelEkle(PersonellerTBL p)
        {
            var d1 = db.PersonelTurTBL.Where(x => x.PersonelTurID == p.PersonelTurTBL.PersonelTurID).FirstOrDefault();

            p.PersonelTurTBL = d1;

            var d2 = db.LaboratuvarlarTBL.Where(x => x.LabID == p.LaboratuvarlarTBL.LabID).FirstOrDefault();

            p.LaboratuvarlarTBL = d2;

            p.PersonelDurum = false;
            //false olma sebebi yeni eklenen izinli olamaz
            p.PersonelSilmeDurum = true;
            //silme işleminden önce eklerken hep true

            db.PersonellerTBL.Add(p);
            db.SaveChanges();


            return(RedirectToAction("Index"));
        }
Exemplo n.º 4
0
        public ActionResult GirisYap(PersonellerTBL p)
        {
            var bilgiler = db.PersonellerTBL.FirstOrDefault(x => x.Mail == p.Mail && x.Sifre1 == p.Sifre1);

            if (bilgiler != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler.Mail, false);

                Session["PersonelID"]    = bilgiler.PersonelID.ToString();
                Session["Mail"]          = bilgiler.Mail.ToString();
                Session["PersonelAd"]    = bilgiler.PersonelAd.ToString();
                Session["PersonelSoyad"] = bilgiler.PersonelSoyad.ToString();

                return(RedirectToAction("Index", "Anasayfa"));
            }
            else
            {
                ViewBag.HataMesaj = "Hatalı Mail veya Şifre";
                return(View());
            }
        }