private void btnSoTaiKhoan_Click(object sender, RoutedEventArgs e) { //POPUP_TKHOAN_CTIET_CONG_NO Cursor = Cursors.Wait; try { AutoCompleteEntry auPGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(auPGD.KeywordStrings.FirstOrDefault()); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET_CONG_NO.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Content = popup; win.ShowDialog(); if (lstPopup.Count > 0) { txtSoTaiKhoan.Text = lstPopup.FirstOrDefault()["SO_TAI_KHOAN"].ToString(); } GetDoiTuongTaiKhoan(); } catch (Exception ex) { throw ex; } Cursor = Cursors.Arrow; }
private void ChonKhachHang() { List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonVi); lstDieuKien.Add("NULL"); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACH_HANG.getValue(), 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.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup.Count > 0) { DataRow row = (DataRow)lstPopup.First(); txtMaKH.Text = row["MA_KHANG"].ToString(); lblTenKH.Content = row["TEN_KHANG"].ToString(); } }
void btnCum_Click(object sender, RoutedEventArgs e) { 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) { idCum = Convert.ToInt32(lstPopup[0]["ID"]); maCum = lstPopup[0]["MA_CUM"].ToString(); lstDanhSachKUOC = new List <DANH_SACH_KHE_UOC_LAP_LICH>(); raddgrLapKeHoach.ItemsSource = null; raddgrLapKeHoach.ItemsSource = lstDanhSachKUOC; txtCum.Text = maCum; LoadComboBoxBDauTraVon(); } }
private void btnMaPhanLoai_Click(object sender, RoutedEventArgs e) { Presentation.Process.KeToanProcess ketoanProcess = new Presentation.Process.KeToanProcess(); try { //Bat popup var process = new PopupProcess(); process.getPopupInformation("POPUP_KT_PLOAI"); SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = "Danh sách mã phân loại tài khoản"; win.Content = popup; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { DataRow dr = lstPopup[0]; txtMaPhanLoai.Tag = dr[0].ToString(); txtMaPhanLoai.Text = dr[2].ToString(); lblTenPhanLoai.Content = dr[3].ToString(); } } catch (System.Exception ex) { LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } finally { ketoanProcess = null; } }
private void btnSoKheUoc_Click(object sender, RoutedEventArgs e) { Cursor = Cursors.Wait; List <string> lstDieuKien = new List <string>(); lstDieuKien.Add("0"); lstDieuKien.Add(ClientInformation.MaDonVi); lstDieuKien.Add("KUOCTRANO"); lstDieuKien.Add(ClientInformation.NgayLamViecHienTai); lstDieuKien.Add("%"); lstPopupKU = new List <int>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_KHEUOC", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopupKheUocViMo popup = new ucPopupKheUocViMo(true, simplePopupResponse, true); popup.LayGiaTriListID = new ucPopupKheUocViMo.LayListID(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopupKU.Count > 0) { foreach (int drv in lstPopupKU) { } } Cursor = Cursors.Arrow; }
private void ChonKhachHang() { List <string> lstDieuKien = new List <string>(); KhachHangProcess khProcess = new KhachHangProcess(); MaChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); //lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add(MaChiNhanh); lstDieuKien.Add("NULL"); lstDieuKien.Add("NULL"); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_KHACHHANG_BAOCAO", 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.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup.Count > 0) { DataRow row = (DataRow)lstPopup.First(); txtMaKH.Text = row["MA_KHANG"].ToString(); lblTenKH.Content = row["TEN_KHANG"].ToString(); IdKhachHang = row["ID"].ToString(); } }
void btnMaKH_Click(object sender, RoutedEventArgs e) { lstPopup.Clear(); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add("NULL"); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_KHACHHANG", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.Content = popup; win.ShowDialog(); if (lstPopup.Count > 0) { txtMaKH.Text = lstPopup[0][2].ToString(); idKHang = Convert.ToInt32(lstPopup[0][1]); lblTTinKHang.Content = lstPopup[0][3].ToString(); } }
/// <summary> /// Hiện popup khách hàng /// </summary> private void HienPopUpKhachHang() { PopupProcess Popupprocess = new PopupProcess(); List <string> lstDK = new List <string>(); string maDV = ""; if (cmbChiNhanh.SelectedIndex >= 0) { maDV = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.ElementAt(0); } string maCum = ""; if (cmbCum.SelectedIndex >= 0) { maCum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings.ElementAt(0); } lstDK.Add(maDV); lstDK.Add(maCum); Popupprocess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG.getValue(), lstDK); SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup; if (!simplePopupResponse.DataSetSource.IsNullOrEmpty() && simplePopupResponse.DataSetSource.Tables[0].Rows.Count > 0) { txtMaKhachHang.Text = simplePopupResponse.DataSetSource.Tables[0].Rows[0][0].ToString(); } }
private void ShowPopupLoaiThamSo() { try { lstPopup = new List <DataRow>(); var process = new PopupProcess(); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_HT_TSO_LOAI.getValue()); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null) { idLoai = Convert.ToInt32(lstPopup[0][1].ToString()); //txtMaLoaiThamSo.Text = lstPopup[0][2].ToString(); //lblLoaiThamSo.Content = lstPopup[0][3].ToString(); } } catch (System.Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } Mouse.OverrideCursor = Cursors.Arrow; }
private void HienDanhMucNhom() { try { DanhMucProcess dmProcess = new DanhMucProcess(); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DM_CUM", 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) { DataRow dr = lstPopup[0]; txtMaNhom.Text = dr["MA_NHOM"].ToString(); txtTenNhom.Text = dr["TEN_NHOM"].ToString(); LayDanhSachKheUoc(Convert.ToInt32(dr["ID"])); } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void HienThiPopup(DatabaseConstant.DanhSachTruyVan tenPopUp, List <string> lstDieuKien) { Presentation.Process.KeToanProcess ketoanProcess = new Presentation.Process.KeToanProcess(); try { //Bat popup var process = new PopupProcess(); process.getPopupInformation(tenPopUp.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.Content = popup; win.Title = simplePopupResponse.PopupTitle; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { DataRow dr = lstPopup[0]; DataRowView drCurrent = (DataRowView)raddgrHachToan.SelectedItem; //if (LString.IsNullOrEmptyOrSpace(drCurrent["SO_TAI_KHOAN"].ToString()) && LString.IsNullOrEmptyOrSpace(drCurrent["MA_PLOAI"].ToString()) && LString.IsNullOrEmptyOrSpace(drCurrent["MA_DTUONG"].ToString())) //{ // // Them dong moi // DataRow drNew = _dtSource.NewRow(); // drNew["STT"] = _dtSource.Rows.Count + 1; // if (formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_THU.layGiaTri()) || formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_CHI.layGiaTri())) // drNew["NHOM_DKHOAN"] = "1"; // _dtSource.Rows.Add(drNew); //} switch (tenPopUp) { case DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET: drCurrent["ID_PLOAI"] = dr["ID_PLOAI"]; drCurrent["MA_PLOAI"] = dr["MA_PLOAI"]; drCurrent["SO_TAI_KHOAN"] = dr[2]; drCurrent["TEN_TAI_KHOAN"] = dr[3]; break; case DatabaseConstant.DanhSachTruyVan.POPUP_DS_DOI_TUONG: drCurrent["MA_DTUONG"] = dr[2]; break; } raddgrHachToan.CommitEdit(); lstPopup.Clear(); } } catch (System.Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { ketoanProcess = null; } }
private void HienDanhMucKhachHang() { try { List <string> lstDieuKien = new List <string>(); KhachHangProcess khProcess = new KhachHangProcess(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); //lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add(machinhanh); lstDieuKien.Add("NULL"); lstDieuKien.Add("NULL"); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_KHACHHANG_BAOCAO", 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) { DataTable dt = new DataTable(); dt = lstPopup.CopyToDataTable(); if (!LObject.IsNullOrEmpty(dt) && dt.Rows.Count > 0) { if (dt.Columns.Contains("STT")) { dt.Columns.Remove("STT"); } if (LObject.IsNullOrEmpty(dtKhachHang)) { dtKhachHang = new DataTable(); } else { dt.Merge(dtKhachHang); } var result = dt.AsEnumerable().Select(x => x).Distinct(System.Data.DataRowComparer.Default).ToList(); dtKhachHang = result.CopyToDataTable(); grKhachHang.ItemsSource = null; grKhachHang.ItemsSource = dtKhachHang; } } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
private void btnThem_Click(object sender, RoutedEventArgs e) { //Mouse.OverrideCursor = Cursors.Wait; try { lstPopup = new List <DataRow>(); var process = new PopupProcess(); List <string> lstDieuKien = new List <string>(); //lstDieuKien.Add("'" + txtMaDonVi.Text + "'"); lstDieuKien.Add("'" + lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.First() + "'"); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_HT_NSD.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, true); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null) { List <string> lstID = (from row in dt.AsEnumerable() select row.Field <string>("ID")).Distinct().ToList(); if (dt.Rows.Count == 0) { dt = new DataTable(); dt.Columns.Add(LLanguage.SearchResourceByKey("U.DungChung.STT"), typeof(string)); dt.Columns.Add("ID", typeof(string)); dt.Columns.Add(LLanguage.SearchResourceByKey("U.QuanTriHeThong.NhomNSD.ucNSDCT01.Ma"), typeof(string)); dt.Columns.Add(LLanguage.SearchResourceByKey("U.QuanTriHeThong.NhomNSD.ucNSDCT01.Ten"), typeof(string)); } foreach (DataRow row in lstPopup) { if (lstID.Contains(row[1]) != true) { DataRow r = dt.NewRow(); r[0] = dt.Rows.Count + 1; r[1] = row[1]; r[2] = row[2]; r[3] = row[3]; dt.Rows.Add(r); } } grDanhSach.ItemsSource = null; grDanhSach.ItemsSource = dt; loadWidthColumnDoiTuong(); } } catch (System.Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } //Mouse.OverrideCursor = Cursors.Arrow; }
void tlbDetailAdd_Click(object sender, RoutedEventArgs e) { if (txtMaKH.Text.IsNullOrEmptyOrSpace()) { CommonFunction.ThongBaoTrong(lblTDKhachHang.Content.ToString()); return; } lstPopup.Clear(); List <string> lstDieuKien = new List <string>(); if (LObject.IsNullOrEmpty(lstTSDB)) { lstTSDB = new List <DataRow>(); } string lstIDTSDB = ""; foreach (DataRow dr in lstTSDB) { lstIDTSDB += "," + dr["ID"].ToString(); } if (lstIDTSDB.Length > 0) { lstIDTSDB = "(" + lstIDTSDB.Substring(1) + ")"; } else { lstIDTSDB = "(0)"; } lstDieuKien.Add(ClientInformation.MaDonViQuanLy); lstDieuKien.Add(txtMaKH.Text); lstDieuKien.Add(lstIDTSDB); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_TSDB_HDTC_TDTD", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.Content = popup; win.ShowDialog(); if (lstPopup.Count > 0) { foreach (DataRow dr in lstPopup) { lstTSDB.Add(dr); } raddgrDSachTSDB.ItemsSource = null; raddgrDSachTSDB.ItemsSource = lstTSDB; SetGtriTong(lstTSDB); } }
private void tlbDetailAdd_Click(object sender, RoutedEventArgs e) { Cursor = Cursors.Wait; try { string sidKheUoc = ""; if (lstPopup.IsNullOrEmpty()) { foreach (DataRow dr in lstPopup) { sidKheUoc += "," + dr["ID"].ToString(); } } if (sidKheUoc.Length > 0) { sidKheUoc = sidKheUoc.Substring(1); } else { sidKheUoc = "0"; } AutoCompleteEntry auCum = lstSourceCum_Select.ElementAt(cmbCum.SelectedIndex); AutoCompleteEntry auPGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(sidKheUoc); lstDieuKien.Add(auPGD.KeywordStrings.FirstOrDefault()); lstDieuKien.Add(auCum.KeywordStrings.FirstOrDefault()); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_KHEUOC_BH", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, true); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Content = popup; win.ShowDialog(); if (lstPopup.Count > 0) { foreach (DataRow drv in lstPopup) { dtKheUoc.Rows.Add(drv); } } raddgrTUngCT.ItemsSource = null; raddgrTUngCT.ItemsSource = dtKheUoc; } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } Cursor = Cursors.Arrow; }
private void tlbDetailAdd_Click(object sender, RoutedEventArgs e) { try { if (cmbLoaiDoiTuong.SelectedIndex == -1) { return; } DOI_TUONG_SDU_TKHOAN_CT objDTuongCT = null; AutoCompleteEntry au = lstSourceDoiTuongLoai.ElementAt(cmbLoaiDoiTuong.SelectedIndex); //Bat popup PopupProcess process = new PopupProcess(); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonVi); lstDieuKien.Add(au.KeywordStrings.FirstOrDefault()); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_DOI_TUONG.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup; lstPopup.Clear(); ucPopup popup = new ucPopup(false, simplePopupResponse, true); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = LLanguage.SearchResourceByKey("U.KeToan.DoiTuong.ucDoiTuongSoDuCT.DanhSachDoiTuong"); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Content = popup; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { foreach (DataRow dr in lstPopup) { if (!lstDTuongCT.Select(f => f.MA_DTUONG).Contains(dr[2].ToString())) { objDTuongCT = new DOI_TUONG_SDU_TKHOAN_CT(); objDTuongCT.MA_DTUONG = dr[2].ToString(); objDTuongCT.TEN_TAI_KHOAN = dr[3].ToString(); objDTuongCT.MA_LSDU = MA_LSDU; objDTuongCT.NGAY_DL = ClientInformation.NgayLamViecHienTai; objDTuongCT.NGAY_GDICH = ClientInformation.NgayLamViecHienTai; objDTuongCT.NGAY_HLUC = ClientInformation.NgayLamViecHienTai; objDTuongCT.SODU = 0; objDTuongCT.ID_DTUONG = Convert.ToInt32(dr[1].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> /// Hiện popup khách hàng /// </summary> private void HienPopUpKhachHang() { PopupProcess Popupprocess = new PopupProcess(); List <string> lstDK = new List <string>(); string maDV = ""; if (cmbChiNhanh.SelectedIndex >= 0) { maDV = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.ElementAt(0); } string maPGD = ""; if (cmbChiNhanh.SelectedIndex >= 0) { maPGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.ElementAt(0); } string maCum = ""; if (cmbCum.SelectedIndex >= 0) { maCum = lstSourceCum_Select.ElementAt(cmbCum.SelectedIndex).KeywordStrings.ElementAt(0); } lstDK.Add(maDV); lstDK.Add(maPGD); lstDK.Add(maCum); Popupprocess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG_BAOCAO.getValue(), lstDK); SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = "Danh sách nhóm khách hàng"; win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { txtMaKhachHang.Text = lstPopup[0][2].ToString(); txtTenKhachHang.Text = lstPopup[0][3].ToString(); } cmbKheUoc.Items.Clear(); if (!txtMaKhachHang.Text.IsNullOrEmptyOrSpace()) { lstSourceKheUoc = new List <AutoCompleteEntry>(); AutoComboBox auto = new AutoComboBox(); // Khởi tạo điều kiện gọi danh mục List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(txtMaKhachHang.Text); // khởi tạo combobox auto = new AutoComboBox(); auto.GenAutoComboBox(ref lstSourceKheUoc, ref cmbKheUoc, DatabaseConstant.DanhSachTruyVan.COMBOBOX_KUOC_KHANG.getValue(), lstDieuKien); } }
private void rbtnDonVi_Click(object sender, RoutedEventArgs e) { var process = new PopupProcess(); process.getPopupInformation("POPUP_DS_"); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, true); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.ShowDialog(); }
private void btnAdd_Click(object sender, RoutedEventArgs e) { try { lstPopup = null; var process = new PopupProcess(); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_HOSO_NVIEN.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null) { foreach (DataRow dr in lstPopup) { if (KiemTraTonTaiGrid(dr["ID"].ToString())) { DataRow drHSo = dt.NewRow(); drHSo["ID_HSO"] = Convert.ToInt32(dr["ID"]); drHSo["MA_HSO"] = dr["MA_HSO"].ToString(); drHSo["TEN_HSO"] = dr["TEN_HSO"].ToString(); drHSo["CHUC_VU"] = 0; drHSo["NGAY_THAM_GIA"] = LDateTime.StringToDate(ClientInformation.NgayLamViecHienTai, "yyyyMMdd").ToString("dd/MM/yyyy"); drHSo["NQL"] = 0; dt.Rows.Add(drHSo); } } } for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["STT"] = i + 1; } grid.DataContext = dt.DefaultView; } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); CommonFunction.ThongBaoLoi(ex); } }
private void HienDanhMucKhachHang() { try { List <string> lstDieuKien = new List <string>(); KhachHangProcess khProcess = new KhachHangProcess(); string lstIDKH = ""; if (!txtMaKhachHang.Text.IsNullOrEmptyOrSpace()) { lstIDKH = "(" + _idKhachHang.ToString() + ")"; } else { lstIDKH = "(0)"; } lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add("NULL"); lstDieuKien.Add("NULL"); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_KHACHHANG_BAOCAO", 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) { DataRow dr = lstPopup[0]; _idKhachHang = Convert.ToInt32(dr["ID"]); dsKhachHang = khProcess.getThongTinCoBanKHTheoID(_idKhachHang); if (dsKhachHang != null && dsKhachHang.Tables[0].Rows.Count > 0) { txtMaKhachHang.Text = dsKhachHang.Tables[0].Rows[0]["MA_KHANG"].ToString(); txtTenKhachHang.Text = dsKhachHang.Tables[0].Rows[0]["TEN_KHANG"].ToString(); txtDiaChi.Text = dsKhachHang.Tables[0].Rows[0]["DIA_CHI"].ToString(); LayDSDonVayVon(_idKhachHang); } } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void btnAddTSDB_Click(object sender, RoutedEventArgs e) { List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(idKheUoc.ToString()); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_TAISAN_XULY", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, true); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup.Count > 0) { foreach (DataRow dr in lstPopup) { XuLyNoQuaHan.TSDBXuLy objTSDB = new XuLyNoQuaHan.TSDBXuLy(); for (int i = 0; i < dr.Table.Columns.Count; i++) { string sName = dr.Table.Columns[i].ColumnName; PropertyInfo property = objTSDB.GetType().GetProperty(sName); if (property != null) { if (property.PropertyType == typeof(decimal)) { property.SetValue(objTSDB, Convert.ToDecimal(dr[i]), null); } else if (property.PropertyType == typeof(int)) { property.SetValue(objTSDB, Convert.ToInt32(dr[i]), null); } else { property.SetValue(objTSDB, dr[i].ToString(), null); } } } lstTSDB.Add(objTSDB); } grdTaiSanDamBao.ItemsSource = lstTSDB; } }
void LoadPopUpSanPham() { List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonVi); lstPopup = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_SANPHAM_TD", 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) { foreach (DataRow dr in lstPopup) { if (lstDanhSachSanpham.Where(f => f.MA_SAN_PHAM.Contains(dr["MA_SAN_PHAM"].ToString())).Count() < 1) { SAN_PHAM_DBAN_CTIET objSanPhamCTiet = new SAN_PHAM_DBAN_CTIET(); objSanPhamCTiet.NGAY_ADUNG = ClientInformation.NgayLamViecHienTai; objSanPhamCTiet.ID_DBAN = idDiaBan; objSanPhamCTiet.ID_SAN_PHAM = Convert.ToInt32(dr["ID"]); objSanPhamCTiet.LOAI_DBAN = "DM_CUM"; objSanPhamCTiet.MA_DBAN = MaDiaBan; objSanPhamCTiet.MA_DVI_QLY = objCum.MA_DVI_QLY; objSanPhamCTiet.MA_DVI_TAO = objCum.MA_DVI_TAO; objSanPhamCTiet.MA_SAN_PHAM = dr["MA_SAN_PHAM"].ToString(); objSanPhamCTiet.TEN_SAN_PHAM = dr["TEN_SAN_PHAM"].ToString(); 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 ShowPopupMaThamChieu() { //ClientInformation.MaDonVi //ClientInformation.MaDonViGiaoDich //ClientInformation.TenDangNhap //ClientInformation.NgayLamViecHienTai //lay loai tham chieu List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>(); DanhMucProcess DanhMucProcess = new DanhMucProcess(); DM_LOAI_DTUONG dmDoiTuongLoai = new DM_LOAI_DTUONG(); int idDoiTuongLoai; if (cmbLoaiDoiTuong.SelectedIndex >= 0 && int.TryParse(lstSourceDoiTuongLoai.ElementAt(cmbLoaiDoiTuong.SelectedIndex).KeywordStrings.ElementAt(1).ToString().Trim(), out idDoiTuongLoai)) { dmDoiTuongLoai.ID = idDoiTuongLoai; DanhMucProcess.getDoiTuongLoaiById(dmDoiTuongLoai.ID, ref dmDoiTuongLoai, ref listClientResponseDetail); } List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(ClientInformation.MaDonVi); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add(ClientInformation.TenDangNhap); lstDieuKien.Add(ClientInformation.NgayLamViecHienTai); var process = new PopupProcess(); process.getPopupInformation(dmDoiTuongLoai.NGUON_TAO_DL, lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { DataRow row = lstPopup[0]; txtMaThamChieu.Text = row[1].ToString(); txtTenDoiTuong.Text = row[2].ToString(); } }
private void button6_Click(object sender, RoutedEventArgs e) { var process = new PopupProcess(); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add("NULL"); lstDieuKien.Add("NULL"); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, true); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.ShowDialog(); }
/* * private void button5_Click(object sender, RoutedEventArgs e) * { * ucPopup popup = new ucPopup(0, 1, false); * Window win = new Window(); * win.Content = popup; * win.ShowDialog(); * } */ private void button5_Click(object sender, RoutedEventArgs e) { var process = new PopupProcess(); //process.getPopupInformation("POPUP_DS_DONVI"); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add("'SDU','KDU'"); lstDieuKien.Add("1"); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DM_DIABAN.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, true); Window win = new Window(); win.Content = popup; win.ShowDialog(); int ID = popup.ID; // ??? }
/// <summary> /// Hiện popup khách hàng /// </summary> private void HienPopUpKhachHang() { PopupProcess Popupprocess = new PopupProcess(); List <string> lstDK = new List <string>(); string maDV = ""; if (cmbChiNhanh.SelectedIndex >= 0) { maDV = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.ElementAt(0); } string maPGD = ""; if (cmbChiNhanh.SelectedIndex >= 0) { maPGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.ElementAt(0); } string maCum = ""; if (cmbCum.SelectedIndex >= 0) { maCum = lstSourceCum_Select.ElementAt(cmbCum.SelectedIndex).KeywordStrings.ElementAt(0); } lstDK.Add(maDV); lstDK.Add(maPGD); lstDK.Add(maCum); Popupprocess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG_BAOCAO.getValue(), lstDK); SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup; ucPopup popup = new ucPopup(true, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = "Danh sách nhóm khách hàng"; win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null && lstPopup.Count > 0) { txtMaKhachHang.Text = lstPopup[0][2].ToString(); } }
private void ShowPopupDonVi() { try { lstPopup = new List <DataRow>(); var process = new PopupProcess(); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DM_DONVI.getValue()); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopup != null) { //if (txtMaDonVi.Text != lstPopup[0][2].ToString()) //{ // // Reset source thông tin đối tượng // dt = new DataTable(); // dt.Columns.Add("STT", typeof(string)); // dt.Columns.Add("ID", typeof(string)); // dt.Columns.Add("Mã", typeof(string)); // dt.Columns.Add("Tên", typeof(string)); // grDanhSach.ItemsSource = dt; // txtMaDonVi.Text = lstPopup[0][2].ToString(); // lblDonViQL.Content = lstPopup[0][3].ToString(); //} } } catch (System.Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } Mouse.OverrideCursor = Cursors.Arrow; }
private void HienThiDSKheUoc() { Cursor = Cursors.Wait; try { string sHinhThucXuLy = lstHinhThucXuLy.ElementAt(cmbHinhThucXuLyNo.SelectedIndex).KeywordStrings[0]; List <string> lstDieuKien = new List <string>(); string sidKheUoc = "0"; int idKUoc = 0; lstDieuKien.Add(sidKheUoc); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add(sHinhThucXuLy); lstDieuKien.Add(ClientInformation.NgayLamViecHienTai); lstDieuKien.Add("%"); PopupProcess process = new PopupProcess(); process.getPopupInformation("POPUP_DS_KHEUOC", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopupKheUocViMo popup = new ucPopupKheUocViMo(true, simplePopupResponse, false); popup.LayGiaTriListID = new ucPopupKheUocViMo.LayListID(LayDuLieuTuPopup); Window win = new Window(); win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Content = popup; win.ShowDialog(); if (lstPopupKU.Count > 0) { idKUoc = lstPopupKU[0]; LayThongTinKheUoc(idKUoc, txtSoKheUoc.Text.Trim(), "GetByID"); } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); CommonFunction.ThongBaoLoi(ex); } finally { Cursor = Cursors.Arrow; } }
private void btnKhachHang_Click(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = Cursors.Wait; try { var process = new PopupProcess(); List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First()); process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG_PGD.getValue(), lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopup popup = new ucPopup(false, simplePopupResponse, false); popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; Mouse.OverrideCursor = Cursors.Arrow; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Title = "Danh sách khách hàng"; win.ShowDialog(); if (lstPopup != null) { DataRow row = lstPopup[0]; KhachHangProcess processKH = new KhachHangProcess(); DataRow dr = processKH.getThongTinCoBanKHTheoID(Convert.ToInt32(row[1])).Tables[0].Rows[0]; AfterGetKhachHang(dr); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
/// <summary> /// Hiện popup khách hàng /// </summary> private void HienPopUpKhachHang() { PopupProcess Popupprocess = new PopupProcess(); List <string> lstDK = new List <string>(); string maDV = ""; if (cmbChiNhanh.SelectedIndex >= 0) { maDV = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.ElementAt(0); } string maCum = ""; if (cmbCum.SelectedIndex >= 0) { maCum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings.ElementAt(0); } lstDK.Add(maDV); lstDK.Add(maCum); Popupprocess.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG.getValue(), lstDK); SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup; if (!simplePopupResponse.DataSetSource.IsNullOrEmpty() && simplePopupResponse.DataSetSource.Tables[0].Rows.Count > 0) { txtMaKhachHang.Text = simplePopupResponse.DataSetSource.Tables[0].Rows[0][0].ToString(); } if (!txtMaKhachHang.Text.IsNullOrEmptyOrSpace()) { lstSourceKheUoc = new List <AutoCompleteEntry>(); AutoComboBox auto = new AutoComboBox(); // Khởi tạo điều kiện gọi danh mục List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(txtMaKhachHang.Text); // khởi tạo combobox auto = new AutoComboBox(); auto.GenAutoComboBox(ref lstSourceKheUoc, ref cmbKheUoc, DatabaseConstant.DanhSachTruyVan.COMBOBOX_KUOC_KHANG.getValue(), lstDieuKien); } }