public static void UpdateItemCategory(APIItemCategory e) { var editModel = ItemCategoryList.GetData().First(i => i.Code == e.Code); editModel.Code = e.Code; editModel.Name = e.Name; editModel.Description = e.Description; }
public ActionResult ItemCategoryPartialUpdate(MVC.Areas.Item.Models.APIItemCategory item) { var model = new object[0]; if (ModelState.IsValid) { try { // Insert here a code to update the item in your model ItemCategoryList.UpdateItemCategory(item); } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } return(PartialView("_ItemCategoryPartial", ItemCategoryList.GetData())); }
public static void AddItemCategory(APIItemCategory e) { ItemCategoryList.GetData().Add(e); }