Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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()));
        }
Ejemplo n.º 4
0
        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()));
        }
Ejemplo n.º 5
0
 public ActionResult ItemCategoryPartial()
 {
     //var model = new object[0];
     return(PartialView("_ItemCategoryPartial", ItemCategoryList.GetData()));
 }
Ejemplo n.º 6
0
 public static void InitListPostfix2(ItemCategoryList __instance) => InitItemListPostfix(__instance);