public ActionResult Create(CreateTaskDefinitionEditModel editModel) { if (editModel.IsValid() == false) { Response.StatusCode = 500; return(PartialView("_ValidationErrorSummary", new ValidationErrorSummaryViewModel(editModel.GetValidationErrors()))); } TaskDefinitionListItemViewModel viewModel = _taskDefinitionService.Create(editModel); return(PartialView("_TaskDefinitionTableRow", viewModel)); }
public TaskDefinitionListItemViewModel Create(CreateTaskDefinitionEditModel editModel) { TaskDefinition definition = new TaskDefinition { SystemName = editModel.Title, RoleType = (RoleTypeEnum)Enum.Parse(typeof(RoleTypeEnum), editModel.RoleType), SystemNameEN = editModel.TitleEN }; _taskDefinitionDAO.Store(definition); TaskDefinitionListItemViewModel viewModel = new TaskDefinitionListItemViewModel { Id = definition.Id, SystemName = definition.SystemName, RoleType = definition.RoleType.ToString(), SystemNameEN = definition.SystemNameEN }; return(viewModel); }