public ActionResult Login(patient p)
 {
     using (FINALSCRIPTEntities db = new FINALSCRIPTEntities())
     {
         var usr = db.patients.SingleOrDefault(u => u.email == p.email);
         if (usr != null)
         {
             if (usr.password.ToString() == p.password.ToString())
             {
                 Session["email"] = usr.email.ToString();
                 return(RedirectToAction("SelectDoctor"));
             }
         }
         else
         {
             ModelState.AddModelError("", "Email or password is wrong");
         }
     }
     return(View(p));
 }
 public ActionResult Login(doctor p)
 {
     using (FINALSCRIPTEntities db = new FINALSCRIPTEntities())
     {
         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("DoctorWelcome"));
             }
         }
         else
         {
             ModelState.AddModelError("", "Email or password is wrong");
         }
     }
     return(View(p));
 }