public static bool login(PatientLogin _ptlogin) { return(Membership.ValidateUser(_ptlogin.UserName, _ptlogin.Password)); }
public JsonResult Login(UserLogin _login) { string retmsg = "Error"; string getid = Request.ServerVariables["http_referer"]; if (!string.IsNullOrEmpty(getid)) { getid = getid.ToLower(); } string ReturnUrl = string.Empty; string url = ConfigurationManager.AppSettings["SiteUrl"]; if (getid.Contains("riskanalysis")) { if (!string.IsNullOrEmpty(getid)) { string[] getreturnurl = getid.Split('='); ReturnUrl = getreturnurl[1].ToString(); } } PatientLogin _ptlogin = new PatientLogin() { UserName = _login.UserName, Password = _login.Password }; bool IsAuth = PatientLogin.login(_ptlogin); if (IsAuth) { string[] GetRole = Roles.GetRolesForUser(_login.UserName); FormsAuthentication.SetAuthCookie(_login.UserName, true); //if (!string.IsNullOrEmpty(ReturnUrl)) // return Redirect(url + "/" + ReturnUrl); //else // return RedirectToAction("QuestionPart1", "Question"); retmsg = "Success"; } else { retmsg = "Invalid credentials!"; } return Json(retmsg, JsonRequestBehavior.AllowGet); }
public static bool login(PatientLogin _ptlogin) { return Membership.ValidateUser(_ptlogin.UserName, _ptlogin.Password); }