Exemplo n.º 1
0
        public void RefreshView(Goal_ModelCollection modelCollection)
        {
            Remaining.text = modelCollection.Strings[15];

            decimal RemainingAmount = modelCollection.GoalModel.Amount - DataReformatter.GetExpensesTotal(modelCollection.ExpenseModels);

            Amount.text = "$" + RemainingAmount.ToString();
        }
Exemplo n.º 2
0
        public static decimal After(DAS_ModelCollection modelCollection)
        {
            decimal totalSpentInMonth = DataReformatter.GetExpensesTotal(modelCollection.ExpenseModels);
            decimal amountLeftToSpend = modelCollection.GoalModel.Amount - totalSpentInMonth;

            DateTime firstOfNextMonth = new DateTime(modelCollection.CurrentlySetTime.Year, modelCollection.CurrentlySetTime.Month, 1).AddMonths(1);
            int      daysLeftInMonth  = (firstOfNextMonth - modelCollection.CurrentlySetTime).Days;

            return(amountLeftToSpend / (daysLeftInMonth + 1));
        }
Exemplo n.º 3
0
        public void RefreshView(Goal_V2_ModelCollection modelCollection)
        {
            decimal ExpensesTotal = DataReformatter.GetExpensesTotal(modelCollection.ExpenseModels);

            SpentAmount.text = "$" + ExpensesTotal.ToString();

            PlannedAmount.text = "$" + modelCollection.GoalModel.Amount.ToString();

            decimal RemainingDecimal = modelCollection.GoalModel.Amount - ExpensesTotal;

            RemainingAmount.text = "$" + RemainingDecimal.ToString();
        }
Exemplo n.º 4
0
        public static decimal Before(DAS_ModelCollection modelCollection)
        {
            decimal totalSpentInMonth = DataReformatter.GetExpensesTotal(modelCollection.ExpenseModels);

            if (modelCollection.CurrentlySetTime.Month < DateTime.Now.Month && modelCollection.CurrentlySetTime.Year <= DateTime.Now.Year)
            {
                return(totalSpentInMonth / DateTime.DaysInMonth(modelCollection.CurrentlySetTime.Year, modelCollection.CurrentlySetTime.Month));
            }
            else
            {
                return(totalSpentInMonth / modelCollection.CurrentlySetTime.Day);
            }
        }