Exemple #1
0
        public ActionResult ItemsTypePartialAddNew(MVC.Areas.Item.Models.APIItemType item)
        {
            var model = new object[0];

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