public frmThongKeDoanhThuDichVu() { InitializeComponent(); Nam_Load(); Thang_Load(); LoadingPanel.Visibility = Visibility.Visible; LoadingPanel.IsBusy = true; rdbTheoNgay.IsChecked = true; TKDoanhThuDichVuClient = new TKDoanhThuDichVuSVCClient(); TKDoanhThuDichVuClient.HoaDonDichVu_GetItems_TheoNgayCompleted += new EventHandler<HoaDonDichVu_GetItems_TheoNgayCompletedEventArgs>(TKDoanhThuDichVuClient_HoaDonDichVu_GetItems_TheoNgayCompleted); TKDoanhThuDichVuClient.HoaDonDichVu_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.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true; TKDoanhThuDichVuClient = new TKDoanhThuDichVuSVCClient(); TKDoanhThuDichVuClient.HoaDonDichVu_GetItems_TheoNgayCompleted += new EventHandler<HoaDonDichVu_GetItems_TheoNgayCompletedEventArgs>(TKDoanhThuDichVuClient_HoaDonDichVu_GetItems_TheoNgayCompleted); TKDoanhThuDichVuClient.HoaDonDichVu_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.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true; TKDoanhThuDichVuClient = new TKDoanhThuDichVuSVCClient(); TKDoanhThuDichVuClient.HoaDonDichVu_GetItems_TheoThangCompleted += new EventHandler<HoaDonDichVu_GetItems_TheoThangCompletedEventArgs>(TKDoanhThuDichVuClient_HoaDonDichVu_GetItems_TheoThangCompleted); TKDoanhThuDichVuClient.HoaDonDichVu_GetItems_TheoThangAsync((int)cbxTheoThang.SelectedValue, (int)cbxTheoThangNam.SelectedValue); } } else if ((bool)rdbTheoNam.IsChecked) { if (cbxTheoNam.SelectedIndex != -1) { LoadingPanel.Visibility = Visibility.Visible;LoadingPanel.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true; TKDoanhThuDichVuClient = new TKDoanhThuDichVuSVCClient(); TKDoanhThuDichVuClient.HoaDonDichVu_GetItems_TheoNamCompleted += new EventHandler<HoaDonDichVu_GetItems_TheoNamCompletedEventArgs>(TKDoanhThuDichVuClient_HoaDonDichVu_GetItems_TheoNamCompleted); TKDoanhThuDichVuClient.HoaDonDichVu_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.Visibility = Visibility.Visible;LoadingPanel.IsBusy = true; TKDoanhThuDichVuClient = new TKDoanhThuDichVuSVCClient(); TKDoanhThuDichVuClient.HoaDonDichVu_GetItems_TuNgayDenNgayCompleted += new EventHandler<HoaDonDichVu_GetItems_TuNgayDenNgayCompletedEventArgs>(TKDoanhThuDichVuClient_HoaDonDichVu_GetItems_TuNgayDenNgayCompleted); TKDoanhThuDichVuClient.HoaDonDichVu_GetItems_TuNgayDenNgayAsync(int.Parse(rdpTuNgay.SelectedDate.Value.ToString("yyyyMMdd")), int.Parse(rdpDenNgay.SelectedDate.Value.ToString("yyyyMMdd"))); } } } }