public JsonResult AccountLogin(string sIDNo, string password, bool rememberMe) { try { bool islogin = ApplicationUserServices.IsLoginBySIDNoAndPassword(sIDNo, password); if (!islogin) { throw new Exception("請確認帳號密碼是否正確!!!"); } string ESPMessage = ApplicationUserServices.ExcludeSpecialPersons(sIDNo); if (ESPMessage != null) { throw new Exception(ESPMessage); } Session["sIDNo"] = sIDNo; if (rememberMe) { Session["password"] = password; //登入為page1,首頁為page2 Session["page"] = "page1"; } return(Json(new { url = Url.Action("Index", "LeaveForm") })); } catch (Exception ex) { return(Json(new { message = ex.Message, error = false })); } }
public JsonResult PasswordUpdate(string password) { try { ApplicationUserServices.UserpasswordUpdate(Session["sIDNo"].ToString(), password); return(Json(new { successMessage = "密碼已更新!" })); } catch (Exception ex) { return(Json(new { message = ex.Message, error = false })); } }
public ApplicationUserController(ApplicationUserServices appService) { _appService = appService; }
public ActionResult GetNewPassword(string logonId, string password) { ApplicationUserServices.UserpasswordUpdate(logonId, password); return(RedirectToAction("Index", "Home")); }