public ActionResult Login(string uname, string pwd) { try { Fly_Customer objUser = _repositoryUser.SignIn(uname, pwd); // string role = (objUser.IsAdmin.GetValueOrDefault(false)) ? true : false; var flag = (objUser != null); if (flag) { FormsAuthentication.SetAuthCookie(uname, true); Session["idxu"] = objUser.CustomerID; Session.Timeout = 60; } return(Json(flag, JsonRequestBehavior.DenyGet)); } catch { return(View()); } }
public ActionResult Login(string uname, string pwd) { bool flag = false; try { Fly_Customer objUser = _repositoryUser.SignIn(uname, pwd); flag = (objUser != null && objUser.IsAdmin.GetValueOrDefault(false)); if (flag) { FormsAuthentication.SetAuthCookie(uname, true); Session["idxu"] = objUser.CustomerID; } else { return(View()); } return(Json(flag, JsonRequestBehavior.DenyGet)); } catch (Exception ex) { return(View(ex.Message)); } }