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++; }
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)); } }
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, }); } }
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)); } }