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