public frmThongKeChiTieu()
 {
     InitializeComponent();
     Nam_Load();
     Thang_Load();
     LoadingPanel.Visibility = Visibility.Visible;
     LoadingPanel.IsBusy = true;
     rdbTheoNgay.IsChecked = true;
     TKChiTieuClient = new TKChiTieuSVCClient();
     TKChiTieuClient.PhieuNhapKho_GetItems_TheoNgayCompleted += new EventHandler<PhieuNhapKho_GetItems_TheoNgayCompletedEventArgs>(TKChiTieuClient_PhieuNhapKho_GetItems_TheoNgayCompleted);
     TKChiTieuClient.PhieuNhapKho_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.Collapsed;
             LoadingPanel.IsBusy = true;
             TKChiTieuClient = new TKChiTieuSVCClient();
             TKChiTieuClient.PhieuNhapKho_GetItems_TheoNgayCompleted += new EventHandler<PhieuNhapKho_GetItems_TheoNgayCompletedEventArgs>(TKChiTieuClient_PhieuNhapKho_GetItems_TheoNgayCompleted);
             TKChiTieuClient.PhieuNhapKho_GetItems_TheoNgayAsync(int.Parse(rdpTheoNgay.SelectedDate.Value.ToString("yyyyMMdd")));
         }
     }
     else if ((bool)rdbTheoThang.IsChecked)
     {
         if (cbxTheoThang.SelectedIndex != -1 && cbxTheoThangNam.SelectedIndex != -1)
         {
             LoadingPanel.Visibility = Visibility.Collapsed;
             LoadingPanel.IsBusy = true;
             TKChiTieuClient = new TKChiTieuSVCClient();
             TKChiTieuClient.PhieuNhapKho_GetItems_TheoThangCompleted += new EventHandler<PhieuNhapKho_GetItems_TheoThangCompletedEventArgs>(TKChiTieuClient_PhieuNhapKho_GetItems_TheoThangCompleted);
             TKChiTieuClient.PhieuNhapKho_GetItems_TheoThangAsync((int)cbxTheoThang.SelectedValue, (int)cbxTheoThangNam.SelectedValue);
         }
     }
     else if ((bool)rdbTheoNam.IsChecked)
     {
         if (cbxTheoNam.SelectedIndex != -1)
         {
             LoadingPanel.Visibility = Visibility.Collapsed;
             LoadingPanel.IsBusy = true;
             TKChiTieuClient = new TKChiTieuSVCClient();
             TKChiTieuClient.PhieuNhapKho_GetItems_TheoNamCompleted += new EventHandler<PhieuNhapKho_GetItems_TheoNamCompletedEventArgs>(TKChiTieuClient_PhieuNhapKho_GetItems_TheoNamCompleted);
             TKChiTieuClient.PhieuNhapKho_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.Collapsed;
                 LoadingPanel.IsBusy = true;
                 TKChiTieuClient = new TKChiTieuSVCClient();
                 TKChiTieuClient.PhieuNhapKho_GetItems_TuNgayDenNgayCompleted += new EventHandler<PhieuNhapKho_GetItems_TuNgayDenNgayCompletedEventArgs>(TKChiTieuClient_PhieuNhapKho_GetItems_TuNgayDenNgayCompleted);
                 TKChiTieuClient.PhieuNhapKho_GetItems_TuNgayDenNgayAsync(int.Parse(rdpTuNgay.SelectedDate.Value.ToString("yyyyMMdd")), int.Parse(rdpDenNgay.SelectedDate.Value.ToString("yyyyMMdd")));
             }
         }
     }
 }