示例#1
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);
 }
示例#2
0
 /// <summary>
 /// Creates a category
 /// </summary>
 /// <param name="category">The category to be created</param>
 public void CreateCategory(Category category)
 {
     categoryRepo.Add(category);
     categoryRepo.Save();
 }