void LoadReport() { modeReport = 0; lbTotal.Text = "(VND) 0"; if (cbmCustomers.SelectedValue != null) { int customerId = (int)cbmCustomers.SelectedValue; if (customerId != 0) { SetupColumnOneCustomer(); modeReport = 1; textForPrint = "Từ ngày " + dtpFrom.Value.ToString(BHConstant.DATE_FORMAT) + " đến ngày " + dtpTo.Value.ToString(BHConstant.DATE_FORMAT); customerPrint = ((Customer)cbmCustomers.SelectedItem); double total = 0.0; CustomerLogService customerLogService = new CustomerLogService(); customerReports = customerLogService.GetReportsOfCustomer(customerId, dtpFrom.Value, dtpTo.Value.AddDays(1).Date, ref total); dgwStockEntranceList.DataSource = customerReports; lbTotal.Text = Global.formatVNDCurrencyText(total.ToString()); } else { SetupColumnAllCustomers(); double total = 0.0; textForPrint = "Từ ngày " + dtpFrom.Value.ToString(BHConstant.DATE_FORMAT) + " đến ngày " + dtpTo.Value.ToString(BHConstant.DATE_FORMAT); CustomerLogService customerLogService = new CustomerLogService(); customersReports = customerLogService.GetReportsOfCustomers(dtpFrom.Value, dtpTo.Value.AddDays(1).Date, ref total); dgwStockEntranceList.DataSource = customersReports; setColorRow(4); lbTotal.Text = Global.formatVNDCurrencyText(total.ToString()); } } else { MessageBox.Show("Không đủ thông tin để lập báo cáo!"); } }