Exemple #1
0
    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;
    }
Exemple #2
0
        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()));
        }
Exemple #3
0
        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()));
        }
Exemple #4
0
    public static void DeleteItem(int ma)
    {
        var deleteItem = PrinciplePanelList.GetData().First(i => i.ID == ma);

        PrinciplePanelList.GetData().Remove(deleteItem);
    }
Exemple #5
0
 public static void AddItem(APIPrinciplePanel postedItem)
 {
     PrinciplePanelList.GetData().Add(postedItem);
 }
Exemple #6
0
        public ActionResult PrinciplePanelPartial()
        {
            var model = new object[0];

            return(PartialView("_PrinciplePanelPartial", PrinciplePanelList.GetData()));
        }