Beispiel #1
0
        public ActionResult NumuneEkle(NumunelerTBL n)
        {
            var d1 = db.PersonellerTBL.Where(x => x.PersonelID == n.PersonellerTBL.PersonelID).FirstOrDefault();

            n.PersonellerTBL = d1;

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

            n.LaboratuvarlarTBL = d2;

            var d3 = db.NumuneTurTBL.Where(x => x.NumuneTurID == n.NumuneTurTBL.NumuneTurID).FirstOrDefault();

            n.NumuneTurTBL = d3;

            db.NumunelerTBL.Add(n);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
        public ActionResult HastaProfilGuncelle(NumunelerTBL n)
        {
            if (!ModelState.IsValid)
            {
                return(View("HastaProfilGunGetir"));
            }

            var kullanici = (string)Session["Mail"];

            var numune = db.NumunelerTBL.FirstOrDefault(x => x.Mail == kullanici);

            numune.NumSifre1   = n.NumSifre1;
            numune.NumSifre2   = n.NumSifre2;
            numune.NumuneAd    = n.NumuneAd;
            numune.NumuneSoyad = n.NumuneSoyad;

            db.SaveChanges();

            return(RedirectToAction("HastaProfilGunGetir"));
        }
        public ActionResult HastaGirisyap(NumunelerTBL n)
        {
            var bilgiler = db.NumunelerTBL.FirstOrDefault(x => x.Mail == n.Mail && x.NumSifre1 == n.NumSifre1);

            if (bilgiler != null)
            {
                FormsAuthentication.SetAuthCookie(bilgiler.Mail, false);
                Session["NumuneID"]    = bilgiler.NumuneID.ToString();
                Session["Mail"]        = bilgiler.Mail.ToString();
                Session["NumuneAd"]    = bilgiler.NumuneAd.ToString();
                Session["NumuneSoyad"] = bilgiler.NumuneSoyad.ToString();

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