public static ItemCategoryList asset; //The List of all Items #if UNITY_EDITOR public static ItemCategoryList createItemCategoryDatabase() //creates a new ItemDatabase(new instance) { asset = ScriptableObject.CreateInstance <ItemCategoryList>(); //of the ScriptableObject InventoryItemList AssetDatabase.CreateAsset(asset, "Assets/InventoryMaster/Resources/CategoryDatabase.asset"); //in the Folder Assets/Resources/ItemDatabase.asset AssetDatabase.SaveAssets(); //and than saves it there return(asset); }
public async Task Init() { if (ItemCategoryList.Count == 0) { var listIC = await _apiServiceIC.Get <List <ItemCategory> >(null); foreach (var ic in listIC) { ItemCategoryList.Add(ic); } ItemCategoryList.Insert(0, new ItemCategory { Category = "Sve stavke menija", ItemCategoryId = -1, ItemTypeId = -1 }); } IEnumerable <RestaurantMenuItem> list = null; if (SelectedItemCategory != null) { if (SelectedItemCategory.ItemCategoryId == -1) { list = await _apiServiceRMI.Get <IEnumerable <RestaurantMenuItem> >(null); ItemList.Clear(); foreach (var item in list) { ItemList.Add(item); } } else { MenuItemSearchRequest req = new MenuItemSearchRequest { ItemCategoryId = SelectedItemCategory.ItemCategoryId }; list = await _apiServiceRMI.Get <IEnumerable <RestaurantMenuItem> >(req); ItemList.Clear(); foreach (var item in list) { ItemList.Add(item); } } } else { list = await _apiServiceRMI.Get <IEnumerable <RestaurantMenuItem> >(null); ItemList.Clear(); foreach (var item in list) { ItemList.Add(item); } } }
public ActionResult ItemCategoryPartialDelete(System.String Code) { var model = new object[0]; if (Code != null) { try { // Insert here a code to delete the item from your model ItemCategoryList.DeleteItemCategory(Code); } catch (Exception e) { ViewData["EditError"] = e.Message; } } return(PartialView("_ItemCategoryPartial", ItemCategoryList.GetData())); }
public ActionResult ItemCategoryPartialUpdate(MVC.Areas.Item.Models.APIItemCategory item) { var model = new object[0]; if (ModelState.IsValid) { try { // Insert here a code to update the item in your model ItemCategoryList.UpdateItemCategory(item); } catch (Exception e) { ViewData["EditError"] = e.Message; } } else { ViewData["EditError"] = "Please, correct all errors."; } return(PartialView("_ItemCategoryPartial", ItemCategoryList.GetData())); }
public ActionResult ItemCategoryPartial() { //var model = new object[0]; return(PartialView("_ItemCategoryPartial", ItemCategoryList.GetData())); }
public static void InitListPostfix2(ItemCategoryList __instance) => InitItemListPostfix(__instance);