Esempio n. 1
0
        private void RefreshAfterEdit()
        {
            PopulateIngredientsTable();

            IngredientsTable.ClearSelection();

            ClearTextBoxes();

            SuccessLabelSuccess();
        }
Esempio n. 2
0
        static void Main()
        {
            // Create Data Objects
            DishTable        = new DishTable(GameData.DishData);
            IngredientsTable = new IngredientsTable(GameData.IngredientData);

            // Load Icon Files
            IconSet_Application = new List <Image>()
            {
                AppIcons.Application,
                AppIcons.Close,
                AppIcons.Collection,
                AppIcons.Console,
                AppIcons.Document,
                AppIcons.Files,
                AppIcons.FolderClosed,
                AppIcons.FolderOpened,
                AppIcons.Info,
                AppIcons.InfoSmall,
                AppIcons.Log,
                AppIcons.NewFile,
                AppIcons.Properties,
                AppIcons.Nippon_300x,
                AppIcons.Nippon_64x,
                AppIcons.Nippon_32x
            };

            // Load GameIcons
            IconSet_Game = new List <Image>()
            {
                GameIcons.Appearance_24x,
                GameIcons.Aroma_24x,
                GameIcons.Brain_24x,
                GameIcons.Charisma_24x,
                GameIcons.Health_24x,
                GameIcons.Rarity_24x,
                GameIcons.Food_32x24,
                GameIcons.Star_24x,
                GameIcons.Kitchen_24x
            };


            // Start WinForm
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
Esempio n. 3
0
        private void LoadColumns()
        {
            if (_dish.Portions <= 0)
            {
                _ingredientsOC = new ObservableCollection <IngredientsTable>();

                if (_dish.Ingredients != null)
                {
                    foreach (var p in _dish.Ingredients)
                    {
                        var ingredient = new IngredientsTable
                        {
                            Name   = p.Ingredient.Name,
                            Unit   = p.Ingredient.Unit,
                            Weight = p.Quantity,
                            Cost   = Math.Round(p.Ingredient.Cost * p.Quantity, 2)
                        };
                        _ingredientsOC.Add(ingredient);
                        TotalCost = TotalCost + ingredient.Cost;
                    }
                }

                IngredientsDgd.ItemsSource = _ingredientsOC;
            }
            else
            {
                _ingredientsOC = new ObservableCollection <IngredientsTable>();

                if (_dish.Ingredients != null)
                {
                    foreach (var p in _dish.Ingredients)
                    {
                        var ingredient = new IngredientsTable
                        {
                            Name   = p.Ingredient.Name,
                            Unit   = p.Ingredient.Unit,
                            Weight = p.Quantity,
                            Cost   = Math.Round(p.Ingredient.Cost * p.Quantity, 2)
                        };
                        _ingredientsOC.Add(ingredient);
                        TotalCost = TotalCost + ingredient.Cost;
                    }
                }

                IngredientsDgd.ItemsSource = _ingredientsOC;
            }
        }