private void GetValuesOnForm() { DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } lstMaChiNhanh = new List <string>(); foreach (AutoCompleteCheckBox ChiNhanh in lstSourceChiNhanh.Where(e => e.CheckedMember == true)) { lstMaChiNhanh.Add(ChiNhanh.ValueMember.FirstOrDefault()); } lstNguonVon = new List <string>(); foreach (AutoCompleteCheckBox NguonVon in lstSourceNguonVon.Where(e => e.CheckedMember == true)) { lstNguonVon.Add(NguonVon.ValueMember.FirstOrDefault()); } ngaybaocao = (raddtNgayBaoCao.Value is DateTime) ? ngayBaoCao.ToString("yyyyMM") : ""; thangbaocao = (radtThang.Value is DateTime) ? ngayBaoCao.ToString("yyyyMMdd") : ""; ngonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); dinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime tuNgay = new DateTime(); if (raddtTuNgay.Value is DateTime) { tuNgay = (DateTime)raddtTuNgay.Value; } DateTime denNgay = new DateTime(); if (raddtDenNgay.Value is DateTime) { denNgay = (DateTime)raddtDenNgay.Value; } string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); TenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; MaPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); TenPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).DisplayName; IDSanPham = new List <string>(); foreach (AutoCompleteCheckBox SanPham in lstSourceSanPham.Where(e => e.CheckedMember == true)) { IDSanPham.Add(SanPham.ValueMember[1]); } IDXa = lstSourceXa.ElementAt(cmbXaPhuong.SelectedIndex).KeywordStrings[1]; IDAp = lstSourceAp.ElementAt(cmbThonAp.SelectedIndex).KeywordStrings[1]; lstNguonVon = new List <string>(); foreach (AutoCompleteCheckBox NguonVon in lstSourceNguonVon.Where(e => e.CheckedMember == true)) { lstNguonVon.Add(NguonVon.ValueMember[0]); } TuNgay = tuNgay.ToString("yyyyMMdd"); DenNgay = denNgay.ToString("yyyyMMdd"); NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime tuNgay = new DateTime(); if (raddtTuNgay.Value is DateTime) { tuNgay = (DateTime)raddtTuNgay.Value; } DateTime denNgay = new DateTime(); if (raddtDenNgay.Value is DateTime) { denNgay = (DateTime)raddtDenNgay.Value; } string maLoaiTien = lstSourceLoaiTien.ElementAt(cmbLoaiTien.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = new List <string>(); foreach (AutoCompleteCheckBox ChiNhanh in lstSourceChiNhanh.Where(e => e.CheckedMember == true)) { MaChiNhanh.Add(ChiNhanh.ValueMember.FirstOrDefault()); TenChiNhanh = ChiNhanh.DislayMember + " - "; } MaPhongGiaoDich = new List <string>(); foreach (AutoCompleteCheckBox PhongGD in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { MaPhongGiaoDich.Add(PhongGD.ValueMember.FirstOrDefault()); TenPhongGiaoDich = PhongGD.DislayMember + " - "; } if (MaChiNhanh.Contains("All")) { TenChiNhanh = "Toàn hệ thống"; } if (MaPhongGiaoDich.Contains("All")) { TenPhongGiaoDich = ""; } TuNgay = tuNgay.ToString("yyyyMMdd"); DenNgay = denNgay.ToString("yyyyMMdd"); NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaLoaiTien = maLoaiTien; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
private void LoadDuLieuNhom() { List <string> lstCum = lstSourceAp.Where(f => f.CheckedMember.Equals(true)).Select(f => f.ValueMember[1]).ToList(); lstSourceNhom = new List <AutoCompleteEntry>(); foreach (AutoCompleteEntry auNhom in lstSourceNhomAll.Where(f => lstCum.Contains(f.KeywordStrings[4])).ToList()) { lstSourceNhom.Add(new AutoCompleteEntry(auNhom.DisplayName, auNhom.KeywordStrings)); } new AutoComboBox().GenAutoComboBox(ref lstSourceNhom, ref cmbNhom, null); }
private bool validation() { if (raddtTuNgay.Value > raddtDenNgay.Value) { LMessage.ShowMessage("M.ResponseMessage.BaoCao.TuNgayLonHonDenNgay", LMessage.MessageBoxType.Warning); raddtTuNgay.Focus(); return(false); } if (lstSourceNguonVon.Where(e => e.CheckedMember == true).ToList().Count < 1) { return(false); } return(true); }
private void LoadDuLieuNhom() { List <string> lstCum = lstSourceAp.Where(f => f.CheckedMember.Equals(true)).Select(f => f.ValueMember[1]).ToList(); Tuple <int, string, string> tuple = null; lstSourceNhom_Select.Clear(); foreach (AutoCompleteEntry auNhom in lstSourceNhomAll.Where(f => lstCum.Contains(f.KeywordStrings[4])).ToList()) { tuple = new Tuple <int, string, string>(Convert.ToInt32(auNhom.KeywordStrings[3]), auNhom.KeywordStrings[0], auNhom.DisplayName); lstSourceNhom_Select.Add(tuple); } grSoTienGuiDS.ItemsSource = lstSourceNhom_Select; grSoTienGuiDS.Rebind(); }
private void GetValuesOnForm() { lstIdNhom = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); ngaybaocao = Convert.ToDateTime(raddtNgayBaoCao.Value).ToString(ApplicationConstant.defaultDateTimeFormat); idKhuVuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[1]; sidCum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings[1]; if (cmbKyThu.SelectedItem != null) { AutoCompleteEntry auKyThu = (AutoCompleteEntry)cmbKyThu.SelectedItem; if (auKyThu.KeywordStrings != null && auKyThu.KeywordStrings.Length > 0) { sNgayThuTien = LDateTime.StringToDate(auKyThu.KeywordStrings[2], "yyyyMMdd").ToString(ApplicationConstant.defaultDateTimeFormat); } } foreach (DataRowView drv in grdKhachHang.SelectedItems) { lstIdNhom.Add(drv["ID"].ToString()); } foreach (AutoCompleteCheckBox LoaiSP in lstSourceLoaiSanPham.Where(e => e.CheckedMember == true)) { lstMaLoaiSP.Add(LoaiSP.ValueMember[0]); } }
private void GetFormValues() { lstChiNhanh = new List <string>(); lstNguonVon = new List <string>(); foreach (AutoCompleteCheckBox auChiNhanh in lstSourceChiNhanh.Where(e => e.CheckedMember == true)) { lstChiNhanh.Add(auChiNhanh.ValueMember[0]); TenChiNhanh = auChiNhanh.DislayMember + " - "; } foreach (AutoCompleteCheckBox auNguonVon in lstSourceNguonVon) { if (auNguonVon.CheckedMember) { lstNguonVon.Add(auNguonVon.ValueMember[0]); } } if (lstChiNhanh.Contains("All")) { TenChiNhanh = "Toàn hệ thống"; } ngayChotDLieu = LDateTime.DateToString((DateTime)raddtThangChot.Value, ApplicationConstant.defaultDateTimeFormat); ngaydaunam = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetFirstDateOfYear().ToString(ApplicationConstant.defaultDateTimeFormat); ngaybaocao = LDateTime.DateToString((DateTime)raddtNgayBaoCao.Value, ApplicationConstant.defaultDateTimeFormat); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); }
private void GetValuesOnForm() { lstSanPham = new List <string>(); lstMaCBTD = new List <string>(); lstNguonVon = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); ngaybaocao = Convert.ToDateTime(raddtNgayBaoCao.Value).ToString(ApplicationConstant.defaultDateTimeFormat); tungay = Convert.ToDateTime(raddtTuNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); denngay = Convert.ToDateTime(raddtDenNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); foreach (AutoCompleteCheckBox lstCBTD in lstSourceCBTD.Where(e => e.CheckedMember == true)) { lstMaCBTD.Add(lstCBTD.ValueMember[0].ToString()); } foreach (AutoCompleteCheckBox lstSP in lstSourceSanPham.Where(e => e.CheckedMember == true)) { lstSanPham.Add(lstSP.ValueMember[0].ToString()); } foreach (AutoCompleteCheckBox auNguonVon in lstSourceNguonVon) { if (auNguonVon.CheckedMember) { lstNguonVon.Add(auNguonVon.ValueMember[0]); } } }
private void GetFormValues() { lstId = new List <string>(); lstPhongGD = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); ngaybaocao = Convert.ToDateTime(raddtNgayBaoCao.Value).ToString(ApplicationConstant.defaultDateTimeFormat); tungay = Convert.ToDateTime(raddtTuNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); denngay = Convert.ToDateTime(raddtDenNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); Loai = lstSourceLoaiBC.ElementAt(cmbLoaiBaoCao.SelectedIndex).KeywordStrings.FirstOrDefault(); if (Loai.Equals("KHU_VUC")) { foreach (AutoCompleteCheckBox lstKhuVuc in lstSourceKhuVuc.Where(e => e.CheckedMember = true)) { lstId.Add(lstKhuVuc.ValueMember[1].ToString()); } } else { foreach (AutoCompleteCheckBox lstCum in lstSourceCum.Where(e => e.CheckedMember = true)) { lstId.Add(lstCum.ValueMember[1].ToString()); } } foreach (AutoCompleteCheckBox lst in lstSourcePhongGD.Where(e => e.CheckedMember = true)) { lstPhongGD.Add(lst.ValueMember[1].ToString()); } }
private void GetFormData() { lstIDKyHan = new List <string>(); lstIDSanPham = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); if (lstSourcePhongGD_Select.Count > 0) { maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); } else { maphonggd = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); } //maphonggd = lstSourcePhongGD.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); //maTeller = lstSourceTeller.ElementAt(cmbTeller.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); tungay = Convert.ToDateTime(raddtTuNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); denngay = Convert.ToDateTime(raddtDenNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); ngaybaocao = Convert.ToDateTime(raddtNgayBaoCao.Value).ToString(ApplicationConstant.defaultDateTimeFormat); foreach (DataRowView drv in radgrdSP.SelectedItems) { lstIDSanPham.Add(drv["ID"].ToString()); } foreach (DataRowView drv in radgrdKV.SelectedItems) { lstIDKyHan.Add(drv["ID"].ToString()); } MaTeller = new List <string>(); foreach (AutoCompleteCheckBox Ma in lstSourceTeller.Where(e => e.CheckedMember == true)) { MaTeller.Add(Ma.ValueMember[0]); } }
private void GetFormData() { string maChiNhanh = string.Empty; string tenChiNhanh = string.Empty; maChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); tenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; lstMaPhongGiaoDich = new List <string>(); foreach (AutoCompleteCheckBox PhongGD in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { lstMaPhongGiaoDich.Add(PhongGD.ValueMember.FirstOrDefault()); } lstMaSanPhamTinDung = new List <string>(); lstSourceSanPhamTinDung = cmbSanPham.ItemsSource as ListCheckBoxCombo; foreach (AutoCompleteCheckBox SanPhamTD in lstSourceSanPhamTinDung.Where(e => e.CheckedMember == true)) { lstMaSanPhamTinDung.Add(SanPhamTD.ValueMember.FirstOrDefault()); } DateTime tuNgay = new DateTime(); if (raddtTuNgay.Value is DateTime) { tuNgay = (DateTime)raddtTuNgay.Value; } DateTime denNgay = new DateTime(); if (raddtDenNgay.Value is DateTime) { denNgay = (DateTime)raddtDenNgay.Value; } DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); // Gán dữ liệu từ form vào các biến truyền cho báo cáo MaChiNhanh = maChiNhanh; TenChiNhanh = tenChiNhanh; TuNgay = (raddtTuNgay.Value is DateTime) ? tuNgay.ToString("yyyyMM") + "01" : ""; DenNgay = (raddtDenNgay.Value is DateTime) ? denNgay.ToString("yyyyMM") + LDateTime.GetLastDateOfMonth(denNgay).ToString("dd") : ""; SoTienTu = (!LObject.IsNullOrEmpty(numSoTienTu.Value)) ? LNumber.StringToInt32(numSoTienTu.Value.ToString()).ToString() : ""; SoTienDen = (!LObject.IsNullOrEmpty(numSoTienDen.Value)) ? LNumber.StringToInt32(numSoTienDen.Value.ToString()).ToString() : ""; NgayBaoCao = (raddtNgayBaoCao.Value is DateTime) ? ngayBaoCao.ToString("yyyyMMdd") : ""; MaNguoiLap = ClientInformation.TenDangNhap; TenNguoiLap = ClientInformation.HoTen; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; }
private void GetFormData() { string maChiNhanh = string.Empty; string tenChiNhanh = string.Empty; maChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); tenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; string maPhongGiaoDich = string.Empty; string tenPhongGiaoDich = string.Empty; if (lstSourcePhongGD_Select.Count > 0) { maPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); tenPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).DisplayName; } MaDonVi = (MaPhongGiaoDich.IsNullOrEmpty() || maPhongGiaoDich.Equals("%")) ? maChiNhanh : maPhongGiaoDich; lstMaKhuVuc = new List <string>(); lstSourceKhuVuc = cmbKhuVuc.ItemsSource as ListCheckBoxCombo; foreach (AutoCompleteCheckBox KhuVuc in lstSourceKhuVuc.Where(e => e.CheckedMember == true)) { lstMaKhuVuc.Add(KhuVuc.ValueMember.FirstOrDefault()); } DateTime ngayChotSoLieu = new DateTime(); if (raddtNgayChotSoLieu.Value is DateTime) { ngayChotSoLieu = (DateTime)raddtNgayChotSoLieu.Value; } DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); // Gán dữ liệu từ form vào các biến truyền cho báo cáo MaChiNhanh = maChiNhanh; TenChiNhanh = tenChiNhanh; MaPhongGiaoDich = maPhongGiaoDich; TenPhongGiaoDich = tenPhongGiaoDich; NgayChotSoLieu = (raddtNgayChotSoLieu.Value is DateTime) ? ngayChotSoLieu.ToString("yyyyMMdd") : ""; NgayBaoCao = (raddtNgayBaoCao.Value is DateTime) ? ngayBaoCao.ToString("yyyyMMdd") : ""; MaNguoiLap = ClientInformation.TenDangNhap; TenNguoiLap = ClientInformation.HoTen; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; }
private void GetFormData() { lstID = new List <string>(); TuNgay = Convert.ToDateTime(raddtTuNgay.Value); DenNgay = Convert.ToDateTime(raddtDenNgay.Value); NgayBaoCao = Convert.ToDateTime(raddtDenNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); MaPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); foreach (DataRowView drv in grid.SelectedItems) { lstID.Add(drv["id"].ToString()); } lstNguonVon = new List <string>(); foreach (AutoCompleteCheckBox NguonVon in lstSourceNguonVon.Where(e => e.CheckedMember == true)) { lstNguonVon.Add(NguonVon.ValueMember[0]); } }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime thangDuLieu = new DateTime(); if (raddtThangDuLieu.Value is DateTime) { thangDuLieu = (DateTime)raddtThangDuLieu.Value; } string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); TenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; MaPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); TenPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).DisplayName; IDNguonVon = new List <string>(); foreach (AutoCompleteCheckBox NguonVon in lstSourceNguonVon.Where(e => e.CheckedMember == true)) { IDNguonVon.Add(NguonVon.ValueMember[1]); } IDXa = lstSourceXa.ElementAt(cmbXaPhuong.SelectedIndex).KeywordStrings[1]; IDAp = lstSourceAp.ElementAt(cmbThonAp.SelectedIndex).KeywordStrings[1]; IDNhom = new List <string>(); foreach (Tuple <int, string, string> tupleNhom in grNhom.SelectedItems) { IDNhom.Add(tupleNhom.Item1.ToString()); } ThangDuLieu = thangDuLieu.GetLastDateOfMonth().ToString("yyyyMMdd"); NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
/// <summary> /// Validation dữ liệu input /// </summary> /// <returns></returns> private bool Validation() { // Kiểm tra đã chọn chi nhánh hay không? if (lstSourceChiNhanh.Where(e => e.CheckedMember == true).ToList().Count < 1) { return(false); } // Kiểm tra đã chọn một kỳ tổng hợp báo cáo hay chưa? if (!chkDinhKyNgay.IsChecked.GetValueOrDefault() && !chkDinhKyThang.IsChecked.GetValueOrDefault() && !chkDinhKyQuy.IsChecked.GetValueOrDefault() && !chkDinhKyNam.IsChecked.GetValueOrDefault()) { return(false); } // Kiểm tra chưa input từ ngày if (raddtTuNgay.Value.IsNullOrEmpty()) { return(false); } // Kiểm tra chưa input đến ngày if (raddtDenNgay.Value.IsNullOrEmpty()) { return(false); } // Kiểm tra từ ngày lớn hơn đến ngày dữ liệu if (raddtTuNgay.Value.GetValueOrDefault() > raddtDenNgay.Value.GetValueOrDefault()) { return(false); } return(true); }
private void GetValuesOnForm() { lstIdCum = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); denngay = Convert.ToDateTime(raddtDenNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); tungay = Convert.ToDateTime(raddtTuNgay.Value).ToString(ApplicationConstant.defaultDateTimeFormat); idKhuVuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[1]; foreach (AutoCompleteCheckBox lstCum in lstSourceCum.Where(e => e.CheckedMember == true)) { lstIdCum.Add(lstCum.ValueMember[1].ToString()); } }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime tuNgay = new DateTime(); if (raddtTuNgay.Value is DateTime) { tuNgay = (DateTime)raddtTuNgay.Value; } DateTime denNgay = new DateTime(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); TenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); IDSanPham = new List <string>(); foreach (AutoCompleteCheckBox SanPham in lstSourceSanPham.Where(e => e.CheckedMember == true)) { IDSanPham.Add(SanPham.ValueMember[1]); } IDCanBo = new List <string>(); foreach (AutoCompleteCheckBox CanBoTD in lstSourceCanBoTD.Where(e => e.CheckedMember == true)) { IDCanBo.Add(CanBoTD.ValueMember[1]); } idKhuVuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[1]; TuNgay = tuNgay.ToString("yyyyMMdd"); DenNgay = denNgay.ToString("yyyyMMdd"); NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
/// <summary> /// Lay cac gia tri tren form /// </summary> private void GetFormValues() { MaChiNhanh = new List <string>(); MaPhongGiaoDich = new List <string>(); DateTime dtNgayDL = new DateTime(); if (raddtNgayDuLieu.Value is DateTime) { dtNgayDL = (DateTime)raddtNgayDuLieu.Value; NgayBaoCao = dtNgayDL.ToString(ApplicationConstant.defaultDateTimeFormat); TuNgay = dtNgayDL.GetFirstDateOfMonth(ApplicationConstant.defaultDateTimeFormat); DenNgay = dtNgayDL.ToString(ApplicationConstant.defaultDateTimeFormat); } else { dtNgayDL = LDateTime.StringToDate(ClientInformation.NgayLamViecHienTai, ApplicationConstant.defaultDateTimeFormat); NgayBaoCao = ClientInformation.NgayLamViecHienTai; TuNgay = dtNgayDL.GetFirstDateOfMonth(ApplicationConstant.defaultDateTimeFormat); DenNgay = dtNgayDL.ToString(ApplicationConstant.defaultDateTimeFormat); } DonViTinh = Convert.ToDecimal(telnumDonViTinh.Value); MaNguoiLap = ClientInformation.TenDangNhap; TenNguoiLap = ClientInformation.HoTen; MaMauBieu = "MF_KTDL_BCTK_DAILY_REPORT"; TenChiNhanh = ClientInformation.TenDonVi; MaNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); MaDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = new List <string>(); foreach (AutoCompleteCheckBox ChiNhanh in lstSourceChiNhanh.Where(e => e.CheckedMember == true)) { MaChiNhanh.Add(ChiNhanh.ValueMember.FirstOrDefault()); TenChiNhanh = ChiNhanh.DislayMember + " - "; } MaPhongGiaoDich = new List <string>(); foreach (AutoCompleteCheckBox PhongGDich in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { MaPhongGiaoDich.Add(PhongGDich.ValueMember.FirstOrDefault()); TenPhongGiaoDich = PhongGDich.DislayMember + " - "; } if (MaPhongGiaoDich.Contains("All")) { TenPhongGiaoDich = ""; } }
private void GetValuesOnForm() { lstIdKhuVuc = new List <string>(); int thang = Convert.ToInt32(Convert.ToDateTime(raddtDenNgay.Value).ToString("MM")); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); ngaybaocao = Convert.ToDateTime(raddtNgayBaoCao.Value).ToString(ApplicationConstant.defaultDateTimeFormat); thangbaocao = Convert.ToDateTime(raddtDenNgay.Value).ToString("yyyyMM"); sTenThangBC = laytenthang(thang); sNgayBaoCao = Convert.ToDateTime(raddtNgayBaoCao.Value).ToString(ApplicationConstant.defaultDateTimeFormat); foreach (AutoCompleteCheckBox lstKV in lstSourceKhuVuc.Where(e => e.CheckedMember == true)) { lstIdKhuVuc.Add(lstKV.ValueMember[1].ToString()); } }
private void GetValuesOnForm() { lstMaSanPham = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); ngaychotdl = Convert.ToDateTime(raddtNgayChotDL.Value).ToString(ApplicationConstant.defaultDateTimeFormat); ngaybaocao = Convert.ToDateTime(raddtNgayBaoCao.Value).ToString(ApplicationConstant.defaultDateTimeFormat); idKhuVuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[1]; idCum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings[1]; idNhom = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex).KeywordStrings[1]; foreach (AutoCompleteCheckBox lstSP in lstSourceSanPham.Where(e => e.CheckedMember == true)) { lstMaSanPham.Add(lstSP.ValueMember[0].ToString()); } }
private void GetFormData() { string maChiNhanh = string.Empty; string tenChiNhanh = string.Empty; maChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); tenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; lstMaPhongGiaoDich = new List <string>(); foreach (AutoCompleteCheckBox PhongGD in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { lstMaPhongGiaoDich.Add(PhongGD.ValueMember.FirstOrDefault()); } DateTime ngayChotSoLieu = new DateTime(); if (raddtNgayChotSoLieu.Value is DateTime) { ngayChotSoLieu = (DateTime)raddtNgayChotSoLieu.Value; } DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); // Gán dữ liệu từ form vào các biến truyền cho báo cáo MaChiNhanh = maChiNhanh; TenChiNhanh = tenChiNhanh; NgayChotSoLieu = (raddtNgayChotSoLieu.Value is DateTime) ? ngayChotSoLieu.ToString("yyyyMMdd"): ""; NgayBaoCao = (raddtNgayBaoCao.Value is DateTime) ? ngayBaoCao.ToString("yyyyMMdd") : ""; MaNguoiLap = ClientInformation.TenDangNhap; TenNguoiLap = ClientInformation.HoTen; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime tuNgay = new DateTime(); if (raddtTuNgay.Value is DateTime) { tuNgay = (DateTime)raddtTuNgay.Value; } DateTime denNgay = new DateTime(); string maLoaiTien = lstSourceLoaiTien.ElementAt(cmbLoaiTien.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); TenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; MaPhongGiaoDich = new List <string>(); TenPhongGiaoDich = ""; foreach (AutoCompleteCheckBox PhongGD in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { MaPhongGiaoDich.Add(PhongGD.ValueMember.FirstOrDefault()); TenPhongGiaoDich += TenPhongGiaoDich.Equals("") ? PhongGD.DislayMember : (" - " + PhongGD.DislayMember); } if (MaPhongGiaoDich.Contains("All")) { TenPhongGiaoDich = ""; } IDCanBo = new List <string>(); foreach (AutoCompleteCheckBox CanBoTD in lstSourceCanBoTD.Where(e => e.CheckedMember == true)) { IDCanBo.Add(CanBoTD.ValueMember[1]); } IDSanPham = new List <string>(); foreach (AutoCompleteCheckBox SanPham in lstSourceSanPham.Where(e => e.CheckedMember == true)) { IDSanPham.Add(SanPham.ValueMember[1]); } IDXa = new List <string>(); foreach (AutoCompleteCheckBox Xa in lstSourceXa.Where(e => e.CheckedMember == true)) { IDXa.Add(Xa.ValueMember[1]); } IDAp = new List <string>(); foreach (AutoCompleteCheckBox Ap in lstSourceAp.Where(e => e.CheckedMember == true)) { IDAp.Add(Ap.ValueMember[1]); } IDNhom = new List <string>(); foreach (Tuple <int, string, string> tupleNhom in grSoTienGuiDS.SelectedItems) { IDNhom.Add(tupleNhom.Item1.ToString()); } TuNgay = tuNgay.ToString("yyyyMMdd"); DenNgay = denNgay.ToString("yyyyMMdd"); NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaLoaiTien = maLoaiTien; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime tuNgay = new DateTime(); if (raddtTuNgay.Value is DateTime) { tuNgay = (DateTime)raddtTuNgay.Value; } DateTime denNgay = new DateTime(); if (raddtDenNgay.Value is DateTime) { denNgay = (DateTime)raddtDenNgay.Value; } string maLoaiTien = lstSourceLoaiTien.ElementAt(cmbLoaiTien.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = ""; foreach (AutoCompleteCheckBox ChiNhanh in lstSourceChiNhanh.Where(e => e.CheckedMember == true)) { MaChiNhanh += "''" + ChiNhanh.ValueMember[0].ToString() + "'',"; } MaPhongGiaoDich = ""; foreach (AutoCompleteCheckBox PhongGD in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { MaPhongGiaoDich += "''" + PhongGD.ValueMember[0].ToString() + "'',"; } if (MaChiNhanh.Length > 3) { MaChiNhanh = "(" + MaChiNhanh.Substring(0, MaChiNhanh.Length - 1) + ")"; } else { MaChiNhanh = "(''0'')"; } if (MaPhongGiaoDich.Length > 3) { MaPhongGiaoDich = "(" + MaPhongGiaoDich.Substring(0, MaPhongGiaoDich.Length - 1) + ")"; } else { MaPhongGiaoDich = "(''0'')"; } TuNgay = tuNgay.ToString("yyyyMMdd"); DenNgay = denNgay.ToString("yyyyMMdd"); NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaLoaiTien = maLoaiTien; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime thangDuLieu = new DateTime(); if (raddtThangDuLieu.Value is DateTime) { thangDuLieu = (DateTime)raddtThangDuLieu.Value; } string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); TenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; MaPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); TenPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).DisplayName; IDNguonVon = new List <string>(); foreach (AutoCompleteCheckBox NguonVon in lstSourceNguonVon.Where(e => e.CheckedMember == true)) { IDNguonVon.Add(NguonVon.ValueMember[1]); } IDXa = lstSourceXa.ElementAt(cmbXaPhuong.SelectedIndex).KeywordStrings[1]; IDAp = new List <string>(); foreach (AutoCompleteCheckBox Ap in lstSourceAp.Where(e => e.CheckedMember == true)) { IDAp.Add(Ap.ValueMember[1]); } List <string> lstSanPham = new List <string>(); foreach (RadTreeViewItem item in tvwVonTraDan.CheckedItems) { if (item.Tag != null) { string ma = item.Tag.ToString(); if (!ma.IsNullOrEmptyOrSpace()) { lstSanPham.Add(ma); } } } foreach (RadTreeViewItem item in tvwVonKhac.CheckedItems) { if (item.Tag != null) { string ma = item.Tag.ToString(); if (!ma.IsNullOrEmptyOrSpace()) { lstSanPham.Add(ma); } } } foreach (RadTreeViewItem item in tvwVonBoSung.CheckedItems) { if (item.Tag != null) { string ma = item.Tag.ToString(); if (!ma.IsNullOrEmptyOrSpace()) { lstSanPham.Add(ma); } } } ThangDuLieu = thangDuLieu.GetLastDateOfMonth().ToString("yyyyMMdd"); NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; MaSanPham = lstSanPham; }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } string maLoaiTien = lstSourceLoaiTien.ElementAt(cmbLoaiTien.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = new List <string>(); foreach (AutoCompleteCheckBox ChiNhanh in lstSourceChiNhanh.Where(e => e.CheckedMember == true)) { MaChiNhanh.Add(ChiNhanh.ValueMember.FirstOrDefault()); TenChiNhanh = ChiNhanh.DislayMember + " - "; } MaPhongGiaoDich = new List <string>(); foreach (AutoCompleteCheckBox PhongGD in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { MaPhongGiaoDich.Add(PhongGD.ValueMember.FirstOrDefault()); TenPhongGiaoDich = PhongGD.DislayMember + " - "; } if (MaChiNhanh.Contains("All")) { TenChiNhanh = "Toàn hệ thống"; } if (MaPhongGiaoDich.Contains("All")) { TenPhongGiaoDich = ""; } IDCanBo = new List <string>(); foreach (AutoCompleteCheckBox CanBoTD in lstSourceCanBoTD.Where(e => e.CheckedMember == true)) { IDCanBo.Add(CanBoTD.ValueMember[1]); } IDXa = new List <string>(); foreach (AutoCompleteCheckBox Xa in lstSourceXa.Where(e => e.CheckedMember == true)) { IDXa.Add(Xa.ValueMember[1]); } IDAp = new List <string>(); foreach (AutoCompleteCheckBox Ap in lstSourceAp.Where(e => e.CheckedMember == true)) { IDAp.Add(Ap.ValueMember[1]); } IDNhom = new List <string>(); AutoCompleteEntry auNhom = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex); IDNhom.Add(auNhom.KeywordStrings[3]); IDKhang = new List <string>(); foreach (DataRowView drv in grSoTienGuiDS.SelectedItems) { IDKhang.Add(drv["ID"].ToString()); } NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaLoaiTien = maLoaiTien; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; string tenPhongGiaoDich = string.Empty; if (lstSourcePhongGD_Select.Count > 0) { maDonVi = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); tenPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).DisplayName; } DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime ngayChotSoLieu = new DateTime(); if (raddtNgayChotSoLieu.Value is DateTime) { ngayChotSoLieu = (DateTime)raddtNgayChotSoLieu.Value; } DateTime tuNgay = new DateTime(); if (raddtTuNgay.Value is DateTime) { tuNgay = (DateTime)raddtTuNgay.Value; } string maLoaiTien = lstSourceLoaiTien.ElementAt(cmbLoaiTien.SelectedIndex).KeywordStrings.First(); List <string> lstNhomNo = new List <string>(); string nhomNo = ""; foreach (RadTreeViewItem item in tvwTreeNhomNo.CheckedItems) { if (item.Tag != null) { string ma = item.Tag.ToString(); if (!ma.IsNullOrEmptyOrSpace()) { lstNhomNo.Add(ma); nhomNo += ma + "#"; } } } if (nhomNo != "") { nhomNo = nhomNo.Substring(0, nhomNo.Length - 1); } List <string> lstTSDB = new List <string>(); string loaiTSDB = ""; foreach (RadTreeViewItem item in tvwTreeLoaiTSDB.CheckedItems) { if (item.Tag != null) { string ma = item.Tag.ToString(); if (!ma.IsNullOrEmptyOrSpace()) { lstTSDB.Add(ma); loaiTSDB += ma + "#"; } } } if (loaiTSDB != "") { loaiTSDB = loaiTSDB.Substring(0, loaiTSDB.Length - 1); } List <string> lstNguonVonChoVay = new List <string>(); string nguonVon = ""; foreach (RadTreeViewItem item in tvwTreeNguonVonChoVay.CheckedItems) { if (item.Tag != null) { string ma = item.Tag.ToString(); if (!ma.IsNullOrEmptyOrSpace()) { lstNguonVonChoVay.Add(ma); nguonVon += ma + "#"; } } } if (nguonVon != "") { nguonVon = nguonVon.Substring(0, nguonVon.Length - 1); } List <string> lstMucDichVay = new List <string>(); string mucDichVay = ""; foreach (RadTreeViewItem item in tvwTreeMucDichVay.CheckedItems) { if (item.Tag != null) { string ma = item.Tag.ToString(); if (!ma.IsNullOrEmptyOrSpace()) { lstMucDichVay.Add(ma); mucDichVay += ma + "#"; } } } if (mucDichVay != "") { mucDichVay = mucDichVay.Substring(0, mucDichVay.Length - 1); } string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); string tieuChiNhom = ""; string sapXep = lstSourceSapXep.ElementAt(cmbSapXepTheo.SelectedIndex).KeywordStrings.First(); string maChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); string tenChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; List <string> maCum = new List <string>(); foreach (AutoCompleteCheckBox cum in lstSourceCum.Where(e => e.CheckedMember == true)) { maCum.Add(cum.ValueMember[0]); } string tenCum = ""; // Gán dữ liệu từ form vào các biến truyền cho báo cáo MaCum = maCum; MaChiNhanh = maChiNhanh; TenChiNhanh = tenChiNhanh; MaPhongGiaoDich = maDonVi; TenPhongGiaoDich = tenPhongGiaoDich; TenCum = tenCum; NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; MaLoaiTien = maLoaiTien; TieuChiNhom = tieuChiNhom; SapXep = sapXep; TuNgay = tuNgay.ToString("yyyyMMdd"); NgayChotSoLieu = ngayChotSoLieu.ToString("yyyyMMdd"); NguonVonChoVay = nguonVon; MucDichVay = mucDichVay; NhomNo = nhomNo; LoaiTSDB = loaiTSDB; }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } DateTime ngayChotDL = new DateTime(); if (raddtNgayChotSoLieu.Value is DateTime) { ngayChotDL = (DateTime)raddtNgayChotSoLieu.Value; } string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); //Lấy giá trị MaChiNhanh = new List <string>(); foreach (AutoCompleteCheckBox ChiNhanh in lstSourceChiNhanh.Where(e => e.CheckedMember == true)) { MaChiNhanh.Add(ChiNhanh.ValueMember.FirstOrDefault()); TenChiNhanh = ChiNhanh.DislayMember + " - "; } MaPhongGiaoDich = new List <string>(); foreach (AutoCompleteCheckBox PhongGD in lstSourcePhongGD.Where(e => e.CheckedMember == true)) { MaPhongGiaoDich.Add(PhongGD.ValueMember.FirstOrDefault()); TenPhongGiaoDich = PhongGD.DislayMember + " - "; } if (MaChiNhanh.Contains("All")) { TenChiNhanh = "Toàn hệ thống"; } if (MaPhongGiaoDich.Contains("All")) { TenPhongGiaoDich = ""; } IDXa = new List <string>(); foreach (AutoCompleteCheckBox Xa in lstSourceXa.Where(e => e.CheckedMember == true)) { IDXa.Add(Xa.ValueMember[1]); } IDAp = new List <string>(); foreach (AutoCompleteCheckBox Ap in lstSourceAp.Where(e => e.CheckedMember == true)) { IDAp.Add(Ap.ValueMember[1]); } IDNhom = new List <string>(); foreach (AutoCompleteCheckBox Nhom in lstSourceNhom.Where(e => e.CheckedMember == true)) { IDNhom.Add(Nhom.ValueMember[1]); } lstMaLoaiSP = new List <string>(); foreach (AutoCompleteCheckBox LoaiSP in lstSourceLoaiSanPham.Where(e => e.CheckedMember == true)) { lstMaLoaiSP.Add(LoaiSP.ValueMember[0]); } lstMaLoaiSP = new List <string>(); foreach (AutoCompleteCheckBox LoaiSP in lstSourceLoaiSanPham.Where(e => e.CheckedMember == true)) { lstMaLoaiSP.Add(LoaiSP.ValueMember[0]); } lstMaSanPham = new List <string>(); foreach (AutoCompleteCheckBox SP in lstSourceSanPham.Where(e => e.CheckedMember == true)) { lstMaSanPham.Add(SP.ValueMember[0]); } lstNguonVon = new List <string>(); foreach (AutoCompleteCheckBox NguonVon in lstSourceNguonVon.Where(e => e.CheckedMember == true)) { lstNguonVon.Add(NguonVon.ValueMember[0]); } lstNhomNo = new List <string>(); foreach (AutoCompleteCheckBox NhomNo in lstSourceNhomNo.Where(e => e.CheckedMember == true)) { lstNhomNo.Add(NhomNo.ValueMember[0]); } NgayBaoCao = ngayBaoCao.ToString("yyyyMMdd"); NgayChotDL = ngayChotDL.ToString("yyyyMMdd"); MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }