Beispiel #1
0
 public ActionResult Login(Admin objUser)
 {
     if (ModelState.IsValid)
     {
         using (visionDatabaseEntities db = new visionDatabaseEntities())
         {
             var obj = db.Admins.Where(a => a.AdminNAME.Equals(objUser.AdminNAME) && a.AdminPASSWORD.Equals(objUser.AdminPASSWORD)).FirstOrDefault();
             if (obj != null)
             {
                 Session["UserID"]   = obj.AdminID.ToString();
                 Session["UserNAME"] = obj.AdminNAME.ToString();
                 return(RedirectToAction("Index"));
             }
         }
     }
     return(View(objUser));
 }