public frmThongKeDoanhThu()
 {
     InitializeComponent();
     Nam_Load();
     Thang_Load();
     LoadingPanel.Visibility = Visibility.Visible;
     LoadingPanel.IsBusy = true;
     rdbTheoNgay.IsChecked = true;
     TKDoanhThuClient = new TKDoanhThuSVCClient();
     TKDoanhThuClient.HoaDon_GetItems_TheoNgayCompleted += new EventHandler<HoaDon_GetItems_TheoNgayCompletedEventArgs>(TKDoanhThuClient_HoaDon_GetItems_TheoNgayCompleted);
     TKDoanhThuClient.HoaDon_GetItems_TheoNgayAsync(int.Parse(DateTime.Now.ToString("yyyyMMdd")));
 }
 private void btnThongKe_Click(object sender, RoutedEventArgs e)
 {
     if ((bool)rdbTheoNgay.IsChecked)
     {
         if (!String.IsNullOrEmpty(rdpTheoNgay.SelectedDate.ToString()))
         {
             LoadingPanel.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true;
             TKDoanhThuClient = new TKDoanhThuSVCClient();
             TKDoanhThuClient.HoaDon_GetItems_TheoNgayCompleted += new EventHandler<HoaDon_GetItems_TheoNgayCompletedEventArgs>(TKDoanhThuClient_HoaDon_GetItems_TheoNgayCompleted);
             TKDoanhThuClient.HoaDon_GetItems_TheoNgayAsync(int.Parse(rdpTheoNgay.SelectedDate.Value.ToString("yyyyMMdd")));
         }
     }
     else if ((bool)rdbTheoThang.IsChecked)
     {
         if (cbxTheoThang.SelectedIndex != -1 && cbxTheoThangNam.SelectedIndex != -1)
         {
             LoadingPanel.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true;
             TKDoanhThuClient = new TKDoanhThuSVCClient();
             TKDoanhThuClient.HoaDon_GetItems_TheoThangCompleted += new EventHandler<HoaDon_GetItems_TheoThangCompletedEventArgs>(TKDoanhThuClient_HoaDon_GetItems_TheoThangCompleted);
             TKDoanhThuClient.HoaDon_GetItems_TheoThangAsync((int)cbxTheoThang.SelectedValue, (int)cbxTheoThangNam.SelectedValue);
         }
     }
     else if ((bool)rdbTheoNam.IsChecked)
     {
         if (cbxTheoNam.SelectedIndex != -1)
         {
             LoadingPanel.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true;
             TKDoanhThuClient = new TKDoanhThuSVCClient();
             TKDoanhThuClient.HoaDon_GetItems_TheoNamCompleted += new EventHandler<HoaDon_GetItems_TheoNamCompletedEventArgs>(TKDoanhThuClient_HoaDon_GetItems_TheoNamCompleted);
             TKDoanhThuClient.HoaDon_GetItems_TheoNamAsync((int)cbxTheoNam.SelectedValue);
         }
     }
     else if ((bool)rdbTuNgay.IsChecked)
     {
         if (!String.IsNullOrEmpty(rdpTuNgay.SelectedDate.ToString()) && !String.IsNullOrEmpty(rdpDenNgay.SelectedDate.ToString()))
         {
             if (rdpTuNgay.SelectedDate < rdpDenNgay.SelectedDate)
             {
                 LoadingPanel.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true;
                 TKDoanhThuClient = new TKDoanhThuSVCClient();
                 TKDoanhThuClient.HoaDon_GetItems_TuNgayDenNgayCompleted += new EventHandler<HoaDon_GetItems_TuNgayDenNgayCompletedEventArgs>(TKDoanhThuClient_HoaDon_GetItems_TuNgayDenNgayCompleted);
                 TKDoanhThuClient.HoaDon_GetItems_TuNgayDenNgayAsync(int.Parse(rdpTuNgay.SelectedDate.Value.ToString("yyyyMMdd")), int.Parse(rdpDenNgay.SelectedDate.Value.ToString("yyyyMMdd")));
             }
         }
     }
 }