Exemple #1
0
        public double GetPeriodMoney(AimModel aimModel)
        {
            var needToCollect = aimModel.FinalBalance - aimModel.CurrentBalance;
            var period        = aimModel.FinalDate - aimModel.StartDate;
            var totalWeeks    = period.TotalDays / aimModel.DayPeriod;

            var everyWeekMoneyNeed = needToCollect / totalWeeks;

            return(everyWeekMoneyNeed);
        }
Exemple #2
0
        public List <DateTime> CalculateIdealTimePoints(AimModel aimModel)
        {
            var result = new List <DateTime>();

            for (var date = aimModel.StartDate; date < aimModel.FinalDate;)
            {
                result.Add(date);
                date = date.AddDays(aimModel.DayPeriod);
            }

            return(result);
        }
Exemple #3
0
        public List <KeyValuePair <DateTime, double> > CalculateActualTimePoints(AimModel aimModel)
        {
            var result = new List <KeyValuePair <DateTime, double> >();

            var startDate = aimModel.StartDate;

            if (aimModel.History.Any())
            {
                startDate = aimModel.History.Last().Key;
                result.AddRange(aimModel.History);
            }

            for (var date = startDate; date < aimModel.FinalDate;)
            {
                result.Add(new KeyValuePair <DateTime, double>(date, aimModel.DayPeriod));
                date = date.AddDays(aimModel.DayPeriod);
            }

            return(result);
        }
Exemple #4
0
 public Task SaveChangesAsync(AimModel aimModel)
 {
     return(_storage.SaveAsync(PURSES_STRING, aimModel.Name, aimModel));
 }
Exemple #5
0
 public Task RemoveAim(AimModel aimModel)
 {
     return(_storage.DeleteAsync(PURSES_STRING, aimModel.Name));
 }
 public async Task RemoveAimAsync(AimModel model)
 {
     await _aimManager.RemoveAim(model);
 }
Exemple #7
0
 public AimView()
 {
     am                 = new AimModel();
     am.focus           = 20;
     am.travel_Vertical = 25;//mm
 }