Esempio n. 1
0
        public ActionResult EditItemCategory(ItemCategoryVM itemCategory)
        {
            bool CategoryUpdated;

            if (ModelState.IsValid)
            {
                ItemRepo itemRepo = new ItemRepo();
                CategoryUpdated = itemRepo.UpdateItemCategory(itemCategory);
                if (CategoryUpdated)
                {
                    return(RedirectToAction("ItemCategoryDetail", new { id = itemCategory.ItemCategoryID }));
                }
                else
                {
                    ViewBag.ErrorMsg = "Updated item category failed";
                }
            }
            return(View());
        }