Esempio n. 1
0
 public ActionResult Create(int groupId)
 {
     var viewModel = new GroupAdminCategoryCreateViewModel
     {
         GroupId = groupId,
         GroupName = groupService.GetGroupName(groupId),
     };
     return View(viewModel);
 }
Esempio n. 2
0
 public ActionResult Create(GroupAdminCategoryCreateViewModel viewModel)
 {
     if (ModelState.IsValid)
     {
         var category = new Category
         {
             Name = viewModel.Name,
             GroupId = viewModel.GroupId,
         };
         categoryService.CreateCategory(category);
         return Redirect("/GroupAdmin/Group");
     }
     return View(viewModel);
 }