private void LayDuLieu() { Mouse.OverrideCursor = Cursors.Wait; try { if (txtMaGiaoDich.Text.IsNullOrEmptyOrSpace()) { return; } 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); DataSet ds = new HoTroProcess().LayDuLieu(dataQueryGet, dt); if (KiemTraDuLieuTraVe(ds) == 0) { ClearForm(); return; } if (ds != null && ds.Tables.Count > 1) { txtSoSoTG.Text = ds.Tables[1].Rows[0]["SO_SO_TG"].ToString(); raddtNgayGiaoDich.Value = LDateTime.StringToDate(ds.Tables[1].Rows[0]["NGAY_GDICH"].ToString(), "yyyyMMdd"); raddtNgayChuyenDen.Value = LDateTime.StringToDate(ds.Tables[1].Rows[0]["NGAY_GDICH"].ToString(), "yyyyMMdd"); txtDienGiai.Text = ds.Tables[1].Rows[0]["DIEN_GIAI"].ToString(); txtMaKhachHang.Text = ds.Tables[1].Rows[0]["MA_KHANG"].ToString(); txtTenKhachHang.Text = ds.Tables[1].Rows[0]["TEN_KHANG"].ToString(); numSoDu.Value = Convert.ToDouble(ds.Tables[1].Rows[0]["SO_DU"]); numSoTienGuiThem.Value = Convert.ToDouble(ds.Tables[1].Rows[0]["SO_TIEN_GUI_THEM"]); } else { ClearForm(); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); CommonFunction.ThongBaoLoi(ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
private void LayDuLieu() { Mouse.OverrideCursor = Cursors.Wait; try { if (txtMaGiaoDich.Text.IsNullOrEmptyOrSpace()) { return; } 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); DataSet ds = new HoTroProcess().LayDuLieu(dataQueryGet, dt); if (KiemTraDuLieuTraVe(ds) == 0) { ClearForm(); return; } if (ds != null && ds.Tables.Count > 2) { raddtNgayGiaoDich.Value = LDateTime.StringToDate(ds.Tables[1].Rows[0]["NGAY_GDICH"].ToString(), "yyyyMMdd"); txtDienGiai.Text = ds.Tables[1].Rows[0]["DIEN_GIAI"].ToString(); grDuChiDS.ItemsSource = ds.Tables[2].DefaultView; } else { ClearForm(); } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); CommonFunction.ThongBaoLoi(ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
private void LayDuLieu() { Mouse.OverrideCursor = Cursors.Wait; try { if (txtMaGiaoDich.Text.IsNullOrEmptyOrSpace()) { return; } DataTable dt = null; LDatatable.MakeParameterListTable(ref dt); LDatatable.AddParameterList(ref dt, "MA_NSD", ClientInformation.TenDangNhap); LDatatable.AddParameterList(ref dt, "MA_GDICH", txtMaGiaoDich.Text); DataSet ds = new HoTroProcess().LayDuLieu(dataQueryGet, dt); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { raddtNgayGiaoDich.Value = LDateTime.StringToDate(ds.Tables[0].Rows[0]["NGAY_GDICH"].ToString(), "yyyyMMdd"); txtDienGiai.Text = ds.Tables[0].Rows[0]["DIEN_GIAI"].ToString(); string maDonVi = ds.Tables[0].Rows[0]["MA_DVI"].ToString(); string maNguonVon = ds.Tables[0].Rows[0]["NV_LOAI_NVON"].ToString(); LoadComboBoxNguonVon(maDonVi); cmbNguonVon.SelectedIndex = lstSourceNguonVon.IndexOf(lstSourceNguonVon.FirstOrDefault(i => i.KeywordStrings.First().Equals(maNguonVon))); raddgrHachToan.ItemsSource = ds.Tables[0].DefaultView; } else { raddgrHachToan.ItemsSource = null; } } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); CommonFunction.ThongBaoLoi(ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }
private void tlbProcess_Click(object sender, RoutedEventArgs e) { try { Mouse.OverrideCursor = Cursors.Wait; // Lấy dữ liệu từ form điều kiện DatabaseConstant.Action action = DatabaseConstant.Action.IN; MethodInfo mi; if (uc != null) { mi = uc.GetType().GetMethod("GetParameters"); } else { Mouse.OverrideCursor = Cursors.Arrow; LMessage.ShowMessage("Chưa chọn vấn đề cần thao tác", LMessage.MessageBoxType.Error); return; } object ret = mi.Invoke(uc, null); DataTable dt = null; if (ret != null) { dt = (DataTable)ret; } else { Mouse.OverrideCursor = Cursors.Arrow; return; } DataSet ds = new HoTroProcess().ThucHien(dataQuerySet, dt); if (ds != null && ds.Tables.Count > 0) { int i = ds.Tables.Count; string kq = ds.Tables[i - 1].Rows[0][0].ToString(); if (kq == "THANH_CONG") { LMessage.ShowMessage("Xử lý thành công", LMessage.MessageBoxType.Information); } else { CommonFunction.ThongBaoKetQua(ds.Tables[i - 1]); } } else { LMessage.ShowMessage("Xử lý không thành công", LMessage.MessageBoxType.Warning); } } catch (System.Exception ex) { Mouse.OverrideCursor = Cursors.Arrow; CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } finally { Mouse.OverrideCursor = Cursors.Arrow; } }