Beispiel #1
0
        private void RefreshBox()
        {
            //loops through the User.Goals linked array and adds each element to the list boxes(JE)
            Goal_ListBox.Items.Clear();
            Cost_ListBox.Items.Clear();
            Spending.Items.Clear();
            Spending.Refresh();

            decimal goalAdded = 0;

            foreach (Goal g in User.Goals)
            {
                goalAdded += g.EstimatedGoalCost;
            }

            Spending.Items.Add("Current budget: " + "$" + User.SpendingFunds.ToString());
            Spending.Items.Add("Total of all your goals added: " + "$" + goalAdded.ToString());


            decimal Total = (User.SpendingFunds - goalAdded);

            if (Total > 0)
            {
                Spending.Items.Add("You are overbudget by: " + "$" + Total);
            }
            else
            {
                Spending.Items.Add("You are underbudget by: " + "$" + Total);
            }
            sortList();
        }