Example #1
0
        public static void UpdateItem(APIDetailPanel postedItem)
        {
            var editedModel = DetailPanelList.GetData().First(i => i.ID == postedItem.ID);

            editedModel.Items     = postedItem.Items;
            editedModel.Unit      = postedItem.Unit;
            editedModel.Quantity  = postedItem.Quantity;
            editedModel.UnitPrice = postedItem.UnitPrice;
            editedModel.Total     = postedItem.Total;
        }
Example #2
0
        public ActionResult DetailPanelPartialUpdate(MVC.Areas.Purchasing.Models.APIDetailPanel item)
        {
            var model = new object[0];

            if (ModelState.IsValid)
            {
                try
                {
                    // Insert here a code to update the item in your model
                    DetailPanelList.UpdateItem(item);
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_DetailPanelPartial", DetailPanelList.GetData()));
        }
Example #3
0
 public static void AddItem(APIDetailPanel postedItem)
 {
     DetailPanelList.GetData().Add(postedItem);
 }