コード例 #1
0
 public ActionResult Login(doctor p)
 {
     using (FINALSCRIPTTEntities3 db = new FINALSCRIPTTEntities3())
     {
         var usr = db.doctors.SingleOrDefault(u => u.doctor_id == p.doctor_id);
         if (usr != null)
         {
             if (usr.password.ToString() == p.password.ToString())
             {
                 Session["doctor_id"] = usr.doctor_id.ToString();
                 return(RedirectToAction("DoctorWelcome1", "doctor_scedule", new { ide = usr.doctor_id.ToString() }));
             }
         }
         else
         {
             ModelState.AddModelError("", "Email or password is wrong");
         }
     }
     return(View(p));
 }
コード例 #2
0
ファイル: adminsController.cs プロジェクト: Nida111/emailleft
 public ActionResult Login(admin p)
 {
     using (FINALSCRIPTTEntities3 db = new FINALSCRIPTTEntities3())
     {
         var usr = db.admins.FirstOrDefault(u => u.email == p.email);
         if (usr != null)
         {
             if (usr.password.Trim().ToString() == p.password.Trim().ToString())
             {
                 Session["email"] = usr.email.ToString();
                 return(RedirectToAction("AdminDashboard"));
             }
         }
         else
         {
             ModelState.AddModelError("", "Email or password is wrong");
         }
     }
     return(View(p));
 }
コード例 #3
0
        public ActionResult Login(patient p)
        {
            using (FINALSCRIPTTEntities3 db = new FINALSCRIPTTEntities3())
            {
                var usr = db.patients.SingleOrDefault(u => u.email == p.email);

                if (usr != null)
                {
                    if (usr.password.Trim().ToString() == p.password.Trim().ToString())
                    {
                        Session["email"] = usr.email.ToString();
                        idee             = p.email;
                        return(RedirectToAction("PatientWelcome", "patients", new { ide = usr.email.ToString() }));
                    }
                }
                else
                {
                    ModelState.AddModelError("", "Email or password is wrong");
                }
            }
            return(View(p));
        }