private void GetDoiTuongTaiKhoan() { if (!txtSoTaiKhoan.Text.IsNullOrEmptyOrSpace()) { AutoCompleteEntry auPGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex); DataSet ds = new BaoCaoProcess().GetDanhSachDoiTuongTaiKhoan(txtSoTaiKhoan.Text); if (ds != null && ds.Tables.Count > 0) { grSoTienGuiDS.ItemsSource = ds.Tables[0]; } else { grSoTienGuiDS.ItemsSource = null; } } else { LMessage.ShowMessage("Chưa chọn tài khoản.", LMessage.MessageBoxType.Warning); } }
private void cmbTaiKhoanTK_SelectionChanged(object sender, SelectionChangedEventArgs e) { AutoComboBox auto = new AutoComboBox(); try { AutoCompleteEntry au = auto.getEntryByDisplayName(lstSourceTaiKhoanKhongKyHan, ref cmbTaiKhoanTK); if (au != null) { string[] a = au.KeywordStrings[0].Split('#'); numSoDuTaiKhoanTK.Value = Convert.ToDouble(a[0]); cmbTaiKhoanTK.Tag = a[1]; } } catch (System.Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } }
private void KhoiTaoCombobox() { AutoCompleteEntry auto = null; lstSourceTimeOut = new List <AutoCompleteEntry>(); lstSourceBaurate = new List <AutoCompleteEntry>(); lstSourcePortName = new List <AutoCompleteEntry>(); lstModems = new List <MODEM>(); List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>(); int iret = new SMSProcess().Modem(DatabaseConstant.Action.LOAD, ref lstModems, ref lstClientResponseDetails); if (iret > 0) { foreach (MODEM modem in lstModems.Where(f => f.sTatus.Equals(BusinessConstant.CoKhong.CO.layGiaTri()))) { auto = new AutoCompleteEntry(modem.PORTNAME, modem.PORT.ToString(), modem.PORT.ToString(), modem.PORTNAME); lstSourcePortName.Add(auto); } } new AutoComboBox().GenAutoComboBox(ref lstSourcePortName, ref cmbPort, null); }
private void raddgrHachToan_KeyDown(object sender, KeyEventArgs e) { List <string> lstDieuKien = new List <string>(); DataRowView dr = (DataRowView)raddgrHachToan.CurrentItem; if (e.Key == Key.F3) { switch (raddgrHachToan.CurrentCell.Column.UniqueName) { case "SO_TAI_KHOAN": case "MA_PLOAI": //if (formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_THU.layGiaTri()) || formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_CHI.layGiaTri())) //{ // DataRowView drv = raddgrHachToan.CurrentCell.ParentRow.Item as DataRowView; // if (drv["MA_KY_HIEU"].Equals("TIENMAT")) // { // return; // } //} AutoCompleteEntry auNguonVon = lstSourceNguonVon.ElementAt(cmbNguonVon.SelectedIndex); lstDieuKien.Add("%"); //MA_KY_HIEU lstDieuKien.Add("NOI_BANG"); lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonViGiaoDich); lstDieuKien.Add(auNguonVon.KeywordStrings.FirstOrDefault()); HienThiPopup(DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET, lstDieuKien); break; case "MA_DTUONG": if (dr["LOAI_DTUONG"].ToString().IsNullOrEmptyOrSpace()) { break; } lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonVi); lstDieuKien.Add(dr["LOAI_DTUONG"].ToString()); HienThiPopup(DatabaseConstant.DanhSachTruyVan.POPUP_DS_DOI_TUONG, lstDieuKien); break; } } }
/// <summary> /// Luu du lieu /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbSave_Click(object sender, RoutedEventArgs e) { try { if (Validation()) { AutoComboBox au = new AutoComboBox(); AutoCompleteEntry auNSD = au.getEntryByDisplayName(lstSourceNguoiBanGiao, ref cmbNSD); if (DuLieuTraVe != null) { List <TS_BAN_GIAO_CT_GIAO_NHAN> list = new List <TS_BAN_GIAO_CT_GIAO_NHAN>(); TS_BAN_GIAO_CT_GIAO_NHAN nbg = new TS_BAN_GIAO_CT_GIAO_NHAN(); nbg.MA_HSO = auNSD.KeywordStrings.First(); nbg.TEN_HSO = auNSD.DisplayName; if (rbBenGiao.IsChecked == true) { nbg.DAI_DIEN = "Bên giao"; } else if (rbBenNhan.IsChecked == true) { nbg.DAI_DIEN = "Bên nhận"; } else if (rbKhac.IsChecked == true) { nbg.DAI_DIEN = txtDaiDienKhac.Text; } nbg.MA_CHUC_VU = maChucVu; nbg.TEN_CHUC_VU = tenChucVu; list.Add(nbg); DuLieuTraVe(list); } CustomControl.CommonFunction.CloseUserControl(this); } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
/// <summary> /// Su kien luu thong tin chi tiet xuong grid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbSaveThongTin_Click(object sender, RoutedEventArgs e) { if (Validation()) { AutoComboBox au = new AutoComboBox(); AutoCompleteEntry auViTri = au.getEntryByDisplayName(lstSourceViTri, ref cmbViTri); if (!isUpdate) { _dtSource.Rows.Add(false, grNguoiDaiDien.Items.Count + 1, idTuSinh + 1, -1, txtHoTen.Text.Trim(), auViTri.DisplayName, auViTri.KeywordStrings[0], txtDienThoai.Text); //idTuSinh = idTuSinh - 1; } else { DataRowView dr = (DataRowView)grNguoiDaiDien.SelectedItem; dr["DDIEN_HO_TEN"] = txtHoTen.Text.Trim(); dr["DDIEN_VI_TRI_TEN"] = auViTri.DisplayName; dr["DDIEN_VI_TRI"] = auViTri.KeywordStrings[0]; dr["DDIEN_DTHOAI"] = txtDienThoai.Text.Trim(); } ResetForm(); } }
void GetDataForm(BusinessConstant.TrangThaiBanGhi bghi, BusinessConstant.TrangThaiNghiepVu nghiepvu) { try { AutoCompleteEntry auLoaiTien = lstSourceLoaiTien.ElementAt(cbbMaTienTe.SelectedIndex); if (LObject.IsNullOrEmpty(objTYGIA)) { objTYGIA = new TY_GIA_CT(); } List <DANH_SACH_TY_GIA_CT> lst = raddgrDSTyGia.ItemsSource as List <DANH_SACH_TY_GIA_CT>; objTYGIA.DSACH_TY_GIA_CT = lst.ToArray(); objTYGIA.ID_TY_GIA = idTienTe; objTYGIA.MA_LOAI_TIEN = auLoaiTien.KeywordStrings.FirstOrDefault(); objTYGIA.NGAY_AP_DUNG = ClientInformation.NgayLamViecHienTai; idTienTeCT = lst.Select(f => f.ID_TY_GIA_CT).ToList(); } catch (System.Exception ex) { LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void KhoiTaoForm() { AutoCompleteEntry auMaBaoCao = null; try { if (listBaoCao.Count > 0) { cmbLoaiBieu.SelectedIndex = listBaoCao.IndexOf(listBaoCao.FirstOrDefault(e => e.KeywordStrings.First() == maBaoCao)); if (cmbLoaiBieu.SelectedIndex >= 0) { auMaBaoCao = listBaoCao.ElementAt(cmbLoaiBieu.SelectedIndex); } idBaoCao = Convert.ToInt32(auMaBaoCao.KeywordStrings[1]); maBaoCao = auMaBaoCao.KeywordStrings[0]; // Lấy thông tin báo cáo và tham số process.LayThongTinBaoCao(idBaoCao, maBaoCao, ref htBaoCao, ref lstHtBaoCaoTso); } } catch (System.Exception ex) { } }
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()); } }
private void LoadDuLieuKHang() { AutoCompleteEntry au = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex); DataSet ds = new BaoCaoProcess().GetKhachHangTheoNhom(au.KeywordStrings[0]); if (!LObject.IsNullOrEmpty(ds) && ds.Tables.Count > 0) { foreach (DataRow drRoot in ds.Tables[0].Rows) { DataRow dr = dt.NewRow(); dr["ID"] = drRoot["ID"]; dr["MA_KHANG"] = drRoot["MA_KHANG"]; dr["TEN_KHANG"] = drRoot["TEN_KHANG"]; dr["SO_TIEN"] = 5000; dt.Rows.Add(dr); } grSoTienGuiDS.ItemsSource = dt.DefaultView; } else { grSoTienGuiDS.ItemsSource = null; } }
/// <summary> /// Kiem tra du lieu truoc khi luu /// </summary> /// <returns></returns> private bool Validation() { AutoComboBox au = new AutoComboBox(); AutoCompleteEntry auNSD = au.getEntryByDisplayName(lstSourceNguoiBanGiao, ref cmbNSD); if (auNSD == null) { CommonFunction.ThongBaoTrong("Chưa chọn người sử dụng"); cmbNSD.Focus(); return(false); } else if (rbBenGiao.IsChecked == false && rbBenNhan.IsChecked == false && rbKhac.IsChecked == false) { CommonFunction.ThongBaoTrong("Chưa chọn đại diện"); return(false); } else if (rbKhac.IsChecked == true && txtDaiDienKhac.Text.IsNullOrEmptyOrSpace()) { CommonFunction.ThongBaoTrong("Chưa nhập thông tin đại diện khác"); return(false); } return(true); }
void TongHopDuLieu() { DataTable dt = null; DataRow[] drresult = null; LDatatable.MakeParameterTable(ref dt); AutoCompleteEntry auChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex); AutoCompleteEntry auPhongGD = lstSourcePhongGD.ElementAt(cmbPhongGD.SelectedIndex); maChiNhanh = auChiNhanh.KeywordStrings.FirstOrDefault(); tenChiNhanh = auChiNhanh.DisplayName; maPhongGD = auPhongGD.KeywordStrings.FirstOrDefault(); thangDuTru = raddtThangBC.Value.GetValueOrDefault().ToString(ApplicationConstant.defaultDateTimeFormat); thangBaoCao = raddtNgayBC.Value.GetValueOrDefault().ToString(ApplicationConstant.defaultDateTimeFormat); tyLe = (int)numTyLe.Value.GetValueOrDefault(); LDatatable.AddParameter(ref dt, "@MaChiNhanh", "string", maChiNhanh); LDatatable.AddParameter(ref dt, "@MaPhongGD", "string", maPhongGD); LDatatable.AddParameter(ref dt, "@TenChiNhanh", "string", tenChiNhanh); LDatatable.AddParameter(ref dt, "@ThangDuTru", "string", thangDuTru); LDatatable.AddParameter(ref dt, "@NgayBCao", "string", thangBaoCao); LDatatable.AddParameter(ref dt, "@TyLe", "string", tyLe.ToString()); LDatatable.AddParameter(ref dt, "@UserName", "string", ClientInformation.TenDangNhap); ds = new TruyVanProcess().TruyVanUDTT(_objBaoCao.DATA_QUERY, dt); if (!ds.IsNullOrEmpty() && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { drresult = ds.Tables[0].Select("LOAI_DLIEU = 'SDU_DAUTHANG'"); grdSoTien.ItemsSource = drresult.CopyToDataTable().DefaultView; grdSoTien.Rebind(); drresult = ds.Tables[0].Select("LOAI_DLIEU = 'THU_TRONGTHANG'"); grdThuTien.ItemsSource = drresult.CopyToDataTable().DefaultView; grdThuTien.Rebind(); drresult = ds.Tables[0].Select("LOAI_DLIEU LIKE 'CHI_TRONGTHANG_%'"); grdChiTien.ItemsSource = drresult.CopyToDataTable().DefaultView; grdChiTien.Rebind(); } }
public List <ThamSoBaoCao> GetParameters() { List <ThamSoBaoCao> listThamSoBaoCao = new List <ThamSoBaoCao>(); try { if (!Validation()) { return(null); } AutoCompleteEntry auChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex); string maDonViBC = ""; if (auChiNhanh.KeywordStrings[0].Equals("%")) { maDonViBC = ClientInformation.MaToChuc; } else { maDonViBC = auChiNhanh.KeywordStrings[0]; } DataTable table = ((DataView)raddgrDuLieuBCao.ItemsSource).Table; listThamSoBaoCao.Add(new ThamSoBaoCao("P_NgayBaoCao", LDateTime.DateToString(raddtNgayBaoCao.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat), ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet)); listThamSoBaoCao.Add(new ThamSoBaoCao("P_DonViTinh", numDonViTinh.Value.GetValueOrDefault().ToString(), ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet)); listThamSoBaoCao.Add(new ThamSoBaoCao("P_NguoiLap", ClientInformation.HoTen, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet)); listThamSoBaoCao.Add(new ThamSoBaoCao("P_NgayDuLieu", LDateTime.DateToString(raddtNgayChotSoLieu.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat), ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet)); listThamSoBaoCao.Add(new ThamSoBaoCao("@P_MaDonVi", maDonViBC, ApplicationConstant.LoaiThamSoBaoCao.GUIPARAM.layGiaTri(), new List <string>(), table.DataSet)); return(listThamSoBaoCao); } catch (System.Exception ex) { Mouse.OverrideCursor = Cursors.Arrow; CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } return(listThamSoBaoCao); }
/// <summary> /// Method to get all cities on focus. /// </summary> private void GetAllCities() { Task.Run(() => { List <LookUpEntity> cityList = new List <LookUpEntity>(); if (_mainVM.CityList.IsCollectionValid()) { var cities = _mainVM.CityList.ToList(); foreach (var item in cities) { cityList.Add(new LookUpEntity { Name = item.Name, Value = item.Value }); } } if (!cityList.IsCollectionValid()) { return; } var autocompleteList = new List <AutoCompleteEntry>(); cityList.ForEach(keyWordItem => { var entry = new AutoCompleteEntry(keyWordItem.Name, keyWordItem.Value); autocompleteList.Add(entry); }); CityAutoComplete.AutoCompletionList = autocompleteList; }); }
/// <summary> /// Xu ly nghiep vu /// </summary> #region Xu ly nghiep vu private void OnAction() { Cursor = Cursors.Wait; int iret = 1; List <ClientResponseDetail> lstClientResponseDetail = new List <ClientResponseDetail>(); try { if (!Validation()) { return; } if (objLichThuGocLai.IsNullOrEmpty()) { objLichThuGocLai = new TDVM_LICH_THU_GOC_LAI(); } AutoCompleteEntry au = lstSourceBDauTra.ElementAt(cmbThangBDTra.SelectedIndex); AutoCompleteEntry auNN = lstNguyenNhanTDoi.ElementAt(cbbNguyenNhanThayDoi.SelectedIndex); objLichThuGocLai.DSACH_KUOCVM = lstDanhSachKUOC.ToArray(); objLichThuGocLai.ID_CUM = idCum; objLichThuGocLai.MA_CUM = maCum; objLichThuGocLai.NGAY_BAT_DAU = au.KeywordStrings[2]; objLichThuGocLai.NGUYEN_NHAN_TDOI = auNN.KeywordStrings.FirstOrDefault(); iret = new TinDungProcess().LapLichThuGocLai(DatabaseConstant.Action.TINH_TOAN_LICH_TRA_NO, ref objLichThuGocLai, ref lstClientResponseDetail); CommonFunction.ThongBaoKetQua(lstClientResponseDetail); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error); } finally { Cursor = Cursors.Arrow; } }
private void LoadComboboxPhongGD() { // khởi tạo combobox AutoComboBox auto = new AutoComboBox(); lstSourcePhongGD = new ListCheckBoxCombo(); AutoCompleteEntry au = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex); string maChiNhanh = au.KeywordStrings[1]; List <string> lstDieuKien = new List <string>(); // khởi tạo combobox auto = new AutoComboBox(); lstDieuKien.Add(maChiNhanh); lstDieuKien.Add(ClientInformation.TenDangNhap); lstDieuKien.Add(ClientInformation.MaDonViQuanLy); new AutoComboBoxListCheckes().GenAutoComboBox(ref lstSourcePhongGD, ref cmbPhongGD, DatabaseConstant.DanhSachTruyVan.COMBOBOX_PGDLIST.getValue(), lstDieuKien); //lstSourcePhongGD_Select = lstSourcePhongGD.Where(e => e.KeywordStrings.ElementAt(1).Equals(maChiNhanh)).ToList(); //lstSourcePhongGD_Select.Insert(0, new AutoCompleteEntry("Tất cả", "%", "")); //// khởi tạo combobox //auto = new AutoComboBox(); //cmbPhongGD.Items.Clear(); //auto.GenAutoComboBox(ref lstSourcePhongGD_Select, ref cmbPhongGD, null); }
private void GetFormData() { string maNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); string maDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); string maDonVi = string.Empty; DateTime ngayBaoCao = new DateTime(); if (raddtNgayBaoCao.Value is DateTime) { ngayBaoCao = (DateTime)raddtNgayBaoCao.Value; } string loaiBaoCao = cmbLoaiBaoCao.SelectedValue.ToString(); AutoCompleteEntry auChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex); maDonVi = auChiNhanh.KeywordStrings.FirstOrDefault(); string tenChiNhanh = auChiNhanh.DisplayName; List <string> maPhongGD = new List <string>(); foreach (AutoCompleteCheckBox item in lstSourcePhongGD) { if (item.CheckedMember) { maPhongGD.Add(item.ValueMember.FirstOrDefault()); } } NgayBaoCao = ngayBaoCao.ToString(ApplicationConstant.defaultDateTimeFormat); MaChiNhanh = maDonVi; TenChiNhanh = tenChiNhanh; MaPhongGD = maPhongGD; LoaiBaoCao = loaiBaoCao; MaNgonNgu = maNgonNgu; MaDinhDang = maDinhDang; MaNguoiLap = Presentation.Process.Common.ClientInformation.TenDangNhap; TenNguoiLap = Presentation.Process.Common.ClientInformation.HoTen; }
public List <ThamSoBaoCao> GetParameters() { if (!Validation()) { LMessage.ShowMessage("Thiếu tham số cho báo cáo.", LMessage.MessageBoxType.Information); return(null); } GetFormData(); List <ThamSoBaoCao> listThamSoBaoCao = new List <ThamSoBaoCao>(); //listThamSoBaoCao.Add(new ThamSoBaoCao("P_TenNguoiLap", TenNguoiLap, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("P_TenChiNhanh", TenChiNhanh, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); //listThamSoBaoCao.Add(new ThamSoBaoCao("P_TenPGD", TenPhongGiaoDich, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("P_TuNgay", TuNgay, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("P_DenNgay", DenNgay, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); //listThamSoBaoCao.Add(new ThamSoBaoCao("P_NgayMoSo", TuNgay, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("P_NguoiLap", ClientInformation.HoTen, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("P_NgayBaoCao", NgayBaoCao, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri())); foreach (string ChiNhanh in MaChiNhanh) { listThamSoBaoCao.Add(new ThamSoBaoCao("@MaChiNhanh", ChiNhanh, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); } foreach (string PhongGD in MaPhongGiaoDich) { listThamSoBaoCao.Add(new ThamSoBaoCao("@MaPhongGiaoDich", PhongGD, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); } foreach (string CanBo in IDCanBo) { listThamSoBaoCao.Add(new ThamSoBaoCao("@MaCanBo", CanBo, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); } foreach (string Xa in IDXa) { listThamSoBaoCao.Add(new ThamSoBaoCao("@MaKhuVuc", Xa, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); } foreach (string Ap in IDAp) { listThamSoBaoCao.Add(new ThamSoBaoCao("@MaCum", Ap, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); } foreach (string Nhom in IDNhom) { listThamSoBaoCao.Add(new ThamSoBaoCao("@MaNhom", Nhom, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); } //foreach (string KHang in IDKhang) //{ // listThamSoBaoCao.Add(new ThamSoBaoCao("@MaKHang", KHang, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); //} foreach (DataRowView drv in grSoTienGuiDS.SelectedItems) { listThamSoBaoCao.Add(new ThamSoBaoCao("@MaKhachHang", drv["ID"].ToString() + "#" + drv["MA_KHANG"].ToString() + "#" + drv["TEN_KHANG"].ToString() + "#" + drv["SO_TIEN"].ToString(), ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); } listThamSoBaoCao.Add(new ThamSoBaoCao("@TenChiNhanh", TenChiNhanh, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@TenPhongGiaoDich", TenPhongGiaoDich, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@NgayPhatVon", TuNgay, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@DenNgay", DenNgay, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); //listThamSoBaoCao.Add(new ThamSoBaoCao("@MaLoaiTien", MaLoaiTien, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@LoaiTK", "TKTH", ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@NguoiLap", ClientInformation.HoTen, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@NgayBaoCao", NgayBaoCao, ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@P_MaDonVi", ClientInformation.MaDonVi, ApplicationConstant.LoaiThamSoBaoCao.GUIPARAM.layGiaTri())); IDNhom = new List <string>(); AutoCompleteEntry auNhom = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex); IDNhom.Add(auNhom.KeywordStrings[3]); listThamSoBaoCao.Add(new ThamSoBaoCao("MaNgonNgu", MaNgonNgu, ApplicationConstant.LoaiThamSoBaoCao.LANG.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("MaDinhDang", MaDinhDang, ApplicationConstant.LoaiThamSoBaoCao.FORMAT.layGiaTri())); return(listThamSoBaoCao); }
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; }
void LoadPopUpDiaBan() { List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_CUM", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, true); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup.Count > 0) { AutoCompleteEntry auSanPham = null; if (cmbSanPham.SelectedIndex < 0) { auSanPham = lstSourceSanPham.ElementAt(cmbSanPham.SelectedIndex); } AutoCompleteEntry auLoaiSanPham = null; auLoaiSanPham = lstSourceLoaiSanPham.ElementAt(cmbLoaiSanPham.SelectedIndex); foreach (DataRow dr in lstPopup) { if (lstDanhSachSanpham.Where(f => f.MA_DBAN.Contains(dr["MA_CUM"].ToString())).Count() < 1) { SAN_PHAM_DBAN_CTIET objSanPhamCTiet = new SAN_PHAM_DBAN_CTIET(); objSanPhamCTiet.NGAY_ADUNG = ClientInformation.NgayLamViecHienTai; objSanPhamCTiet.ID_DBAN = Convert.ToInt32(dr["ID"]); if (obj.CHIEU_DU_LIEU == "SAN_PHAM") { objSanPhamCTiet.ID_SAN_PHAM = Convert.ToInt32(auSanPham.KeywordStrings[1]); } else { objSanPhamCTiet.ID_SAN_PHAM = 0; } objSanPhamCTiet.LOAI_DBAN = "DM_CUM"; objSanPhamCTiet.MA_DBAN = dr["MA_CUM"].ToString(); objSanPhamCTiet.TEN_DBAN = dr["TEN_CUM"].ToString(); objSanPhamCTiet.MA_DVI_QLY = ClientInformation.MaDonVi; objSanPhamCTiet.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich; if (obj.CHIEU_DU_LIEU == "SAN_PHAM") { objSanPhamCTiet.MA_SAN_PHAM = auSanPham.KeywordStrings.FirstOrDefault(); } else { objSanPhamCTiet.MA_SAN_PHAM = auLoaiSanPham.KeywordStrings.FirstOrDefault(); obj.LOAI_SAN_PHAM = auLoaiSanPham.KeywordStrings.FirstOrDefault(); } objSanPhamCTiet.NGAY_NHAP = ClientInformation.NgayLamViecHienTai; objSanPhamCTiet.NGUOI_NHAP = ClientInformation.TenDangNhap; objSanPhamCTiet.TTHAI_BGHI = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(); objSanPhamCTiet.TTHAI_NVU = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri(); lstDanhSachSanpham.Add(objSanPhamCTiet); } } radDanhSachLichPhat.ItemsSource = lstDanhSachSanpham; radDanhSachLichPhat.Rebind(); } }
private void btnSoTaiKhoan_Click(object sender, RoutedEventArgs e) { try { //Bat popup if (cmbNguonVon.SelectedIndex < 0) { return; } PopupProcess process = new PopupProcess(); List <string> lstDieuKien = new List <string>(); AutoCompleteEntry au = lstSourceNguonVon.ElementAt(cmbNguonVon.SelectedIndex); lstDieuKien.Add("%"); lstDieuKien.Add("%"); lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonViGiaoDich); lstDieuKien.Add(au.KeywordStrings.FirstOrDefault()); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup; lstPopup.Clear(); ucPopup popup = new ucPopup(false, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = simplePopupResponse.PopupTitle; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Content = popup; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { txtSoTaiKhoan.Text = lstPopup[0][2].ToString(); lblTenTaiKhoan.Content = lstPopup[0][3].ToString(); numSoDu.Value = Convert.ToDouble(lstPopup[0]["SODU"]); ID_TKHOAN = Convert.ToInt32(lstPopup[0][1]); MA_LSDU = lstPopup[0]["MA_LSDU"].ToString(); if (!lstPopup[0]["LOAI_DTUONG"].ToString().IsNullOrEmptyOrSpace()) { cmbLoaiDoiTuong.SelectedIndex = lstSourceDoiTuongLoai.IndexOf(lstSourceDoiTuongLoai.FirstOrDefault(f => f.KeywordStrings.FirstOrDefault().Equals(lstPopup[0]["LOAI_DTUONG"].ToString()))); cmbLoaiDoiTuong.IsEnabled = false; } else { cmbLoaiDoiTuong.SelectedIndex = -1; cmbLoaiDoiTuong.IsEnabled = true; } if (lstPopup[0]["MA_NHOM_PLOAI"].ToString().Equals("LT")) { raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = false; } else { raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = true; } if (lstPopup[0]["NGAY_GDICH"] != DBNull.Value) { telNgayChotDL.Value = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat); ngayChotDL = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat); } DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@IdTaiKhoan", "INT", ID_TKHOAN.ToString()); DataSet ds = new KeToanProcess().getDanhSachTaiKhoanChiTiet(dt, "DOI_TUONG"); lstDTuongCT = new List <DOI_TUONG_SDU_TKHOAN_CT>(); if (!ds.IsNullOrEmpty() && !ds.Tables[0].IsNullOrEmpty()) { foreach (DataRow dr in ds.Tables[0].Rows) { DOI_TUONG_SDU_TKHOAN_CT objDTuongCT = new DOI_TUONG_SDU_TKHOAN_CT(); objDTuongCT.MA_DTUONG = dr["MA_DTUONG"].ToString(); objDTuongCT.TEN_TAI_KHOAN = dr["TEN_DTUONG"].ToString(); objDTuongCT.MA_LSDU = dr["MA_LSDU"].ToString(); objDTuongCT.NGAY_DL = dr["NGAY_DL"].ToString(); objDTuongCT.NGAY_GDICH = dr["NGAY_GDICH"].ToString(); objDTuongCT.NGAY_HLUC = dr["NGAY_HLUC"].ToString(); objDTuongCT.SODU = Convert.ToDecimal(dr["SO_DU"].ToString()); objDTuongCT.ID_DTUONG = Convert.ToInt32(dr["ID"].ToString()); lstDTuongCT.Add(objDTuongCT); } } raddgrTUngCT.ItemsSource = lstDTuongCT; raddgrTUngCT.Rebind(); } } catch (Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } }
/// <summary> /// Tìm kiếm nâng cao /// </summary> private void TimKiem() { string maPhanLoai = "("; string tthaiNvu = ""; foreach (object item in trvPhanLoai.CheckedItems) { DataRowView dr = (DataRowView)item; maPhanLoai += dr["MA_PLOAI"] + ","; } if (trvPhanLoai.CheckedItems.Count > 0) { maPhanLoai = maPhanLoai.Substring(0, maPhanLoai.Length - 1) + ")"; } else { maPhanLoai = ""; } if (ucTrangThaiNVu.GetItemsSelected() != "NULL") { tthaiNvu = ucTrangThaiNVu.GetItemsSelected(); } else { tthaiNvu = ""; } KeToanProcess process = new KeToanProcess(); AutoComboBox au = new AutoComboBox(); Mouse.OverrideCursor = Cursors.Wait; try { AutoCompleteEntry auDonVi = au.getEntryByDisplayName(lstSourceDonVi, ref cmbDonVi); DataSet ds = process.getDanhSachMaPhanLoai(auDonVi.KeywordStrings[0], tthaiNvu, BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(), maPhanLoai); raddgrPhanLoaiTK.ItemsSource = null; if (ds != null && ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { dr["TRANG_THAI"] = BusinessConstant.layNgonNguNghiepVu(dr["TTHAI_NVU"].ToString()); dr["TCHAT_CNO"] = BusinessConstant.layNgonNguTuGiaTri(dr["MA_TCHAT_CNO"].ToString(), "CO_KHONG"); } raddgrPhanLoaiTK.ItemsSource = ds.Tables[0].DefaultView; lblSum.Content = ds.Tables[0].Rows.Count.ToString("#"); } else { raddgrPhanLoaiTK.ItemsSource = null; lblSum.Content = 0; } } catch (System.Exception ex) { LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } finally { process = null; au = null; } Mouse.OverrideCursor = Cursors.Arrow; }
/// <summary> /// 添加Item /// </summary> /// <param name="entry"></param> public void AddItem(AutoCompleteEntry entry) { autoCompletionList.Add(entry); }
/// <summary> /// Kiem tra du lieu truoc khi luu /// </summary> /// <returns></returns> private bool Validation() { AutoComboBox au = new AutoComboBox(); if (LString.IsNullOrEmptyOrSpace(txtTenKhachHang.Text)) { CommonFunction.ThongBaoTrong(lblHoTen.Content.ToString()); txtTenKhachHang.Focus(); return(false); } else if (raddtNgaySinh.Value == null) { CommonFunction.ThongBaoTrong(lblNgayThangNamSinh.Content.ToString()); raddtNgaySinh.Focus(); return(false); } else if (au.getEntryByDisplayName(lstSourceGioiTinh, ref cmbGioiTinh) == null) { CommonFunction.ThongBaoTrong(lblGioiTinh.Content.ToString()); cmbGioiTinh.Focus(); return(false); } else if (au.getEntryByDisplayName(lstSourceMoiQuanHe, ref cmbMoiQuanHe) == null) { CommonFunction.ThongBaoTrong(lblMoiQuanHe.Content.ToString()); cmbMoiQuanHe.Focus(); return(false); } else if (au.getEntryByDisplayName(lstSourceSucKhoe, ref cmbTTSucKhoe) == null) { CommonFunction.ThongBaoTrong(lblTTSucKhoe.Content.ToString()); cmbTTSucKhoe.Focus(); return(false); } else if (Convert.ToDateTime(raddtNgaySinh.Value) > LDateTime.GetCurrentDate()) { LMessage.ShowMessage("M.KhachHang.Popup.ucThongTinCoBanHoGD.LoiNgaySinh", LMessage.MessageBoxType.Warning); raddtNgaySinh.Focus(); return(false); } if (chkNguoiThuaKe.IsChecked == true || chkNguoiDongTrachNhiem.IsChecked == true) { AutoCompleteEntry loai_giay_to = au.getEntryByDisplayName(lstSourceLoaiGiayTo, ref cmbLoaiGiayTo); AutoCompleteEntry noi_cap = au.getEntryByDisplayName(lstSourceNoiCap, ref cmbNoiCap); //if (loai_giay_to == null) //{ // CommonFunction.ThongBaoTrong(lblLoaiGiayTo.Content.ToString()); // cmbLoaiGiayTo.Focus(); // return false; //} //else if (LString.IsNullOrEmptyOrSpace(txtSoGiayTo.Text)) //{ // CommonFunction.ThongBaoTrong(lblSoGiayTo.Content.ToString()); // txtSoGiayTo.Focus(); // return false; //} //else if (raddtNgayCap.Value == null) //{ // CommonFunction.ThongBaoTrong(lblNgayCap.Content.ToString()); // raddtNgayCap.Focus(); // return false; //} //else if (noi_cap == null) //{ // CommonFunction.ThongBaoTrong(lblNoiCap.Content.ToString()); // cmbNoiCap.Focus(); // return false; //} } return(true); }
/// <summary> /// Su kien luu thong tin chi tiet xuong grid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlbSaveThongTin_Click(object sender, RoutedEventArgs e) { try { if (Validation()) { AutoComboBox au = new AutoComboBox(); string gioi_tinh = au.getEntryByDisplayName(lstSourceGioiTinh, ref cmbGioiTinh).KeywordStrings[0]; string suc_khoe = au.getEntryByDisplayName(lstSourceSucKhoe, ref cmbTTSucKhoe).KeywordStrings[0]; string moi_quan_he = au.getEntryByDisplayName(lstSourceMoiQuanHe, ref cmbMoiQuanHe).KeywordStrings[0]; DateTime ngay_sinh = Convert.ToDateTime(raddtNgaySinh.Value); int tuoi = LDateTime.CountYearBetweenDates(LDateTime.GetCurrentDate(), Convert.ToDateTime(raddtNgaySinh.Value)); DataRowView dr = null; if (!isUpdate) { DataRow drAdd = _dtSource.NewRow(); _dtSource.Rows.Add(drAdd); dr = _dtSource.DefaultView[_dtSource.Rows.Count - 1]; dr["CHON"] = false; dr["STT"] = grThanhVienTrongGD.Items.Count; dr["ID_KHANG"] = -1; idTuSinh = idTuSinh - 1; } else { dr = (DataRowView)grThanhVienTrongGD.SelectedItem; } if (dr == null) { DataRow drAdd = _dtSource.NewRow(); _dtSource.Rows.Add(drAdd); dr = _dtSource.DefaultView[_dtSource.Rows.Count - 1]; dr["CHON"] = false; dr["STT"] = grThanhVienTrongGD.Items.Count; dr["ID_KHANG"] = -1; idTuSinh = idTuSinh - 1; } dr["GD_HO_TEN"] = txtTenKhachHang.Text.Trim(); dr["GD_NGAY_SINH"] = ngay_sinh.ToString("yyyyMMdd"); dr["GD_NGAY_SINH_TEXT"] = ngay_sinh.ToString(@"dd/MM/yyyy"); dr["GD_TUOI"] = tuoi; dr["GD_GIOI_TINH"] = gioi_tinh; dr["GD_GIOI_TINH_TEXT"] = cmbGioiTinh.Text; dr["GD_MOI_QUAN_HE"] = moi_quan_he; dr["GD_MOI_QUAN_HE_TEXT"] = cmbMoiQuanHe.Text; dr["GD_TTRANG_SKHOE"] = suc_khoe; dr["GD_TTRANG_SKHOE_TEXT"] = cmbTTSucKhoe.Text; dr["GD_NGHE_NGHIEP"] = chkCoViecLam.IsChecked; dr["GD_NGUOI_TKE"] = chkNguoiThuaKe.IsChecked; dr["GD_NGUOI_DONG_TNHIEM"] = chkNguoiDongTrachNhiem.IsChecked; if (!LString.IsNullOrEmptyOrSpace(txtMaThanhVienGD.Text)) { dr["GD_MA_DONG_TNHIEM"] = txtMaThanhVienGD.Text; } else { dr["GD_MA_DONG_TNHIEM"] = "DTN" + DateTime.Now.ToString("yyyyMMddHHmmss"); } if (chkNguoiThuaKe.IsChecked == true || chkNguoiDongTrachNhiem.IsChecked == true) { AutoCompleteEntry auLoaiGiayTo = au.getEntryByDisplayName(lstSourceLoaiGiayTo, ref cmbLoaiGiayTo); AutoCompleteEntry auNoiCap = au.getEntryByDisplayName(lstSourceNoiCap, ref cmbNoiCap); dr["GD_GTLQ_SO"] = txtSoGiayTo.Text; if (!LObject.IsNullOrEmpty(auNoiCap)) { dr["GD_GTLQ_NOI_CAP"] = auNoiCap.KeywordStrings[0]; } dr["GD_GTLQ_NOI_CAP_TEXT"] = cmbNoiCap.Text; if (!LObject.IsNullOrEmpty(auLoaiGiayTo)) { dr["GD_GTLQ_LOAI"] = auLoaiGiayTo.KeywordStrings[0]; } dr["GD_GTLQ_LOAI_TEXT"] = cmbLoaiGiayTo.Text; if (!LObject.IsNullOrEmpty(raddtNgayCap.Value)) { DateTime ngay_cap = Convert.ToDateTime(raddtNgayCap.Value); dr["GD_GTLQ_NGAY_CAP"] = ngay_cap.ToString("yyyyMMdd"); dr["GD_GTLQ_NGAY_CAP_TEXT"] = ngay_cap.ToString("dd/MM/yyyy"); } } ResetForm(); } } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void btnMaDoiTuong_Click(object sender, RoutedEventArgs e) { try { if (cmbLoaiDoiTuong.SelectedIndex >= 0) { AutoCompleteEntry auLoaiDoiTuong = (AutoCompleteEntry)cmbLoaiDoiTuong.SelectedItem; if (auLoaiDoiTuong.KeywordStrings[0].Equals("NSD")) { List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonVi); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_HT_NSD", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup.Count > 0) { foreach (DataRow dr in lstPopup) { txtMaDoiTuong.Tag = Convert.ToInt32(dr["ID"]); txtMaDoiTuong.Text = dr["MA_NSD"].ToString(); lblTenDoiTuong.Content = dr["TEN_DAY_DU"].ToString(); } } } else if (auLoaiDoiTuong.KeywordStrings[0].Equals("NHNSD")) { List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonVi); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_HT_NHNSD", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup.Count > 0) { foreach (DataRow dr in lstPopup) { txtMaDoiTuong.Tag = Convert.ToInt32(dr["ID"]); txtMaDoiTuong.Text = dr["MA_NHNSD"].ToString(); lblTenDoiTuong.Content = dr["TEN_NHNSD"].ToString(); } } } } } catch (Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { this.Cursor = Cursors.Arrow; } }
//private void radpage_PageIndexChanged(object sender, PageIndexChangedEventArgs e) //{ // if (e.NewPageIndex < radpage.PageCount) // { // CurrentPagging = e.NewPageIndex + 1; // StartRow = (CurrentPagging - 1) * PaggingSize + 1; // EndRow = StartRow + PaggingSize; // //radpage = new RadDataPager(); // TimKiemPhanTrang(); // } //} /// <summary> /// Tìm kiếm phân trang /// </summary> private void TimKiemPhanTrang() { Mouse.OverrideCursor = Cursors.Wait; DataTable dt = null; LDatatable.MakeParameterTable(ref dt); // Lay du lieu treeview cho tim kiem string ma_don_vi = "-1"; string ma_khu_vuc = "-1"; string ma_cum = "-1"; string ma_nhom = "-1"; if (tvwKhachHangDS.SelectedItem != null) { RadTreeViewItem item = tvwKhachHangDS.SelectedItem as RadTreeViewItem; string level = item.Tag.ToString().Split('#')[0]; string[] path = item.Tag.ToString().Split('#')[1].Split('/'); string type = item.Tag.ToString().Split('#')[2]; if (type == "DVI") { ma_don_vi = path[path.Length - 1]; } else { ma_don_vi = path[0]; //ma_khu_vuc = path[1]; //ma_cum = path[1]; if (type == "KVUC") { ma_khu_vuc = path[1]; } if (type == "CUM") { if (path.Length > 2) { ma_cum = path[2]; } else { ma_cum = path[1]; } } if (type == "NHOM") { if (path.Length > 3) { ma_nhom = path[3]; } else { ma_nhom = path[2]; } } } } // Thong tin ngay gia nhap if (raddtTuNgayGiaNhap.Value != null) { LDatatable.AddParameter(ref dt, "@NgayGiaNhapTu", "STRING", Convert.ToDateTime(raddtTuNgayGiaNhap.Value).ToString("yyyyMMdd")); } else { LDatatable.AddParameter(ref dt, "@NgayGiaNhapTu", "STRING", ""); } if (raddtDenNgayGiaNhap.Value != null) { LDatatable.AddParameter(ref dt, "@NgayGiaNhapDen", "STRING", Convert.ToDateTime(raddtDenNgayGiaNhap.Value).ToString("yyyyMMdd")); } else { LDatatable.AddParameter(ref dt, "@NgayGiaNhapDen", "STRING", ""); } // Lay du lieu tu cac combobox AutoComboBox au = new AutoComboBox(); AutoCompleteEntry nganhKT = au.getEntryByDisplayName(lstSourceNganhKinhTe, ref cmbNganhKT); AutoCompleteEntry loaihinhToChuc = au.getEntryByDisplayName(lstSourceLoaiHinhToChuc, ref cmbLoaiHinhToChuc); AutoCompleteEntry loaiKhachHang = au.getEntryByDisplayName(lstSourceLoaiKhachHang, ref cmbLoaiKhachHang); if (nganhKT != null) { LDatatable.AddParameter(ref dt, "@NganhKT", "STRING", nganhKT.KeywordStrings[0]); } else { LDatatable.AddParameter(ref dt, "@NganhKT", "STRING", ""); } if (loaihinhToChuc != null) { LDatatable.AddParameter(ref dt, "@LoaiHinhToChuc", "STRING", loaihinhToChuc.KeywordStrings[0]); } else { LDatatable.AddParameter(ref dt, "@LoaiHinhToChuc", "STRING", ""); } if (loaiKhachHang != null) { LDatatable.AddParameter(ref dt, "@LoaiKhachHang", "STRING", loaiKhachHang.KeywordStrings[0]); } else { LDatatable.AddParameter(ref dt, "@LoaiKhachHang", "STRING", ""); } // Them du lieu vao tim kiem if (ucTrangThaiNVu.GetItemsSelected() == "NULL") { LDatatable.AddParameter(ref dt, "@TrangThaiNghiepVu", "STRING", ""); } else { LDatatable.AddParameter(ref dt, "@TrangThaiNghiepVu", "STRING", ucTrangThaiNVu.GetItemsSelected()); } LDatatable.AddParameter(ref dt, "@MaKhachHang", "STRING", txtMaKH.Text); LDatatable.AddParameter(ref dt, "@TenKhachHang", "STRING", txtTenKH.Text); LDatatable.AddParameter(ref dt, "@DkienMPA", "STRING", ""); if (cmbDanToc.SelectedIndex >= 0) { LDatatable.AddParameter(ref dt, "@DanToc", "STRING", lstSourceDanToc.ElementAt(cmbDanToc.SelectedIndex).KeywordStrings.First()); } else { LDatatable.AddParameter(ref dt, "@DanToc", "STRING", ""); } if (cmbGioiTinh.SelectedIndex >= 0) { LDatatable.AddParameter(ref dt, "@GioiTinh", "STRING", lstSourceGioiTinh.ElementAt(cmbGioiTinh.SelectedIndex).KeywordStrings.First()); } else { LDatatable.AddParameter(ref dt, "@GioiTinh", "STRING", ""); } if (cmbLHCongTac.SelectedIndex >= 0) { LDatatable.AddParameter(ref dt, "@NgheNghiep", "STRING", lstSourceLHinhCongTac.ElementAt(cmbLHCongTac.SelectedIndex).KeywordStrings.First()); } else { LDatatable.AddParameter(ref dt, "@NgheNghiep", "STRING", ""); } LDatatable.AddParameter(ref dt, "@TuoiTu", "STRING", Convert.ToInt32(numTuoiTu.Value).ToString()); LDatatable.AddParameter(ref dt, "@TuoiDen", "STRING", Convert.ToInt32(numTuoiDen.Value).ToString()); LDatatable.AddParameter(ref dt, "@NgayHienTai", "STRING", ClientInformation.NgayLamViecHienTai); LDatatable.AddParameter(ref dt, "@SoCMND", "STRING", txtCMND.Text); LDatatable.AddParameter(ref dt, "@SoDkyKDoanh", "STRING", txtSoDKKD.Text); LDatatable.AddParameter(ref dt, "@TenDangNhap", "STRING", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dt, "@DonViQLy", "STRING", ClientInformation.MaDonViQuanLy); LDatatable.AddParameter(ref dt, "@DonVi", "INT", ma_don_vi); LDatatable.AddParameter(ref dt, "@KhuVuc", "INT", ma_khu_vuc); LDatatable.AddParameter(ref dt, "@Cum", "INT", ma_cum); LDatatable.AddParameter(ref dt, "@Nhom", "INT", ma_nhom); LDatatable.AddParameter(ref dt, "@StartRow", "INT", StartRow.ToString()); LDatatable.AddParameter(ref dt, "@EndRow", "INT", EndRow.ToString()); // Tim kiem Presentation.Process.KhachHangProcess process = new Presentation.Process.KhachHangProcess(); DataSet ds = process.getKetQuaTimKiemNangCao(dt); if (ds != null && ds.Tables.Count > 0) { DataTable serverDataTable = ds.Tables[0]; int totalRecord = Int32.Parse(ds.Tables[1].Rows[0][0].ToString()); DataTable clientDataTable = CommonFunction.BuildClientDataTable(serverDataTable, CurrentPagging, PaggingSize, totalRecord); //grKhachHangDS.ItemsSource = ds.Tables[0].DefaultView; //lblSumKhachHang.Content = ds.Tables[0].Rows.Count.ToString(); lblSumKhachHang.Content = totalRecord; //radpage.Source = ds.Tables[0].DefaultView; //radpage = new RadDataPager(); //radpage.Source = clientDataTable.DefaultView; //radpage.PageSize = PaggingSize; //radpage.PageIndex = CurrentPagging - 1; //grKhachHangDS.ItemsSource = radpage.PagedSource; grKhachHangDS.ItemsSource = null; grKhachHangDS.ItemsSource = clientDataTable.DefaultView; if (!LObject.IsNullOrEmpty(grKhachHangDS.SelectedItem)) { grKhachHangDS.SelectedItems.Clear(); } } Mouse.OverrideCursor = Cursors.Arrow; }
private void GetFormData() { // Lấy dữ liệu từ form TuNgay = LDateTime.DateToString(raddtTuNgayChotSoLieu.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat); DenNgay = LDateTime.DateToString(raddtDenNgayChotSoLieu.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat); NgayBaoCao = LDateTime.DateToString(raddtNgayBaoCao.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat); AutoCompleteEntry auChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex); if (!LObject.IsNullOrEmpty(auChiNhanh)) { MaChiNhanh = auChiNhanh.KeywordStrings.FirstOrDefault(); } else { MaChiNhanh = ""; } AutoCompleteEntry auPhongGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex); if (!LObject.IsNullOrEmpty(auPhongGD)) { MaPhongGiaoDich = auPhongGD.KeywordStrings.FirstOrDefault(); } else { MaPhongGiaoDich = ""; } AutoCompleteEntry auMaCum = lstSourceCum_Select.ElementAt(cmbCum.SelectedIndex); if (!LObject.IsNullOrEmpty(auMaCum)) { MaCum = auMaCum.KeywordStrings.FirstOrDefault(); } else { MaCum = ""; } AutoCompleteEntry auLoaiTien = lstSourceLoaiTien.ElementAt(cmbLoaiTien.SelectedIndex); if (!LObject.IsNullOrEmpty(auLoaiTien)) { LoaiTien = auLoaiTien.KeywordStrings.FirstOrDefault(); } else { LoaiTien = ""; } AutoCompleteEntry auNgonNgu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex); if (!LObject.IsNullOrEmpty(auNgonNgu)) { MaNgonNgu = auNgonNgu.KeywordStrings.FirstOrDefault(); } else { MaNgonNgu = ""; } AutoCompleteEntry auDinhDang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex); if (!LObject.IsNullOrEmpty(auDinhDang)) { MaDinhDang = auNgonNgu.KeywordStrings.FirstOrDefault(); } else { MaDinhDang = ""; } // Gán dữ liệu từ form vào các biến truyền cho báo cáo }
private void GetDataOnForm(ref DANH_SACH_KHE_UOC_VONG_VAY obj) { List <Presentation.Process.TinDungServiceRef.DANH_SACH_SO> lstRutTien = new List <Presentation.Process.TinDungServiceRef.DANH_SACH_SO>(); List <Presentation.Process.TinDungServiceRef.DANH_SACH_SO> lstNopTien = new List <Presentation.Process.TinDungServiceRef.DANH_SACH_SO>(); if (_kheUoc.DSACH_SO_NOP_TIEN != null) { _kheUoc.DSACH_SO_NOP_TIEN = null; } if (_kheUoc.DSACH_SO_RUT_TIEN != null) { _kheUoc.DSACH_SO_RUT_TIEN = null; } if (chkNopBangTienMat.IsChecked == true) { _kheUoc.THUC_THU_TIEN_MAT = Convert.ToDecimal(numTienMat.Value); } if (chkTKTietKiemKhongKyHan.IsChecked == true) { _kheUoc.NOP_TIEN_TU_TKKKH = "CO"; AutoComboBox auto = new AutoComboBox(); AutoCompleteEntry au = auto.getEntryByDisplayName(lstSourceTaiKhoanKhongKyHan, ref cmbTaiKhoanTK); Presentation.Process.TinDungServiceRef.DANH_SACH_SO objRutTK = new Presentation.Process.TinDungServiceRef.DANH_SACH_SO(); objRutTK.SO_SO = au.DisplayName; objRutTK.SO_TAI_KHOAN = cmbTaiKhoanTK.Tag.ToString(); objRutTK.SO_DU = Convert.ToDecimal(numSoDuTaiKhoanTK.Value); objRutTK.SO_TIEN_RUT_RA = Convert.ToDecimal(numSoTienRutTuTK.Value); lstRutTien.Add(objRutTK); } else { _kheUoc.NOP_TIEN_TU_TKKKH = "KHONG"; } if (chkTKKhongKyHanTienThua.IsChecked == false) { _kheUoc.NOP_TIEN_VAO_TKKKH = "KHONG"; } else { _kheUoc.NOP_TIEN_VAO_TKKKH = "CO"; DataTable dt = ((DataView)grTKKhongKyHanTienThua.ItemsSource).Table; foreach (DataRow dr in dt.Rows) { if (!dr["so_so_tg"].ToString().Equals(obj.SO_SO_TG)) { Presentation.Process.TinDungServiceRef.DANH_SACH_SO objNopTK = new Presentation.Process.TinDungServiceRef.DANH_SACH_SO(); if (!dr["so_so_tg"].ToString().Equals(_kheUoc.SO_SO_TG)) { objNopTK.SO_SO = dr["so_so_tg"].ToString(); objNopTK.SO_TAI_KHOAN = dr["so_tai_khoan"].ToString(); objNopTK.SO_DU = Convert.ToDecimal(dr["so_tien"]); objNopTK.SO_TIEN_NOP_VAO = Convert.ToDecimal(dr["so_tien_nop"]); lstNopTien.Add(objNopTK); obj.THUC_THU_NOP_VAO_TKKKH += Convert.ToDecimal(dr["so_tien_nop"]); } } else { obj.THUC_THU_TKQD += Convert.ToDecimal(dr["so_tien_nop"]); } } } //if (chkGhiTKNoiBo.IsChecked == false) //{ _kheUoc.GHI_NHAN_VAO_TKNB = "KHONG"; //} //else //{ // _kheUoc.GHI_NHAN_VAO_TKNB = "CO"; //} if (chkTraTruocHan.IsChecked == false) { _kheUoc.TRA_GOC_LAI_TRUOC_HAN = "KHONG"; } else { _kheUoc.TRA_GOC_LAI_TRUOC_HAN = "CO"; _kheUoc.TONG_TIEN_TRA_TRUOC = Convert.ToDecimal(numSoTienNop.Value); } if (lstNopTien != null && lstNopTien.Count > 0) { obj.DSACH_SO_NOP_TIEN = lstNopTien.ToArray(); } if (lstRutTien != null && lstRutTien.Count > 0) { obj.DSACH_SO_RUT_TIEN = lstRutTien.ToArray(); } _kheUoc.PHI_TRA_TRUOC = Convert.ToDecimal(numPhiTraTruoc.Value); PhanBoSoTienThuDuoc(); }
private void tlbTongHop_Click(object sender, RoutedEventArgs e) { try { AutoCompleteEntry auBaoCao = listBaoCao.ElementAt(cmbLoaiBieu.SelectedIndex); AutoCompleteEntry auChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex); AutoCompleteEntry auPhongGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex); List <ThamSoBaoCao> listThamSoBaoCao = new List <ThamSoBaoCao>(); listThamSoBaoCao.Add(new ThamSoBaoCao("@MaBaoCao", auBaoCao.KeywordStrings[0], ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@NgayBaoCao", LDateTime.DateToString(raddtNgayChotSoLieu.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat), ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@NgayCuoiThang", LDateTime.DateToString(raddtNgayChotSoLieu.Value.GetValueOrDefault().GetLastDateOfMonth(), ApplicationConstant.defaultDateTimeFormat), ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@MaChiNhanh", auChiNhanh.KeywordStrings[0], ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@MaPhongGD", auPhongGD.KeywordStrings[0], ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@DinhKy", "1", ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@DonViTinh", numDonViTinh.Value.GetValueOrDefault().ToString(), ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); listThamSoBaoCao.Add(new ThamSoBaoCao("@VonTuCo", numVonTuCo.Value.GetValueOrDefault().ToString(), ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri())); // Chuẩn bị điều kiện cho báo cáo if (listThamSoBaoCao != null && listThamSoBaoCao.Count > 0) { if (lstHtBaoCaoTso.Where(t => t.LOAI_TSO == ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri() && t.MA_TSO.Equals("@DT_THAMSO")).Count() > 0) { lstHtBaoCaoTso = new List <HT_BAOCAO_TSO>(); foreach (ThamSoBaoCao thamSoBaoCao in listThamSoBaoCao) { HT_BAOCAO_TSO tso = new HT_BAOCAO_TSO(); tso.MA_TSO = thamSoBaoCao.MaThamSo; tso.LOAI_TSO = thamSoBaoCao.LoaiThamSo; tso.GTRI_TSO = thamSoBaoCao.GiaTriThamSo; lstHtBaoCaoTso.Add(tso); } } else { foreach (HT_BAOCAO_TSO htBaoCaoTso in lstHtBaoCaoTso) { foreach (ThamSoBaoCao thamSoBaoCao in listThamSoBaoCao) { if (htBaoCaoTso.MA_TSO.Equals(thamSoBaoCao.MaThamSo) && htBaoCaoTso.LOAI_TSO.Equals(thamSoBaoCao.LoaiThamSo)) { htBaoCaoTso.GTRI_TSO = thamSoBaoCao.GiaTriThamSo; break; } if (!LObject.IsNullOrEmpty(thamSoBaoCao.DsThamSo)) { ds = thamSoBaoCao.DsThamSo; } } } } } ds = process.LayDuLieuBaoCaoTKe(idBaoCao, maBaoCao, ref objBieuMau, htBaoCao, lstHtBaoCaoTso); BuildData(); } catch (System.Exception ex) { Mouse.OverrideCursor = Cursors.Arrow; CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { } }