예제 #1
0
 public PEOrderKey(DateTime weekFirstDay, WeekRowRank weekRowRank, DateTime date, DayRowRank dayRowRank, string tag = null)
 {
     this.weekFirstDay = weekFirstDay;
     this.weekRowRank  = weekRowRank;
     this.date         = date;
     this.dayRowRank   = dayRowRank;
     this.tag          = tag ?? "";
     this.position     = nextPosition++;
 }
예제 #2
0
 private void AddReminders(BudgetWeek week, SortedDictionary <PEOrderKey, PEBudgetRow> dataSource, DayRowRank dayRowRank, IEnumerable <CashStatement> transfers, IBudget budget, Action <CashStatement> delete, Action <CashStatement> edit, Week currentWeek, Color currentWeekColor)
 {
     foreach (var transfer in transfers)
     {
         dataSource.Add(
             new PEOrderKey(week.FirstDay, WeekRowRank.Other, transfer.Date, dayRowRank, transfer.Description),
             CreatePEBudgetRow(transfer, "Остаток", delete, edit, ExplainReminder(budget, week), currentWeek, currentWeekColor));
     }
 }
예제 #3
0
 private void AddExpenses(BudgetWeek week, SortedDictionary <PEOrderKey, PEBudgetRow> dataSource, DayRowRank dayRowRank, IEnumerable <MonthlyCashStatement> expenses, Week currentWeek, Color currentWeekColor)
 {
     foreach (var expense in expenses)
     {
         var theExpense = expense;
         dataSource.Add(
             new PEOrderKey(week.FirstDay, WeekRowRank.Other, expense.Date, dayRowRank),
             new PEBudgetRow {
             OnEdit          = () => OnEditMonthlyExpense(theExpense),
             OnConfigure     = () => OnEditExpenseItem(theExpense),
             OnDelete        = () => deletionService.DeleteMonthlyCashMovement(theExpense),
             Event           = DescriptionOf(expense),
             Date            = expense.Date.ToString("d"),
             Amount          = expense.Amount.ToString(),
             BackgroundColor = currentWeek != null && currentWeek.Contains(expense.Date) ? currentWeekColor : PEBudgetRow.Default,
         });
     }
 }
예제 #4
0
 private void AddTransfers(Week week, SortedDictionary <PEOrderKey, PEBudgetRow> dataSource, DayRowRank dayRowRank, IEnumerable <CashStatement> transfers, Action <CashStatement> delete, Action <CashStatement> edit, Week currentWeek, Color currentWeekColor)
 {
     foreach (var transfer in transfers)
     {
         dataSource.Add(
             new PEOrderKey(week.FirstDay, WeekRowRank.Other, transfer.Date, dayRowRank, transfer.Description),
             CreatePEBudgetRow(transfer, null, delete, edit, _ => _.Amount.ToString(), currentWeek, currentWeekColor));
     }
 }