Пример #1
0
        public ActionResult Create(ApprovalModelViewModel approvalModelViewModel)
        {
            if (ModelState.IsValid)
            {
                var result = HRBusinessService.CreateApprovalModel(UserOrganisationId, approvalModelViewModel.ApprovalModel);
                if (result.Succeeded)
                {
                    return(RedirectToAction("Edit", new { id = result.Entity.ApprovalModelId }));
                }
                foreach (var error in result.Errors)
                {
                    ModelState.AddModelError("", error);
                }
            }
            var viewModel = new ApprovalModelViewModel
            {
                ApprovalModel = approvalModelViewModel.ApprovalModel
            };

            return(View(viewModel));
        }