Exemplo n.º 1
0
        public ActionResult ChangePassword(string WebUserID, string oldpassword, string newpassword)
        {
            string userkey   = ConfigurationManager.AppSettings["userkey"];
            string uid       = ConfigurationManager.AppSettings["uid"];
            string LoginUser = (string)Session["LoginSAPID"];

            string ipaddress   = Request.UserHostAddress;
            string Agent       = Request.UserAgent;
            string BrowserUsed = Request.Browser.Browser;

            try
            {
                Employer.Employer employer = new Employer.Employer();
                var changeStatus           = employer.ChangePassword(WebUserID, BrowserUsed, WebUserID, newpassword, uid, userkey, uid);

                var changeDetails = changeStatus.Split('~');

                if (changeDetails[0] != "4")
                {
                    TempData["error"] = changeDetails[1];
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["error"] = changeDetails[1];
                    return(RedirectToAction("Index"));
                }
            }catch (Exception ex)
            {
                LogError logerror = new LogError();
                logerror.ErrorLog(WebUserID, "", "", "Login/ChangePassword", "Login", "ChangePassword", "ChangePassword Error", ex.Message.ToString(), 0);
                return(View());
            }
        }