예제 #1
0
        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;
        }
예제 #2
0
        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()));
        }
예제 #3
0
 public static void AddItemCategory(APIItemCategory e)
 {
     ItemCategoryList.GetData().Add(e);
 }