public ActionResult RegisterUser(RegisterIndexModel model) { RegisterModel userModel = new RegisterModel(); userModel.InitRegisterModel(model); if (model.Email == null) { return RedirectToAction("Index", "Register", model); } else { return View(userModel); } }
public ActionResult RegisterUser(RegisterModel userModel) { UserInfo useInfo = userModel.GetEntity(); if (this.IUserInfoDataProvider.GetUserListByLoginName(userModel.LoginName).Count() > 0) { userModel.ErrorState = true; userModel.StateMessage = "LoginName is exsit"; return View(userModel); } else { this.IUserInfoDataProvider.Add(useInfo); FormsAuthentication.SignOut(); FormsAuthentication.SetAuthCookie(useInfo.ID.ToString(), true); return RedirectToAction("Index", "Home", null); } }
public ActionResult RegisterUser(RegisterIndexModel indexModel) { RegisterModel userModel = new RegisterModel(); userModel.InitRegisterModel(indexModel); LoginAndRegisterModel model = new LoginAndRegisterModel(); model.LoginIndexModel = new LoginIndexModel(); model.RegisterIndexModel = indexModel; model.RegisterModel = userModel; if (indexModel.Email == null) { return RedirectToAction("Register", "LoginAndRegister", model); } else { return View(model); } }