public DataTable GetParameters() { if (!Validation()) { return(null); } GetFormData(); DataTable dt = null; LDatatable.MakeParameterListTable(ref dt); LDatatable.AddParameterList(ref dt, "MA_NSD", ClientInformation.TenDangNhap); LDatatable.AddParameterList(ref dt, "MA_DVI_QLY", ClientInformation.MaDonVi); LDatatable.AddParameterList(ref dt, "MA_DVI_TAO", ClientInformation.MaDonViGiaoDich); LDatatable.AddParameterList(ref dt, "MA_GDICH", txtMaGiaoDich.Text); LDatatable.AddParameterList(ref dt, "NGAY_GDICH", Convert.ToDateTime(raddtNgayGiaoDich.Value).ToString("yyyyMMdd")); foreach (DataRowView drv in grid.Items) { LDatatable.AddParameterList(ref dt, "DETAIL", drv["MA_KHE_UOC"].ToString(), drv["THUC_THU_GOC_VAY_CU"].ToString(), drv["THUC_THU_GOC_VAY"].ToString(), drv["THUC_THU_LAI_TRONG_CU"].ToString(), drv["THUC_THU_LAI_TRONG"].ToString() ); } return(dt); }
/// <summary> /// Lay danh sach tai khoan hach toan /// </summary> /// <param name="MaNhomTS"></param> /// <returns></returns> public DataSet GetDSTaiKhoanHachToan(string MaNhomTS) { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); // Khởi tạo và gán các giá trị cho request TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); TruyVanResponse response = new TruyVanServiceRef.TruyVanResponse(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); if (MaNhomTS.Equals("")) { LDatatable.AddParameter(ref dt, "", "", ""); request.dtThamSo = dt; request.objectName = "INQ.TS.TAI_KHOAN"; request.inquiryName = "TAI_KHOAN"; } else { LDatatable.AddParameter(ref dt, "@MA_NHOM_TS", "String", MaNhomTS); request.dtThamSo = dt; request.objectName = "INQ.TS.TAI_KHOAN"; request.inquiryName = "MA_NHOM_TS"; } // Lấy kết quả trả về response = ClientTruyVan.TruyVanMessage(request); // Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); return(response.dsResult); }
/// <summary> /// Load dữ liệu lên tree /// </summary> private void LoadTree() { DanhMucProcess danhMucProcess = new DanhMucProcess(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@USER_NAME", "String", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy); DataSet ds = danhMucProcess.getTreeNhom_01(dt); if (ds != null) { //lstHeader = DanhSachResponse.ListHeader.ToList(); dtMaster = ds.Tables[0]; DataRow drRoot = dtMaster.Rows[0]; RadTreeViewItem rootItem = new RadTreeViewItem(); rootItem.Header = drRoot["NODE_NAME"].ToString(); rootItem.Tag = drRoot["NODE"].ToString(); rootItem.Uid = drRoot["NODE_TYPE"].ToString(); //rootItem.IsExpanded = true; tvwTree.Items.Add(rootItem); BuildTree(rootItem); } }
private void LoadDuLieu() { Mouse.OverrideCursor = Cursors.Wait; try { NhanSuProcess processNhanSu = new NhanSuProcess(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MA_DVI", "STRING", ClientInformation.MaDonViQuanLy); DataSet ds = processNhanSu.GetDanhSachBangLuong(dt); if (ds != null && ds.Tables.Count > 0) { grid.DataContext = ds.Tables[0].DefaultView; } else { grid.DataContext = null; } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
private void LoadTreeview() { try { DanhMucProcess DanhMucProcess = new DanhMucProcess(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@USER_NAME", "String", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy); DataSet ds = DanhMucProcess.getTreeNhom_02(dt); if (ds != null) { //lstHeader = DanhSachResponse.ListHeader.ToList(); dtMaster = ds.Tables[0]; DataRow drRoot = dtMaster.Rows[0]; RadTreeViewItem rootItem = new RadTreeViewItem(); rootItem.Header = drRoot["NODE_NAME"].ToString(); rootItem.Tag = drRoot["NODE"].ToString(); rootItem.Uid = drRoot["NODE_TYPE"].ToString(); //rootItem.IsExpanded = true; tvwTree.Items.Add(rootItem); BuildTree(rootItem); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } }
private void LoadDuLieu() { Mouse.OverrideCursor = Cursors.Wait; try { NhanSuProcess processNhanSu = new NhanSuProcess(); int idDuAn = Convert.ToInt32(lstSourceDuAn[cmbDuAn.SelectedIndex].KeywordStrings[1]); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MA_DVI", "STRING", ClientInformation.MaDonViQuanLy); LDatatable.AddParameter(ref dt, "@ID_DU_AN", "STRING", idDuAn.ToString()); DataSet ds = processNhanSu.GetDanhSachQuanLyDuAn(dt); if (ds != null && ds.Tables.Count > 0) { dt = ds.Tables[0]; grid.DataContext = dt.DefaultView; } else { dt.Rows.Clear(); grid.DataContext = null; } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
private void LoadgrdDSLoaiTK() { Mouse.OverrideCursor = Cursors.Wait; try { DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@INP_USER", "string", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "string", ClientInformation.MaDonVi); LDatatable.AddParameter(ref dt, "@StartRow", "INT", StartRow.ToString()); LDatatable.AddParameter(ref dt, "@EndRow", "INT", EndRow.ToString()); Presentation.Process.KhaiThacDuLieuProcess process = new Presentation.Process.KhaiThacDuLieuProcess(); DataSet ds = process.GetDanhSachLoaiTK(dt); if (ds != null && ds.Tables.Count > 0) { grdDSLoaiTK.ItemsSource = ds.Tables[0].DefaultView; } else { grdDSLoaiTK.ItemsSource = null; } } catch (Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } Mouse.OverrideCursor = Cursors.Arrow; }
public DataSet getTreeView(string maDonVi, string userName) { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); //Khởi tạo và gán các giá trị cho request TruyVanServiceRef.TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); TruyVanServiceRef.TruyVanResponse response = new TruyVanServiceRef.TruyVanResponse(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); //LDatatable.AddParameter(ref dt, "@TrangThaiNVU", "STRING", BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri()); //LDatatable.AddParameter(ref dt, "@TrangThaiSDU", "STRING", BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri()); LDatatable.AddParameter(ref dt, "@INP_MA_DVI", "string", maDonVi); LDatatable.AddParameter(ref dt, "@INP_USER_NAME", "string", userName); request.dtThamSo = dt; request.objectName = "INQ.TREE.KHU_VUC_TDVM"; request.inquiryName = "TREE_VIEW"; // Lấy kết quả trả về TruyVanServiceClient ClientTruyVan = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService); response = ClientTruyVan.TruyVanMessage(request); // Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); return(response.dsResult); }
/// <summary> /// Khoi tao combobox /// </summary> private void InitCombobox() { AutoComboBox auto = new AutoComboBox(); List<string> lstDK = new List<string>(); Mouse.OverrideCursor = Cursors.Wait; try { // Khởi tạo điều kiện gọi danh mục List<string> lstDieuKien = new List<string>(); // khởi tạo combobox auto.GenAutoComboBox(ref lstSourceDonVi, ref cmbChiNhanh, DatabaseConstant.DanhSachTruyVan.COMBOBOX_CNHANH.getValue(), lstDieuKien, ClientInformation.MaDonVi); dtTuNgay.Value = ClientInformation.NgayLamViecHienTai.StringToDate(ApplicationConstant.defaultDateTimeFormat); DataTable dt=null; LDatatable.MakeParameterTable(ref dt); DataSet ds = new KeToanProcess().getDanhSachTongHop(dt); raddgrDoiTuongTK.ItemsSource = ds.Tables[0].DefaultView; raddgrDoiTuongTK.Rebind(); } catch (System.Exception ex) { LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
public DataSet GetTaiKhoanHachToan(string maDoiTuong, string maDonVi) { // Kiểm tra kết nối, server, service trước khi request TruyVanServiceClient client = null; Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); client = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService); Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); // Khởi tạo và gán các giá trị cho request TruyVanServiceRef.TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); TruyVanServiceRef.TruyVanResponse response = new TruyVanServiceRef.TruyVanResponse(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MA_PHAN_HE", "STRING", DatabaseConstant.Module.DMDC.getValue()); LDatatable.AddParameter(ref dt, "@MA_DTUONG", "STRING", maDoiTuong); LDatatable.AddParameter(ref dt, "@MA_DON_VI", "STRING", maDonVi); request.dtThamSo = dt; request.objectName = "INQ.CT.BIEU_PHI"; request.inquiryName = "TAI_KHOAN_HACH_TOAN"; // Lấy kết quả trả về response = client.TruyVanMessage(request); // Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); return(response.dsResult); }
/// <summary> /// Lấy thông tin giao dịch khách hàng, hợp đồng tín dụng, tiền gửi tiết kiệm /// </summary> /// <param name="id">ID khách hàng</param> /// <returns></returns> public DataSet GetThongTinGiaoDichTietKiem(int id, string maSoTG) { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); //Khởi tạo và gán các giá trị cho request TruyVanServiceRef.TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); TruyVanServiceRef.TruyVanResponse response = new TruyVanServiceRef.TruyVanResponse(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@ID_TIEN_GUI", "INT", id.ToString()); LDatatable.AddParameter(ref dt, "@MA_TIEN_GUI", "INT", maSoTG); request.dtThamSo = dt; request.inquiryName = "DANHSACH.GIAODICH"; request.objectName = "INQ.KTDL.KHTV_GDICH_TIETKIEM"; // Lấy kết quả trả về TruyVanServiceClient client = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService); response = client.TruyVanMessage(request); // Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); return(response.dsResult); }
public DataSet LayDanhSachNhomTaiSan() { DataSet dsNhomTS = new DataSet(); //Kiem tra ket noi server, service Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanRequest()); TruyVanResponse response = new TruyVanResponse(); try { DataTable dtThamso = null; LDatatable.MakeParameterTable(ref dtThamso); request.dtThamSo = dtThamso; request.objectName = "INQ.TS.DS_NHOM_TS"; request.inquiryName = "DS_NHOM_BCAO"; //make a call service client response = ClientTruyVan.TruyVanMessage(request); if (response != null && response.ResponseStatus == ApplicationConstant.ResponseStatus.THANH_CONG) { dsNhomTS = response.dsResult; } return(dsNhomTS); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); return(null); } }
public DataTable GetParameters() { if (!Validation()) { return(null); } GetFormData(); DataTable dt = null; LDatatable.MakeParameterListTable(ref dt); LDatatable.AddParameterList(ref dt, "MA_NSD", ClientInformation.TenDangNhap); LDatatable.AddParameterList(ref dt, "MA_DVI_QLY", ClientInformation.MaDonVi); LDatatable.AddParameterList(ref dt, "MA_DVI_TAO", ClientInformation.MaDonViGiaoDich); LDatatable.AddParameterList(ref dt, "MA_GDICH", txtMaGiaoDich.Text); LDatatable.AddParameterList(ref dt, "NGAY_GDICH", Convert.ToDateTime(raddtNgayGiaoDich.Value).ToString("yyyyMMdd")); foreach (DataRowView drv in grGuiThemDS.Items) { LDatatable.AddParameterList(ref dt, "DETAIL", drv["SO_SO_TG"].ToString(), drv["SO_TIEN_GUI_THEM_CU"].ToString(), drv["SO_TIEN_GUI_THEM"].ToString(), drv["SO_DU_MOI"].ToString() ); } return(dt); }
public DataSet GetTreeViewNhomTaiSan() { //Kiem tra ket noi server, service truoc khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanRequest()); TruyVanResponse response = new TruyVanResponse(); DataSet dsNhomTaisan = null; try { DataTable dtThamSo = null; LDatatable.MakeParameterTable(ref dtThamSo); LDatatable.AddParameter(ref dtThamSo, "", "", ""); request.dtThamSo = dtThamSo; request.objectName = "INQ.TS_PLOAI_TS"; request.inquiryName = "TREE_PLOAI_TS"; //make a call to service client response = ClientTruyVan.TruyVanMessage(request); //kiem tra ket qua tra ve Common.Utilities.ValidResponse(request, response); if (response != null && response.ResponseStatus == ApplicationConstant.ResponseStatus.THANH_CONG) { dsNhomTaisan = response.dsResult; } return(dsNhomTaisan); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); return(null); } }
public DataSet GetTreeDonVi(string sIDDonVi) { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); // Khởi tạo và gán các giá trị cho request TruyVanServiceRef.TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); TruyVanServiceRef.TruyVanResponse response = new TruyVanServiceRef.TruyVanResponse(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@ID_DON_VI", "STRING", sIDDonVi); request.dtThamSo = dt; request.objectName = "INQ.DS.QLTS_DUNG_CHUNG"; request.inquiryName = "TREE_DVI_PGD"; // Lấy kết quả trả về response = ClientTruyVan.TruyVanMessage(request); // Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); return(response.dsResult); }
public DataTable GetParameters() { if (!Validation()) { return(null); } GetFormData(); DataTable dt = null; LDatatable.MakeParameterListTable(ref dt); LDatatable.AddParameterList(ref dt, "MA_NSD", ClientInformation.TenDangNhap); LDatatable.AddParameterList(ref dt, "MA_GDICH", txtMaGiaoDich.Text); LDatatable.AddParameterList(ref dt, "NGAY_GDICH", Convert.ToDateTime(raddtNgayGiaoDich.Value).ToString("yyyyMMdd")); foreach (DataRowView drv in raddgrHachToan.Items) { LDatatable.AddParameterList(ref dt, "PHAT_SINH_CT", drv["ID"].ToString(), drv["ID_PLOAI"].ToString(), drv["MA_PLOAI"].ToString(), drv["SO_TAI_KHOAN"].ToString(), drv["GHI_NO"].ToString(), drv["GHI_CO"].ToString() ); } return(dt); }
public DataSet GetLaiSuatByID(int id) { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); // Khởi tạo và gán các giá trị cho request TruyVanServiceRef.TruyVanRequest request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); TruyVanServiceRef.TruyVanResponse response = new TruyVanServiceRef.TruyVanResponse(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@ID", "STRING", id.ToString()); //LDatatable.AddParameter(ref dt, "", "", ""); request.dtThamSo = dt; request.objectName = "INQ.DC_LSUAT_CT"; request.inquiryName = "%"; // Lấy kết quả trả về response = ClientTruyVan.TruyVanMessage(request); // Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); return(response.dsResult); }
/// <summary> /// Get ngay cuoi cung tong hop /// </summary> private void GetLastDate() { try { //Khởi tạo request DataTable dt = null; LDatatable.MakeParameterTable(ref dt); foreach (AutoCompleteCheckBox ChiNhanh in lstSourceChiNhanh.Where(f => f.CheckedMember == true)) { LDatatable.AddParameter(ref dt, "@MaChiNhanh", "STRING", ChiNhanh.ValueMember[INT_ZERO].ToString()); } TruyVanProcess truyVanProcess = new TruyVanProcess(); DataSet ds = truyVanProcess.TruyVanUDTT(MAX_DATE_TRANSACTION, dt); if (!ds.IsNullOrEmpty() && INT_ZERO < ds.Tables.Count && INT_ZERO < ds.Tables[INT_ZERO].Rows.Count) { raddtDenNgay.Value = LDateTime.StringToDate(ds.Tables[INT_ZERO].Rows[INT_ZERO][INT_ZERO].ToString(), ApplicationConstant.defaultDateTimeFormat); } else { raddtDenNgay.Value = DateTime.Now; } raddtTuNgay.Value = LDateTime.GetFirstDateOfMonth(raddtDenNgay.Value.GetValueOrDefault()); } catch (Exception ex) { raddtDenNgay.Value = DateTime.Now; raddtTuNgay.Value = LDateTime.GetFirstDateOfMonth(raddtDenNgay.Value.GetValueOrDefault()); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
void LoadDuLieu() { try { string sMaTrangThaiNVu = ucTrangThaiNVu.GetItemsSelected(); if (sMaTrangThaiNVu.Equals("NULL")) { sMaTrangThaiNVu = "(''CDU'',''DDU'',''TCD'',''THD'')"; } #region Điều kiện tìm kiếm RadTreeViewItem item = tvwTaiSan.SelectedItem as RadTreeViewItem; if (item == null) { Mouse.OverrideCursor = Cursors.Arrow; return; } string loaiDonVi = item.Uid.ToString(); string maDonVi = item.Tag.ToString(); #endregion // Phân trang int StartRow = 1; int EndRow = ClientInformation.SoLuongBanGhi; int CurrentPagging = 1; int PaggingSize = ClientInformation.SoLuongBanGhi; DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@INP_MA_TRANG_THAI_NGHIEP_VU", "string", sMaTrangThaiNVu); LDatatable.AddParameter(ref dt, "@INP_SO_HDTC", "string", txtSoHD.Text); LDatatable.AddParameter(ref dt, "@INP_MA_KHANG", "string", txtMaKH.Text); LDatatable.AddParameter(ref dt, "@INP_TEN_KHANG", "string", txtTenKH.Text); LDatatable.AddParameter(ref dt, "@INP_NGAY_HOP_DONG", "string", raddtNgayHopDong.Value == null? "":raddtNgayHopDong.Value.Value.ToString("yyyyMMdd")); LDatatable.AddParameter(ref dt, "@INP_USER", "string", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "string", ClientInformation.MaDonViQuanLy); LDatatable.AddParameter(ref dt, "@MA_NNGU", "string", ClientInformation.NgonNgu); LDatatable.AddParameter(ref dt, "@StartRow", "string", StartRow.ToString()); LDatatable.AddParameter(ref dt, "@EndRow", "string", EndRow.ToString()); DataSet ds = new TaiSanDamBaoProcess().GetDanhSachHopDongTheChapTDTD(dt); if (ds != null && ds.Tables.Count > 0) { grDSTaiSan.DataContext = ds.Tables[0].DefaultView; } else { grDSTaiSan.Items.Clear(); } } catch (System.Exception ex) { LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } finally { Cursor = Cursors.Arrow; } }
public DataSet GetTaiKhoanHachToan(string maDoiTuong, string maDonVi) { TruyVanServiceClient client = null; TruyVanRequest request = null; TruyVanResponse response = null; try { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); client = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService); request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); response = new TruyVanServiceRef.TruyVanResponse(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MA_PHAN_HE", "STRING", DatabaseConstant.Module.TDTT.getValue()); LDatatable.AddParameter(ref dt, "@MA_DTUONG", "STRING", maDoiTuong); LDatatable.AddParameter(ref dt, "@MA_DON_VI", "STRING", maDonVi); request.dtThamSo = dt; request.objectName = "INQ.CT.TD_SAN_PHAM"; request.inquiryName = "TAI_KHOAN_HACH_TOAN"; // make a call to service client here response = client.TruyVanMessage(request); //Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); DataSet ds = response.dsResult; return(ds); } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } finally { if (client.State == CommunicationState.Faulted) { client.Abort(); } else { client.Close(); } client = null; request = null; response = null; } }
public DataSet GetHanMucChiTiet(string maLoaiDTuong, string maDTuong, string module, string tinhNang) { TruyVanServiceClient client = null; TruyVanRequest request = null; TruyVanResponse response = null; try { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); client = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService); request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); response = new TruyVanServiceRef.TruyVanResponse(); //Khởi tạo request DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MA_DTUONG_LOAI", "STRING", maLoaiDTuong); LDatatable.AddParameter(ref dt, "@MA_DTUONG", "STRING", maDTuong); LDatatable.AddParameter(ref dt, "@MODULE", "STRING", module); LDatatable.AddParameter(ref dt, "@TINH_NANG", "STRING", tinhNang); request.dtThamSo = dt; request.objectName = "INQ.DS.HAN_MUC"; request.inquiryName = "CHI_TIET"; // make a call to service client here response = client.TruyVanMessage(request); //Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); DataSet ds = response.dsResult; return(ds); } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } finally { if (client.State == CommunicationState.Faulted) { client.Abort(); } else { client.Close(); } client = null; request = null; response = null; } }
/// <summary> /// Tìm kiếm nâng cao /// </summary> private void TimKiem() { Mouse.OverrideCursor = Cursors.Wait; try { DataTable dt = null; LDatatable.MakeParameterTable(ref dt); // Load dữ liệu lên grid Presentation.Process.HanMucProcess processHanMuc = new HanMucProcess(); if (ucTrangThaiNVu.GetItemsSelected() == "NULL") { LDatatable.AddParameter(ref dt, "@MA_TRANG_THAI_NGHIEP_VU", "STRING", ""); } else { LDatatable.AddParameter(ref dt, "@MA_TRANG_THAI_NGHIEP_VU", "STRING", ucTrangThaiNVu.GetItemsSelected()); } LDatatable.AddParameter(ref dt, "@MA_HAN_MUC", "STRING", txtMaHanMuc.Text); LDatatable.AddParameter(ref dt, "@HMUC_PDUYET_TU", "DECIMAL", telHMPheDuyetTu.Value.Value.ToString()); LDatatable.AddParameter(ref dt, "@HMUC_PDUYET_DEN", "DECIMAL", telHMPheDuyetDen.Value.Value.ToString()); LDatatable.AddParameter(ref dt, "@HMUC_KDUNG_TU", "DECIMAL", telHMKhaDungTu.Value.Value.ToString()); LDatatable.AddParameter(ref dt, "@HMUC_KDUNG_DEN", "DECIMAL", telHMKhaDungDen.Value.Value.ToString()); LDatatable.AddParameter(ref dt, "@MA_KHANG", "STRING", txtMaKhachHang.Text.Trim()); LDatatable.AddParameter(ref dt, "@TEN_KHANG", "STRING", txtTenKhachHang.Text.Trim()); LDatatable.AddParameter(ref dt, "@TEN_DANG_NHAP", "STRING", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dt, "@MA_DON_VI", "STRING", ClientInformation.MaDonVi); LDatatable.AddParameter(ref dt, "@START_ROW", "INT", "0"); LDatatable.AddParameter(ref dt, "@END_ROW", "INT", "0"); Presentation.Process.HanMucProcess process = new Presentation.Process.HanMucProcess(); DataSet ds = process.GetDanhSachHanMuc(dt); if (ds != null && ds.Tables.Count > 0) { grKhachHangDS.ItemsSource = ds.Tables[0].DefaultView; } else { grKhachHangDS.ItemsSource = null; } // Phân trang int StartRow = 1; int EndRow = ClientInformation.SoLuongBanGhi; int CurrentPagging = 1; int PaggingSize = ClientInformation.SoLuongBanGhi; } catch (Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } Mouse.OverrideCursor = Cursors.Arrow; }
/// <summary> /// Tạo mã khách hàng /// </summary> /// <param name="loaiKH"></param> /// <param name="ngayThamGia"></param> /// <returns></returns> private string TaoMaNhomNSD() { DataServices.Utilities.DS_SinhMa process = new DataServices.Utilities.DS_SinhMa(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@TenBang", "STRING", DatabaseConstant.Table.HT_NHNSD.getValue()); LDatatable.AddParameter(ref dt, "@TenTruong", "STRING", "MA_NHNSD"); return(process.TaoMa("MA_NHNSD", dt)); }
/// <summary> /// Tìm kiếm phân trang /// </summary> private void TimKiemPhanTrang() { Mouse.OverrideCursor = Cursors.Wait; DataTable dt = null; LDatatable.MakeParameterTable(ref dt); Mouse.OverrideCursor = Cursors.Arrow; }
private void LoadDuLieu() { Mouse.OverrideCursor = Cursors.Wait; try { NhanSuProcess processNhanSu = new NhanSuProcess(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MA_DVI", "STRING", ClientInformation.MaDonViQuanLy); if (loaiPhuCap.Equals(BusinessConstant.LOAI_PHU_CAP.CO_DINH.layGiaTri())) { dsCoDinh = processNhanSu.GetPhuCapCoDinh(dt); if (dsCoDinh != null && dsCoDinh.Tables.Count > 0) { grCoDinh.DataContext = dsCoDinh.Tables[0].DefaultView; } else { grCoDinh.DataContext = null; } } else if (loaiPhuCap.Equals(BusinessConstant.LOAI_PHU_CAP.BO_SUNG.layGiaTri())) { if (cmbPhuCapCho.SelectedIndex >= 0) { int idNhomCTV = Convert.ToInt32(lstSourcePhuCapCho.ElementAt(cmbPhuCapCho.SelectedIndex).KeywordStrings.ElementAt(1)); LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@MA_DVI", "STRING", ClientInformation.MaDonViQuanLy); LDatatable.AddParameter(ref dt, "@ID_NHOM_CTV", "STRING", idNhomCTV.ToString()); dsBoSung = processNhanSu.GetPhuCapBoSung(dt); if (dsBoSung != null && dsBoSung.Tables.Count > 0) { grBoSung.DataContext = dsBoSung.Tables[0].DefaultView; } else { grBoSung.DataContext = null; } } else { grBoSung.DataContext = null; } } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
private void TongHopDuLieu() { Cursor = Cursors.Wait; try { DataTable dtTongHop = new DataTable(); DataTable dtThamSo = null; TONG_HOP_DU_LIEU objTongHop = new TONG_HOP_DU_LIEU(); LDatatable.MakeParameterTable(ref dtThamSo); List<ClientResponseDetail> lstResponse = new List<ClientResponseDetail>(); if (!Validation()) { foreach (DataRowView dv in raddgrDoiTuongTK.SelectedItems) { if (dtTongHop.Columns.Count == 0) { foreach (DataColumn dc in dv.Row.Table.Columns) { dtTongHop.Columns.Add(dc.ColumnName,dc.DataType); } } dtTongHop.Rows.Add(dv.Row.ItemArray); } AutoCompleteEntry au = lstSourceDonVi.ElementAt(cmbChiNhanh.SelectedIndex); LDatatable.AddParameter(ref dtThamSo, "@MA_DVI_QLY", "String", au.KeywordStrings.FirstOrDefault()); LDatatable.AddParameter(ref dtThamSo, "@TU_NGAY", "String", LDateTime.DateToString(dtTuNgay.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat)); LDatatable.AddParameter(ref dtThamSo, "@NGUOI_THOP", "String", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dtThamSo, "@NGAY_THOP", "String", ClientInformation.NgayLamViecHienTai); dtThamSo.TableName = "ThamSo"; dtTongHop.TableName = "TongHop"; objTongHop.DSACH_THAM_SO = dtThamSo; objTongHop.DSACH_TONG_HOP = dtTongHop; if (ApplicationConstant.ResponseStatus.THANH_CONG == new KeToanProcess().TongHopDuLieu(DatabaseConstant.Function.KT_TONG_HOP_DS, DatabaseConstant.Action.TONG_HOP, ref objTongHop, ref lstResponse)) { Cursor = Cursors.Arrow; LMessage.ShowMessage("Tổng hợp dữ liệu thành công", LMessage.MessageBoxType.Information); } else { Cursor = Cursors.Arrow; LMessage.ShowMessage("Tổng hợp dữ liệu không thành công", LMessage.MessageBoxType.Error); } } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); LMessage.ShowMessage("Tổng hợp dữ liệu không thành công", LMessage.MessageBoxType.Error); } finally { Cursor = Cursors.Arrow; } }
private void SetFormData() { Mouse.OverrideCursor = Cursors.Wait; //lstTSDB = new List<TDTD_TAI_SAN_DAM_BAO>(); try { DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@INP_IDHDTC", "string", idHDTC.ToString()); DataSet ds = new TaiSanDamBaoProcess().GetHopDongTheChapTDTD(dt); if (!ds.IsNullOrEmpty() && ds.Tables.Count > 1) { dt = ds.Tables[0]; idHDTC = Convert.ToInt32(dt.Rows[0]["ID"]); txtSoHopDong.Text = dt.Rows[0]["MA_HDTC"].ToString(); txtMaKH.Text = dt.Rows[0]["MA_KHANG"].ToString(); lblTTinKHang.Content = dt.Rows[0]["TEN_KHANG"].ToString(); teldtNgayCNhat.Value = LDateTime.StringToDate(dt.Rows[0]["NGAY_HDTC"].ToString(), ApplicationConstant.defaultDateTimeFormat); txtDienGiai.Text = dt.Rows[0]["DIEN_GIAI"].ToString(); tThai_NVu = dt.Rows[0]["TTHAI_NVU"].ToString(); lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(tThai_NVu); maDviQLy = dt.Rows[0]["MA_DVI_QLY"].ToString(); maDViTao = dt.Rows[0]["MA_DVI_TAO"].ToString(); txtNguoiLap.Text = dt.Rows[0]["NGUOI_NHAP"].ToString(); if (dt.Rows[0]["NGUOI_CNHAT"] != DBNull.Value) { txtNguoiCapNhat.Text = dt.Rows[0]["NGUOI_CNHAT"].ToString(); } teldtNgayNhap.Value = LDateTime.StringToDate(dt.Rows[0]["NGAY_NHAP"].ToString(), ApplicationConstant.defaultDateTimeFormat); if (dt.Rows[0]["NGAY_CNHAT"] != DBNull.Value) { teldtNgayCNhat.Value = LDateTime.StringToDate(dt.Rows[0]["NGAY_CNHAT"].ToString(), ApplicationConstant.defaultDateTimeFormat); } txtTrangThai.Text = BusinessConstant.layNgonNguSuDung(dt.Rows[0]["TTHAI_BGHI"].ToString()); dt = ds.Tables[1]; lstTSDB = dt.Rows.OfType <DataRow>().ToList(); raddgrDSachTSDB.ItemsSource = null; raddgrDSachTSDB.ItemsSource = lstTSDB; SetGtriTong(lstTSDB); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
public DataSet GetDanhSachHoTro(string maDangNhap, string maPhanHe) { TruyVanServiceClient client = null; TruyVanRequest request = null; TruyVanResponse response = null; try { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TruyVanService.layGiaTri()); client = TruyVanServiceClient(ApplicationConstant.SystemService.TruyVanService); request = Common.Utilities.PrepareRequest(new TruyVanServiceRef.TruyVanRequest()); response = new TruyVanServiceRef.TruyVanResponse(); //Khởi tạo request DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@NSD", "STRING", maDangNhap); LDatatable.AddParameter(ref dt, "@MA_PHAN_HE", "STRING", maPhanHe); request.dtThamSo = dt; request.objectName = "INQ.HO_TRO"; request.inquiryName = "DANH_SACH"; // make a call to service client here response = client.TruyVanMessage(request); //Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); DataSet ds = response.dsResult; return(ds); } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } finally { if (client.State == CommunicationState.Faulted) { client.Abort(); } else { client.Close(); } client = null; request = null; response = null; } }
private void LoadGrid() { Cursor = Cursors.Wait; try { #region Điều kiện tìm kiếm RadTreeViewItem item = tvwKhuVuc.SelectedItem as RadTreeViewItem; string loaiDonVi = item.Uid.ToString(); string maDonVi = item.Tag.ToString(); #endregion DanhMucProcess danhMucProcess = new DanhMucProcess(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@USER_NAME", "String", ClientInformation.TenDangNhap); LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy); LDatatable.AddParameter(ref dt, "@MA", "String", maDonVi); LDatatable.AddParameter(ref dt, "@LOAI", "String", loaiDonVi); DataSet ds = danhMucProcess.getDanhSachKhuVuc01(dt); if (ds != null && ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ds.Tables[0].Rows[i]["TTHAI_NVU"] = BusinessConstant.layNgonNguNghiepVu(ds.Tables[0].Rows[i]["TTHAI_NVU"].ToString()); } grKhuVucDS.DataContext = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count > 0) { lblTongSo.Content = ds.Tables[0].Rows.Count; } else { lblTongSo.Content = "0"; } } else { grKhuVucDS.Items.Clear(); lblTongSo.Content = 0; } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
/// <summary> /// Lấy dữ liệu theo mã truy vấn và không có tham số /// </summary> /// <param name="maTruyVan"></param> /// <returns></returns> public DataSet TruyVan(string maTruyVan) { DataTable dt = null; DataSet ds = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "", "", ""); ds = Client.TruyVan(maTruyVan, dt); return(ds); }