Exemplo n.º 1
0
 public ActionResult Create(int groupId)
 {
     var viewModel = new GroupAdminCategoryCreateViewModel
     {
         GroupId = groupId,
         GroupName = groupService.GetGroupName(groupId),
     };
     return View(viewModel);
 }
Exemplo 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);
 }