public ActionResult ResetPassword(string EncryptUserClientId, ClientChangePassword ObjModel) { if (ModelState.IsValidField("NewPassword") && ModelState.IsValidField("ConfirmPassword")) { EncryptUserClientId = EncryptUserClientId.Replace("$", "+"); EncryptUserClientId = EncryptUserClientId.Replace("/", "!"); Encrypt64 encrypt = new Encrypt64(); string UserClientId = encrypt.Decrypt(EncryptUserClientId, ConfigurationManager.AppSettings["SecureKey"].ToString()); ObjModel.UserClientId = Convert.ToInt32(UserClientId); ClientLoginHelper clientLoginHelper = new ClientLoginHelper(); ClientLogOnModel clientLogOnModel = new ClientLogOnModel(); clientLogOnModel = clientLoginHelper.GetById(ObjModel.UserClientId); int Result = clientLoginHelper.ForgotChangePassword(ObjModel); if (Result == 0) { TempData["CommonMessage"] = AppLogic.setMessage(0, "Password changed sucessfully"); return(Redirect(Url.Content("~/" + clientLogOnModel.StrataPortalLink + "/Login"))); } else { TempData["CommonMessage"] = AppLogic.setMessage(1, "Please check password you have entered and Try again"); return(View()); } } else { return(View()); } }
// GET: DashBoard public ActionResult Index() { ClientLogOnModel model = new ClientLogOnModel(); ClientLoginHelper clientLoginHelper = new ClientLoginHelper(); if (ClientSessionData.UserClientId != 0) { model = clientLoginHelper.GetById(ClientSessionData.UserClientId); } return(View(model)); }
public ActionResult ResetPassword(ClientChangePassword ObjModel) { // if (ModelState.IsValid) { ClientLoginHelper clientLoginHelper = new ClientLoginHelper(); int Result = clientLoginHelper.ResetChangePassword(ObjModel); if (Result == 0) { TempData["CommonMessage"] = AppLogic.setMessage(0, "Password changed sucessfully"); } else { TempData["CommonMessage"] = AppLogic.setMessage(1, "Please check password you have entered and Try again"); } } return(Redirect(Url.Content("~/" + ClientSessionData.ClientPortalLink + "/settings/resetpassword"))); }
public ActionResult ForgotPassword(ClientForgetPasswordModel objClientForgetPasswordModel) { try { if (ModelState.IsValid) { string message = string.Empty; objClientForgetPasswordModel.Flag = 4; ClientLoginHelper ClientLoginHelper = new ClientLoginHelper(); int StratasBoardId = ClientLoginHelper.ClientPasswordReminder(objClientForgetPasswordModel); if (StratasBoardId > 0) { string result = EmailSender.FncSend_StratasBoard_ForgotPassword_ToClient(StratasBoardId); if (result == "success") { ViewBag.Style = "color:Green !important"; TempData["CommonMessage"] = AppLogic.setFrontendMessage(0, "Your password has been sent. Please check your inbox. It usually takes a few minutes but when we're busy.it may take longer."); } else { ViewBag.Message = "color:Red !important"; TempData["CommonMessage"] = AppLogic.setFrontendMessage(0, "Please try again."); } } else { ViewBag.Message = "color:Red !important"; TempData["CommonMessage"] = AppLogic.setFrontendMessage(2, "Please enter correct email as Email does not exits in our database."); } } return(View(objClientForgetPasswordModel)); } catch { ViewBag.Message = "color:Red !important"; TempData["CommonMessage"] = "Email address does not exists. Please try again."; return(View(objClientForgetPasswordModel)); } }