Exemplo n.º 1
0
        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 }));
            }
        }
Exemplo n.º 2
0
        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;
 }
Exemplo n.º 4
0
        public ActionResult GetNewPassword(string logonId, string password)
        {
            ApplicationUserServices.UserpasswordUpdate(logonId, password);

            return(RedirectToAction("Index", "Home"));
        }