public static void UpdateItem(APIPrinciplePanel postedItem) { var editedModel = PrinciplePanelList.GetData().First(i => i.ID == postedItem.ID); editedModel.DebitAccount = postedItem.DebitAccount; editedModel.DebitPostingActor = postedItem.DebitPostingActor; editedModel.CreditAccount = postedItem.CreditAccount; editedModel.CreditPostingActor = postedItem.CreditPostingActor; editedModel.Amount = postedItem.Amount; editedModel.Description = postedItem.Description; }
public ActionResult PrinciplePanelPartialDelete(System.Int32 ID) { var model = new object[0]; if (ID >= 0) { try { // Insert here a code to delete the item from your model PrinciplePanelList.DeleteItem(ID); } catch (Exception e) { ViewData["EditError"] = e.Message; } } return(PartialView("_PrinciplePanelPartial", PrinciplePanelList.GetData())); }
public ActionResult PrinciplePanelPartialUpdate(MVC.Areas.Purchasing.Models.APIPrinciplePanel item) { var model = new object[0]; if (ModelState.IsValid) { try { // Insert here a code to update the item in your model PrinciplePanelList.UpdateItem(item); } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } return(PartialView("_PrinciplePanelPartial", PrinciplePanelList.GetData())); }
public static void DeleteItem(int ma) { var deleteItem = PrinciplePanelList.GetData().First(i => i.ID == ma); PrinciplePanelList.GetData().Remove(deleteItem); }
public static void AddItem(APIPrinciplePanel postedItem) { PrinciplePanelList.GetData().Add(postedItem); }
public ActionResult PrinciplePanelPartial() { var model = new object[0]; return(PartialView("_PrinciplePanelPartial", PrinciplePanelList.GetData())); }