public ActionResult Register(Driver driver, Authorization auth)
 {
     auth.Login           = "******";
     auth.Password        = "******";
     auth.Role            = 1;
     driver.Authorization = auth;
     Client.RegistrateDriver(Parser.ParseDriver(driver), Parser.ParseAuth(auth));
     return(RedirectToAction("Index"));
 }
Пример #2
0
        public ActionResult Register(Driver driver, Authorization auth)
        {
            /*auth.Login = "******";
             * auth.Password = "******";
             * auth.Role = 1;
             * driver.Authorization = auth;*/
            /*var auth1 = Client.FindAuth(auth.ID);
             * if (auth1 == null)
             * {*/
            auth.Role = 1;
            DriverAuth driverAuth = new DriverAuth(auth, driver);

            if (Client.RegistrateDriver(Parser.ParseDriver(driverAuth.Driver), Parser.ParseAuth(driverAuth.Auth)) == false)
            {
                ModelState.AddModelError("", "Данный логин уже занят");
            }
            else
            {
                Client.RegistrateDriver(Parser.ParseDriver(driverAuth.Driver), Parser.ParseAuth(driverAuth.Auth));
                return(RedirectToAction("Login"));
            }
            return(View());
        }