public ActionResult Index(comUsers user) { if (ModelState.IsValid) { Guid userId = new ClientContext().performLogin(user, ""); if (!Guid.Empty.Equals(userId)) { // Added by Shah: 2014-09-08 Session["isAdmin"] = false; Session["UserId"] = userId; hdlCommon HD = new hdlCommon(); //Session["Links"] = HD.getLinks(userId); //TODO return(RedirectToAction("UI")); } else { ViewBag.errorMsg = "Invalid username or password"; } } return(Index()); }
public ActionResult Index(User admin) { if (ModelState.IsValid) { string AdminID = new SmsMisDB().performLogin(admin, ""); if (!string.IsNullOrEmpty(AdminID)) { // Added by Shah: 2014-09-08 Session["isAdmin"] = true; Session["User"] = AdminID; hdlCommon HD = new hdlCommon(); Session["Links"] = HD.getLinks(AdminID.ToString()); return(RedirectToAction("Home")); } else { ViewBag.errorMsg = "Invalid username or password"; } } return(Index()); }