Пример #1
0
        public EntityStateWrapperContainer Modify(CourseUpdate.CommandModel commandModel)
        {
            CourseID     = commandModel.CourseID;
            DepartmentID = commandModel.DepartmentID;
            Credits      = commandModel.Credits;
            Title        = commandModel.Title;

            return(new EntityStateWrapperContainer().ModifyEntity(this));
        }
Пример #2
0
        public async Task <ActionResult> Edit(CourseUpdate.CommandModel commandModel)
        {
            var request  = new CourseUpdate.Request(SystemPrincipal.Name, commandModel);
            var response = DomainServices.Dispatch(request);

            if (!response.HasValidationIssues)
            {
                return(RedirectToAction("Index"));
            }

            ModelState.AddRange(response.ValidationDetails.AllValidationMessages);
            ViewBag.DepartmentID = await CreateDepartmentSelectList(commandModel.DepartmentID);

            return(View(commandModel));
        }