private void btn_Updater(object sender, RoutedEventArgs e)
        {
            OptimizationHandler opHandler = new OptimizationHandler();

            //      Working when the class and list is made
            List<ProfitItem> profitProductList = opHandler.ProfitCalculation();
            LVProductSubClasses.ItemsSource = profitProductList;
        }
        public ProfitView()
        {
            InitializeComponent();
            OptimizationHandler opHandler = new OptimizationHandler();

            //      Working when the class and list is made
            List<ProfitItem> profitProductList = opHandler.ProfitCalculation();
            LVProductSubClasses.ItemsSource = profitProductList;
        }
Esempio n. 3
0
        private void UpdatePage()
        {
            OptimizationHandler opHandler = new OptimizationHandler();

            List<Fruit> fruitInput = opHandler.GetFruitInfo();

            for (int i = 0; i < fruitInput.Count; i++)
            {
                if (fruitInput[i].FruitName == "Rosehip")
                {
                    string s = fruitInput[i].AmountAvailable.ToString();
                    tbRosehipWeight.Text = s;
                    string t = fruitInput[i].PricePrKg.ToString();
                    tbRosehipPrice.Text = t;
                }
                else if (fruitInput[i].FruitName == "Apple")
                {
                    string s = fruitInput[i].AmountAvailable.ToString();
                    tbAppleWeight.Text = s;
                    string t = fruitInput[i].PricePrKg.ToString();
                    tbApplePrice.Text = t;
                }
                else if (fruitInput[i].FruitName == "Boysenberry")
                {
                    string s = fruitInput[i].AmountAvailable.ToString();
                    tbBoysenberryWeight.Text = s;
                    string t = fruitInput[i].PricePrKg.ToString();
                    tbBoysenberryPrice.Text = t;
                }
                else if (fruitInput[i].FruitName == "Strawberry")
                {
                    string s = fruitInput[i].AmountAvailable.ToString();
                    tbStrawberryWeight.Text = s;
                    string t = fruitInput[i].PricePrKg.ToString();
                    tbStrawberryPrice.Text = t;
                }
                else if (fruitInput[i].FruitName == "Rhubarb")
                {
                    string s = fruitInput[i].AmountAvailable.ToString();
                    tbRhubarbWeight.Text = s;
                    string t = fruitInput[i].PricePrKg.ToString();
                    tbRhubarbPrice.Text = t;
                }
                else if (fruitInput[i].FruitName == "Blackcurrant")
                {
                    string s = fruitInput[i].AmountAvailable.ToString();
                    tbBlackcurrantWeight.Text = s;
                    string t = fruitInput[i].PricePrKg.ToString();
                    tbBlackcurrantPrice.Text = t;
                }
            }
        }
Esempio n. 4
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            OptimizationHandler opHandler = new OptimizationHandler();
            List<Fruit> fruitOutput = new List<Fruit>();

            fruitOutput.Add(new Fruit("Rosehip", Int32.Parse(tbRosehipWeight.Text), Decimal.Parse(tbRosehipPrice.Text)));
            fruitOutput.Add(new Fruit("Apple", Int32.Parse(tbAppleWeight.Text), Decimal.Parse(tbApplePrice.Text)));
            fruitOutput.Add(new Fruit("Boysenberry", Int32.Parse(tbBoysenberryWeight.Text), Decimal.Parse(tbBoysenberryPrice.Text)));
            fruitOutput.Add(new Fruit("Strawberry", Int32.Parse(tbStrawberryWeight.Text), Decimal.Parse(tbStrawberryPrice.Text)));
            fruitOutput.Add(new Fruit("Rhubarb", Int32.Parse(tbRhubarbWeight.Text), Decimal.Parse(tbRhubarbPrice.Text)));
            fruitOutput.Add(new Fruit("Blackcurrant", Int32.Parse(tbBlackcurrantWeight.Text), Decimal.Parse(tbBlackcurrantPrice.Text)));

            opHandler.UpdateFruitInfo(fruitOutput);
        }