Ejemplo n.º 1
0
        public async Task <ActionResult> AddDispatcher(UserRegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var operation = await _dispatcherService.CreateDispatcher(model.ToUserDto("dispatcher"));

                if (operation.Success)
                {
                    Session["Create"] = new AlertViewModel(operation.Message, AlertType.Success);

                    return(RedirectToAction("Index", "Home"));
                }

                return(new HttpOperationStatusResult(operation));
            }

            return(View("AddUser", model));
        }