private void rdoTime_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (revenueDataTable != null)
     {
         revenueDataTable.Clear();
         revenueReport = null;
         docRevenueView.PrintingSystem = null;
         docRevenueView.UpdatePageView();
     }
     //
     switch (rdoTime.SelectedIndex)
     {
         case 0:
             {
                 dateMonthYear.Enabled = true;
                 dateMonthYear.Text = null;
                 //
                 lblThisYear.Text = null;
                 dateFrom.Enabled = false;
                 dateFrom.Text = null;
                 dateTo.Enabled = false;
                 dateTo.Text = null;
                 break;
             }
         case 1:
             {
                 lblThisYear.Text = DateTime.Now.Year.ToString();
                 //
                 dateMonthYear.Enabled = false;
                 dateMonthYear.Text = null;
                 dateFrom.Enabled = false;
                 dateFrom.Text = null;
                 dateTo.Enabled = false;
                 dateTo.Text = null;
                 break;
             }
         case 2:
             {
                 dateFrom.Enabled = true;
                 dateFrom.Text = null;
                 dateTo.Enabled = true;
                 dateTo.Text = null;
                 //
                 dateMonthYear.Enabled = false;
                 dateMonthYear.Text = null;
                 lblThisYear.Text = null;
                 break;
             }
         default:
             break;
     }
 }
 private void ReportByDate()
 {
     if (revenueDataTable != null)
     {
         revenueDataTable.Clear();
     }
     switch (rdoTime.SelectedIndex)
     {
         case 0://theo thang/nam
             {
                 DateTime reportDate = dateMonthYear.DateTime;
                 revenueReport = new rptRevenueReport(reportDate);
                 revenueDataTable = orderDetailBUS.GetRevenueReportByMY(reportDate.Month.ToString(), reportDate.Year.ToString());
                 break;
             }
         case 1://theo nam
             {
                 int thisYear = DateTime.Now.Year;
                 revenueReport = new rptRevenueReport(thisYear);
                 revenueDataTable = orderDetailBUS.GetRevenueReportByY(thisYear.ToString());
                 break;
             }
         case 2://trong khoang
             {
                 DateTime reportDateFrom = dateFrom.DateTime;
                 DateTime reportDateTo = dateTo.DateTime;
                 revenueReport = new rptRevenueReport(reportDateFrom, reportDateTo);
                 revenueDataTable = orderDetailBUS.GetRevenueReportByFromTo(reportDateFrom, reportDateTo);
                 break;
             }
         default:
             break;
     }
 }
 private void frmRevenueReport_Load(object sender, EventArgs e)
 {
     revenueReport = new rptRevenueReport();
     revenueDataTable = new DataTable();
     //
     //
     dateMonthYear.Enabled = true;
     dateMonthYear.Text = null;
     //
     lblThisYear.Text = null;
     dateFrom.Enabled = false;
     dateFrom.Text = null;
     dateTo.Enabled = false;
     dateTo.Text = null;
     //
 }