public ActionResult SignUp(SignupViewModel vm) { UserDetailsBEL objUserBEL = new UserDetailsBEL(); objUserBEL.Email_Id = vm.EmailId; objUserBEL.Password = Secure.Encrypt(vm.Password); objUserBEL.First_Name = vm.FirstName; objUserBEL.Last_Name = vm.LastName; objUserBEL.Phone_No1 = vm.Mobile; UserDetailsDAL objUserDAL = new UserDetailsDAL(); List <string> OTPList = new List <string>(); if (ModelState.IsValid) { UserLoginDetailsViewModel LDvm = new UserLoginDetailsViewModel(objUserDAL.AddUserDetails(objUserBEL)); if (string.IsNullOrEmpty(LDvm.ErrorMessage) && (LDvm.User_ID != "" || LDvm.User_ID != string.Empty)) { //FormsAuthentication.SetAuthCookie(objUserBEL.User_ID, true); Session["userDetail"] = LDvm; // return RedirectToAction("Index", "UserDashbaord"); OTPBEL OTPBel = new OTPBEL(); OTPList = OTPBel.GetAndSendOTP(Convert.ToInt64(objUserBEL.Phone_No1)); if (OTPList != null) { if (Convert.ToBoolean(OTPList[2])) { // Session[OTPList[2]+"_OTP"] = OTPList[0]; Session["OTP"] = OTPList[0]; } } return(RedirectToAction("VerifyOTP", "OTP")); // return RedirectToAction("Login", "TrueWheelsUser"); } else { ModelState.AddModelError("", LDvm.ErrorMessage.ToString()); } } else { // Response.Write(ModelState.SelectMany(x => x.Value.Errors.Select(z => z.Exception))); ModelState.AddModelError("", "Data is incorrect!"); } return(View()); }
public ActionResult ForgotPassword(UpdateCred UP) { List <string> OTPList = new List <string>(); OTPBEL OTPBel = new OTPBEL(); // OTPViewModel ovm = new OTPViewModel("ForgotPassword"); TempData["OTPSource"] = "ForgotPassword"; OTPList = OTPBel.GetAndSendOTP(Convert.ToInt64(UP.Mobile)); if (OTPList != null) { if (Convert.ToBoolean(OTPList[2])) { // Session[OTPList[2]+"_OTP"] = OTPList[0]; Session["OTP"] = OTPList[0]; } Session["ForgotMobleNum"] = UP.Mobile; } return(RedirectToAction("VerifyOTP", "OTP")); //return View(); }
public ActionResult ResendOTP() { try { List <string> OTPList = new List <string>(); OTPBEL OTPBel = new OTPBEL(); OTPList = OTPBel.GetAndSendOTP(Convert.ToInt64(((TrueWheels.Web.Models.UserLoginDetailsViewModel)(Session["userDetail"])).Phone_No1)); if (OTPList != null) { if (Convert.ToBoolean(OTPList[2])) { // Session[OTPList[2]+"_OTP"] = OTPList[0]; Session["OTP"] = OTPList[0]; } } return(RedirectToAction("VerifyOTP", "OTP")); } catch { return(RedirectToAction("VerifyOTP", "OTP")); } }