예제 #1
0
        public async Task <IActionResult> Details(int groupId)
        {
            var groupViewModel = await this.groupService.GetByIdAsync <DbGroupViewModel>(groupId);

            var dbComplexModel = new DbDetailGroupComplexModel()
            {
                ViewModel = groupViewModel
            };

            return(this.View(dbComplexModel));
        }
예제 #2
0
        public async Task <IActionResult> Edit(DbDetailGroupComplexModel model, int groupId)
        {
            if (!this.ModelState.IsValid)
            {
                this.ModelState.AddModelError("123", "Model is not valid!");
            }

            if (!await this.adminGroupsService.UpdateGroup(model.InputModel, groupId))
            {
                this.TempData["Error"] = "Something went wrong with the request!";
            }

            return(this.RedirectToAction(nameof(this.Details), new { groupId = groupId }));
        }