Esempio n. 1
0
        public void AddItem(APIMTOrder postedItem)
        {
            List <APIMTOrder> list = GetData();

            postedItem.Code = (list.Count + 1);
            list.Add(postedItem);
        }
Esempio n. 2
0
        public void UpdateItem(APIMTOrder postedItem)
        {
            var editedModel = GetData().First(i => i.Code == postedItem.Code);

            editedModel.Code          = postedItem.Code;
            editedModel.SuperMarket   = postedItem.SuperMarket;
            editedModel.CustomerPhone = postedItem.CustomerPhone;
            editedModel.SupportPhone  = postedItem.SupportPhone;
            editedModel.OrderDate     = postedItem.OrderDate;
            editedModel.Status        = postedItem.Status;
        }
Esempio n. 3
0
        public ActionResult MTOrderPartialUpdate(MVC.Areas.Sell.Models.APIMTOrder item)
        {
            var model = new object[0];

            if (ModelState.IsValid)
            {
                try
                {
                    // Insert here a code to update the item in your model
                    _MTOrderList.UpdateItem(item);
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_MTOrderPartial", _MTOrderList.GetData()));
        }