示例#1
0
        public ActionResult ResetPassword(ResetPassword Info)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    string Password = "", TempPass = "";

                    if (Info.Password != "" && Info.Password != null)
                    {
                        Password = Info.Password.ToString();

                        TempPass = BrokerUtility.EncryptURL(Password);

                        int Flag = BrokerUtility.ResetPassWord(Session["EmailId"].ToString(), TempPass);
                        if (Flag > 0)
                        {
                            int    Flag1    = BrokerWSUtility.ForgetPasswordRanNum(Session["EmailId"].ToString(), "");
                            string UserType = Session["ResetPasswordUserType"].ToString();

                            if (UserType == "Customer")
                            {
                                ViewBag.LoginUrl = "CustomerLogin";
                            }
                            else if (UserType == "Broker")
                            {
                                ViewBag.LoginUrl = "BrokerLogin";
                            }

                            ViewBag.Message = "Your password has been reset successfully.";

                            return(View("ResetResult"));
                        }
                        else
                        {
                            ViewBag.Message = "Password could not reset. Please try again. ";
                            return(View("ResetResult"));
                        }
                    }
                    else
                    {
                        return(View());
                    }
                }
                else
                {
                    return(View());
                }
            }
            catch (Exception Ex)
            {
                ViewBag.Message = "Password could not reset. Please try again. ";
                return(View("ResetResult"));
            }
        }