private void LoadFilds() { using (DashBoardController ctr = new DashBoardController()) { ctr.LoadReport(date); report = ctr.report; btnOpenCalendar.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(date.ToString("MMMM")); lbBalance.Text = report.TotalIncome.ToString("C"); lbExpense.Text = report.TotalExpenses.ToString("C"); lbRevenue.Text = report.TotalRevenue.ToString("C"); lbEconomy.Text = ctr.GetEconomy(date); ctr.GenerateChart(this.ctBank, ChartType.Account, date); ctr.GenerateChart(this.ctCategories, ChartType.Categories, date); ctr.GenerateChart(this.ctCreditCard, ChartType.CreditCard, date); } }
private void LoadFilds(DateTime date, Report report) { DateTime dateToBoard = VerificDateForCreditCard(report, date); dtvEntries.DataSource = new BindingList <EntryExpenses>(report.EntryExpenses); ctrDash.GenerateChart(ctCategories, ChartType.Categories, date); lbDate.Text = lbDate2.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(dateToBoard.ToString("MMMM yyyy")); lbTotalIncome.Text = lbTotalIncome2.Text = report.TotalIncome.ToString("C"); lbTotalRevenue.Text = lbTotalRevenue2.Text = report.Accounts.Count() > 0 ? report.TotalRevenue.ToString("C") : report.CreditCards.Sum(c => c.Limit).ToString("C"); LbTotalExpense.Text = LbTotalExpense2.Text = report.TotalExpenses.ToString("C"); lbParcelCost.Text = report.CreditCards.Count > 0 ? (report.CreditCards[0].Limit - (report.TotalIncome + report.TotalExpenses)).ToString("C") : "0.00"; dtpDateIni.Value = new DateTime(date.Year, date.Month, 1); dtpDateEnd.Value = new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month)); }