Пример #1
0
        public ActionResult Create(AdministratorEditModel editModel)
        {
            if (editModel.IsValid() == false)
            {
                Response.StatusCode = 500;
                return(PartialView("_ValidationErrorSummary", new ValidationErrorSummaryViewModel(editModel.GetValidationErrors())));
            }

            AdministratorListItemViewModel viewModel = _administratorService.Create(editModel);

            return(PartialView("_AdministratorTableRow", viewModel));
        }
Пример #2
0
        public AdministratorListItemViewModel Create(AdministratorEditModel editModel)
        {
            Administrator administrator = new Administrator(editModel.Username.ToUpper());

            _adminDAO.Store(administrator);

            AdministratorListItemViewModel viewModel = new AdministratorListItemViewModel
            {
                Username = editModel.Username.ToUpper()
            };

            return(viewModel);
        }