예제 #1
0
        public static void AddItem(APIInvoiceType postedItem)
        {
            List <APIInvoiceType> list = GetData();

            //postedItem.Code = String.Format("IT-{0:yyyyMMddHHmmssfff}", DateTime.Now);
            list.Add(postedItem);
        }
예제 #2
0
        public static void UpdateItem(APIInvoiceType postedItem)
        {
            var editedModel = GetData().First(i => i.Code == postedItem.Code);

            editedModel.Name        = postedItem.Name;
            editedModel.Description = postedItem.Description;
            editedModel.Type        = postedItem.Type;
        }
예제 #3
0
        public ActionResult InvoiceTypeGridViewPartialUpdate(MVC.Areas.Accounting.Models.Configuration.APIInvoiceType item)
        {
            var model = InvoiceTypeList.GetData();

            if (ModelState.IsValid)
            {
                try
                {
                    InvoiceTypeList.UpdateItem(item);
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_InvoiceTypeGridViewPartial", model));
        }