예제 #1
0
        public ActionResult CategoryDelete(Category category)
        {
            var categoryService = new CategoryLogic();

            categoryService.DeleteCategory(category.CategoryId);
            return(RedirectToAction("Categories"));
        }
        private void DeleteCategory(object sender, RoutedEventArgs e)
        {
            var element  = (FrameworkElement)sender;
            var category = element.DataContext as Category;

            if (category == null)
            {
                return;
            }

            CategoryLogic.DeleteCategory(category);
        }
예제 #3
0
 public void DeleteCategory_Test()
 {
     Assert.AreEqual(3, _categoryLogic.GetAllCategories().Count);
     _categoryLogic.DeleteCategory(1);
     Assert.AreEqual(2, _categoryLogic.GetAllCategories().Count);
 }