public ActionResult UserRegister(UserRegistrationModel model) { AuthenticationProvider ap = new AuthenticationProvider(); if (ap.LoginMach(model.Login)) { ModelState.AddModelError("Login", "Login must be unique"); return View("UserRegister", model); } UserManager um = new UserManager(); UserRegistrationModel urm = new UserRegistrationModel(); if (ModelState.IsValid) { um.Insert(GetUser(model)); } return View("UserRegister", urm); }
public ActionResult DriverRegister(DriverRegistrationModel model) { AuthenticationProvider ap = new AuthenticationProvider(); if(ap.LoginMach(model.Login)) { ModelState.AddModelError("Login", "Login must be unique"); return View("DriverRegister" , model); } DriverManager dm = new DriverManager(); DriverRegistrationModel drm = new DriverRegistrationModel(); if (ModelState.IsValid) { dm.Insert(GetDriver(model)); } return View("DriverRegister", drm); }