private void GetFormData() { lstSourceCanBoTD = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); maphonggd = lstSourcePhongGD.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); tungay = LDateTime.DateToString((DateTime)raddtTuNgay.Value, ApplicationConstant.defaultDateTimeFormat); denngay = LDateTime.DateToString((DateTime)raddtDenNgay.Value, ApplicationConstant.defaultDateTimeFormat); ngaybaocao = ClientInformation.NgayLamViecHienTai; ngonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); dinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); tenchinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; foreach (DataRowView drv in radgrdKVSP.SelectedItems) { maCanBo = drv["MA"].ToString(); tenCanBo = drv["TEN"].ToString(); break; } }
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("@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())); // Chuẩn bị điều kiện cho báo cáo if (listThamSoBaoCao != null && listThamSoBaoCao.Count > 0) { 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; } } } } 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 { } }
void btnThemTyGia_Click(object sender, RoutedEventArgs e) { AutoCompleteEntry auLoaiTyGia = lstSourceLoaiTyGia.ElementAt(cbbLoaiTyGia.SelectedIndex); AutoCompleteEntry auHinhThucTyGia = lstSourceHinhThucNiemYet.ElementAt(cbbHinhThucNiemYet.SelectedIndex); AutoCompleteEntry auLoaiTien = lstSourceLoaiTien.ElementAt(cbbMaTienTe.SelectedIndex); DANH_SACH_TY_GIA_CT objTyGiaCT = new DANH_SACH_TY_GIA_CT(); List <DANH_SACH_TY_GIA_CT> lstTyGiaCT = new List <DANH_SACH_TY_GIA_CT>(); objTyGiaCT.ID_TY_GIA_CT = 0; objTyGiaCT.LOAI_TY_GIA = auLoaiTyGia.KeywordStrings.FirstOrDefault(); objTyGiaCT.HINH_THUC_NIEM_YET = auHinhThucTyGia.KeywordStrings.FirstOrDefault(); objTyGiaCT.MA_DVI_QLY = ClientInformation.MaDonViQuanLy; objTyGiaCT.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich; objTyGiaCT.MA_LOAI_TIEN = auLoaiTien.KeywordStrings.FirstOrDefault(); objTyGiaCT.NGAY_AP_DUNG = LDateTime.DateToString(raddtNgayApDung.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat); objTyGiaCT.NGAY_NHAP = ClientInformation.NgayLamViecHienTai; objTyGiaCT.NGUOI_NHAP = ClientInformation.TenDangNhap; objTyGiaCT.TEN_LOAI_TIEN = auLoaiTien.DisplayName; objTyGiaCT.TTHAI_DL = "T"; objTyGiaCT.TY_GIA_BAN = (decimal)txtTyGiaBan.Value.GetValueOrDefault(); objTyGiaCT.TY_GIA_BQUAN = (decimal)txtTyGiaBinhQuan.Value.GetValueOrDefault(); objTyGiaCT.TY_GIA_MUA = (decimal)txtTyGiaMua.Value.GetValueOrDefault(); objTyGiaCT.TRANG_THAI_BAN_GHI = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(); objTyGiaCT.TRANG_THAI_NGHIEP_VU = BusinessConstant.TrangThaiNghiepVu.CHO_DUYET.layGiaTri(); if (LObject.IsNullOrEmpty(raddgrDSTyGia.ItemsSource)) { lstTyGiaCT.Add(objTyGiaCT); } else { lstTyGiaCT = raddgrDSTyGia.ItemsSource as List <DANH_SACH_TY_GIA_CT>; int icount = lstTyGiaCT.Where(f => f.HINH_THUC_NIEM_YET == objTyGiaCT.HINH_THUC_NIEM_YET && !f.TRANG_THAI_NGHIEP_VU.Equals(BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri())).Count(); if (icount > 0) { return; } else { lstTyGiaCT.Add(objTyGiaCT); } } raddgrDSTyGia.ItemsSource = lstTyGiaCT; raddgrDSTyGia.Rebind(); }
private void GetFormValues() { lstChiNhanh = new List <string>(); lstNguonVon = new List <string>(); foreach (AutoCompleteCheckBox auChiNhanh in lstSourceChiNhanh) { if (auChiNhanh.CheckedMember) { lstChiNhanh.Add(auChiNhanh.ValueMember[0]); } } foreach (AutoCompleteCheckBox auNguonVon in lstSourceNguonVon) { if (auNguonVon.CheckedMember) { lstNguonVon.Add(auNguonVon.ValueMember[0]); } } machinhanh = ""; ngayChotDLieu = LDateTime.DateToString((DateTime)raddtThangChot.Value, ApplicationConstant.defaultDateTimeFormat); ngaydaunam = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetFirstDateOfYear().ToString(ApplicationConstant.defaultDateTimeFormat); ngaybaocao = LDateTime.DateToString((DateTime)raddtNgayBaoCao.Value, ApplicationConstant.defaultDateTimeFormat); mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); tenchinhanh = ""; dinhKyBC = cmbDinhKy.SelectedValue.ToString(); quyBCao = radQuyBaoCao.Value.ToString(); if (dinhKyBC.Equals("THANG")) { tungay = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetFirstDateOfMonth().ToString(ApplicationConstant.defaultDateTimeFormat); ngayChotDLieu = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetLastDateOfMonth().ToString(ApplicationConstant.defaultDateTimeFormat); } else if (dinhKyBC.Equals("QUY")) { tungay = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetFirstDateOfQuarter().ToString(ApplicationConstant.defaultDateTimeFormat); ngayChotDLieu = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetLastDateOfQuarter().ToString(ApplicationConstant.defaultDateTimeFormat); } else if (dinhKyBC.Equals("NAM")) { tungay = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetFirstDateOfYear().ToString(ApplicationConstant.defaultDateTimeFormat); ngayChotDLieu = ngayChotDLieu.StringToDate(ApplicationConstant.defaultDateTimeFormat).GetLastDateOfYear().ToString(ApplicationConstant.defaultDateTimeFormat); } }
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (LObject.IsNullOrEmpty(value)) { return(null); } else { if (typeof(DateTime).Equals(value.GetType())) { return(LDateTime.DateToString(System.Convert.ToDateTime(value), ApplicationConstant.defaultDateTimeFormat)); } else { return(null); } } }
public List <ThamSoBaoCao> GetParameters() { List <ThamSoBaoCao> listThamSoBaoCao = new List <ThamSoBaoCao>(); try { if (!Validation()) { return(null); } AutoCompleteEntry auChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex); AutoCompleteEntry auBaoCao = listBaoCao.ElementAt(cmbLoaiBieu.SelectedIndex); AutoCompleteEntry auPhongGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.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_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("@NgayInBCao", LDateTime.DateToString(raddtNgayBaoCao.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat), ApplicationConstant.LoaiThamSoBaoCao.SQL.layGiaTri(), new List <string>(), table.DataSet)); 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("@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())); 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); }
private void LoadDuLieu() { try { KeToanProcess process = new KeToanProcess(); string maDonVi = "(''" + cmbDonVi.SelectedItem.Value + "'',"; maDonVi = maDonVi.Substring(0, maDonVi.Length - 1) + ")"; string ngayDL = ""; if (teldtSoDuNgay.Text != "") { ngayDL = LDateTime.DateToString(LDateTime.StringToDate(teldtSoDuNgay.Text, "dd/MM/yyyy"), ApplicationConstant.defaultDateTimeFormat); } string ListMaPloai = ""; foreach (TreeNode item in tvwPhanLoai.CheckedNodes) { ListMaPloai += "''" + item.Value.ToString() + "'',"; } if (ListMaPloai.Length > 0) { ListMaPloai = "(" + ListMaPloai.Substring(0, ListMaPloai.Length - 1) + ")"; } DataTable dtThamSo = null; LDatatable.MakeParameterTable(ref dtThamSo); LDatatable.AddParameter(ref dtThamSo, "@MaDonVi", "STRING", maDonVi); LDatatable.AddParameter(ref dtThamSo, "@MaPhanLoai", "STRING", ListMaPloai); LDatatable.AddParameter(ref dtThamSo, "@MaTK", "STRING", txtMaPhanLoaiTK.Text); LDatatable.AddParameter(ref dtThamSo, "@TenTK", "STRING", ""); LDatatable.AddParameter(ref dtThamSo, "@NgayDL", "STRING", ngayDL); LDatatable.AddParameter(ref dtThamSo, "@SoDuTu", "DECIMAL", "0"); LDatatable.AddParameter(ref dtThamSo, "@SoDuDen", "DECIMAL", "0"); LDatatable.AddParameter(ref dtThamSo, "@TinhChat", "STRING", ""); grdTaiKhoanDS.DataSource = process.getDanhSachTaiKhoanChiTiet(dtThamSo, "DANH_SACH"); grdTaiKhoanDS.DataBind(); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void GetValuesOnForm() { lstIdKhachHang = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); idKhuVuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[1]; idCum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings[1]; idNhom = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex).KeywordStrings[1]; manhom = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex).KeywordStrings[0]; macum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings[0]; makhuvuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[0]; mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); ngaybaocao = LDateTime.DateToString(Convert.ToDateTime(raddtNgayBaoCao.Value), ApplicationConstant.defaultDateTimeFormat); foreach (DataRowView drv in grdKhachHang.SelectedItems) { lstIdKhachHang.Add(drv["ID"].ToString()); _idKhachHang = Convert.ToInt32(drv["ID"]); } if (lstIdKhachHang.Count > 0) { KhachHangProcess khProcess = new KhachHangProcess(); dsKhachHang = khProcess.getThongTinKHTheoID(_idKhachHang); DataTable dtKhangHSo = null; if (dsKhachHang != null && dsKhachHang.Tables.Count > 0) { dtKhangHSo = dsKhachHang.Tables[0]; tenkhachhang = dtKhangHSo.Rows[0]["TEN_KHANG"].ToString(); makhachhang = dtKhangHSo.Rows[0]["MA_KHANG"].ToString(); diachi = dtKhangHSo.Rows[0]["DIA_CHI"].ToString(); gioitinh = dtKhangHSo.Rows[0]["DD_GIOI_TINH"].ToString(); ngaysinh = dtKhangHSo.Rows[0]["DD_NGAY_SINH"].ToString(); socmnd = dtKhangHSo.Rows[0]["DD_GTLQ_SO"].ToString(); ngaycap = dtKhangHSo.Rows[0]["DD_GTLQ_NGAY_CAP"].ToString(); noicap = dtKhangHSo.Rows[0]["DD_GTLQ_NOI_CAP"].ToString(); sosohokhau = dtKhangHSo.Rows[0]["SO_HO_KHAU"].ToString(); } } }
private DM_KHU_VUC GetDataForm(BusinessConstant.TrangThaiNghiepVu nghiepvu, BusinessConstant.TrangThaiSuDung sudung) { DM_KHU_VUC obj = new DM_KHU_VUC(); DataSet dsDVi = new DanhMucProcess().getDonViTheoMa(lstSourcePGD.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings[0]); obj.ID = idKhuVuc; obj.ID_DVI = Convert.ToInt32(dsDVi.Tables[0].Rows[0]["ID"]); obj.MA_DVI = lstSourcePGD.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.FirstOrDefault(); obj.MA_DVI_QLY = ClientInformation.MaDonVi; obj.MA_DVI_TAO = lstSourcePGD.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.FirstOrDefault(); obj.MA_KVUC = txtMaKhuVuc.Text; obj.TEN_KVUC = txtTenKhuVuc.Text; obj.TEN_TAT = txtTenTat.Text; obj.TTHAI_NVU = nghiepvu.layGiaTri(); obj.TTHAI_BGHI = sudung.layGiaTri(); obj.NGAY_CNHAT = idKhuVuc > 0 ? ClientInformation.NgayLamViecHienTai : ""; obj.NGUOI_CNHAT = idKhuVuc > 0 ? ClientInformation.TenDangNhap : ""; obj.NGAY_NHAP = idKhuVuc == 0 ? ClientInformation.NgayLamViecHienTai : LDateTime.DateToString(txtNgayLap.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat); obj.NGUOI_NHAP = idKhuVuc == 0 ? ClientInformation.TenDangNhap : txtNguoiLap.Text; return(obj); }
private void GetFormData() { lstNguonVon = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First(); manguoiqly = lstSourceNguoiQLy.ElementAt(cmbTieuChiLoc.SelectedIndex).KeywordStrings.First(); tungay = LDateTime.DateToString((DateTime)raddtTuNgay.Value, ApplicationConstant.defaultDateTimeFormat); denngay = LDateTime.DateToString((DateTime)raddtDenNgay.Value, ApplicationConstant.defaultDateTimeFormat); ngaytinhlke = LDateTime.DateToString((DateTime)raddtNgayTinhLKe.Value, ApplicationConstant.defaultDateTimeFormat); ngaybaocao = ClientInformation.NgayLamViecHienTai; ngonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.First(); dinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.First(); tenchinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).DisplayName; tennguoiqly = lstSourceNguoiQLy.ElementAt(cmbTieuChiLoc.SelectedIndex).DisplayName; foreach (AutoCompleteCheckBox auNguonVon in lstSourceNguonVon) { if (auNguonVon.CheckedMember) { lstNguonVon.Add(auNguonVon.ValueMember[0]); } } }
private void GetValuesOnForm() { lstMaDXVV = new List <string>(); machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.FirstOrDefault(); maphonggd = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.FirstOrDefault(); idKhuVuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[1]; idCum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings[1]; idNhom = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex).KeywordStrings[1]; manhom = lstSourceNhom.ElementAt(cmbNhom.SelectedIndex).KeywordStrings[0]; macum = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings[0]; makhuvuc = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[0]; mangonngu = lstSourceNgonNgu.ElementAt(cmbNgonNgu.SelectedIndex).KeywordStrings.FirstOrDefault(); madinhdang = lstSourceDinhDang.ElementAt(cmbDinhDang.SelectedIndex).KeywordStrings.FirstOrDefault(); ngaybaocao = LDateTime.DateToString(Convert.ToDateTime(raddtNgayBaoCao.Value), ApplicationConstant.defaultDateTimeFormat); ngayHienThi = Convert.ToDateTime(raddtNgayBaoCao.Value).ToLongDateString(); foreach (DataRowView drv in grdDXVV.SelectedItems) { lstMaDXVV.Add(drv["MA_DXVVVM"].ToString()); maDXVV = drv["MA_DXVVVM"].ToString(); } }
private void LayDuLieu() { Cursor = Cursors.Wait; try { string idKhuVuc = "0"; string _namTruoc = ""; _namDL = LDateTime.DateToString(raddtNamLichThuPhat.Value.GetValueOrDefault(), "yyyy"); if (chkDuLieuNamTruoc.IsChecked.GetValueOrDefault()) { _namTruoc = LDateTime.DateToString(raddtNamLichThuPhat.Value.GetValueOrDefault().AddYears(-1), "yyyy"); } if (tvwKhuVuc.SelectedItem == null) { tvwKhuVuc.SelectedItem = tvwKhuVuc.Items[0]; } RadTreeViewItem item = tvwKhuVuc.SelectedItem as RadTreeViewItem; if (item.Tag.ToString().Substring(0, 3) == "KVU") { idKhuVuc = item.Tag.ToString().Substring(3); } SetDataControl(); DataTable dt = null; LDatatable.MakeParameterTable(ref dt); LDatatable.AddParameter(ref dt, "@INP_ID_KVUC", "string", idKhuVuc); LDatatable.AddParameter(ref dt, "@INP_NAM_DL", "string", _namDL); LDatatable.AddParameter(ref dt, "@INP_NAM_TRUOC", "string", _namTruoc); DataSet ds = new TinDungProcess().GetThongTinDatLichThuPhatVon(dt); if (!LObject.IsNullOrEmpty(ds) && ds.Tables.Count > 0) { dt = ds.Tables["CHI_TIET"]; if (!LObject.IsNullOrEmpty(dt) && dt.Rows.Count > 0) { List <CUM_LICH> lstCumFull = new List <CUM_LICH>(); foreach (DataRow dr in dt.Rows) { CUM_LICH objCum = new CUM_LICH(); objCum.ID = Convert.ToInt32(dr["ID"]); objCum.ID_CUM = Convert.ToInt32(dr["ID_CUM"]); objCum.ID_KVUC = Convert.ToInt32(dr["ID_KVUC"]); objCum.MA_CUM = dr["MA_CUM"].ToString(); objCum.TEN_CUM = dr["TEN_CUM"].ToString(); objCum.MA_LOAI_LICH = dr["MA_LOAI_LICH"].ToString(); objCum.NAM = dr["NAM"].ToString(); objCum.JAN = dr["JAN"].ToString(); objCum.FEB = dr["FEB"].ToString(); objCum.MAR = dr["MAR"].ToString(); objCum.APR = dr["APR"].ToString(); objCum.MAY = dr["MAY"].ToString(); objCum.JUN = dr["JUN"].ToString(); objCum.JUL = dr["JUL"].ToString(); objCum.AUG = dr["AUG"].ToString(); objCum.SEP = dr["SEP"].ToString(); objCum.OCT = dr["OCT"].ToString(); objCum.NOV = dr["NOV"].ToString(); objCum.DEC = dr["DEC"].ToString(); objCum.TTHAI_BGHI = dr["TTHAI_BGHI"].ToString(); objCum.TTHAI_NVU = dr["TTHAI_NVU"].ToString(); objCum.MA_DVI_QLY = dr["MA_DVI_QLY"].ToString(); objCum.MA_DVI_TAO = dr["MA_DVI_TAO"].ToString(); objCum.NGAY_NHAP = dr["NGAY_NHAP"].ToString(); objCum.NGUOI_NHAP = dr["NGUOI_NHAP"].ToString(); objCum.NGAY_CNHAT = dr["NGAY_CNHAT"].ToString(); objCum.NGUOI_CNHAT = dr["NGUOI_CNHAT"].ToString(); lstCumFull.Add(objCum); } lstPhatVon = lstCumFull.Where(f => f.MA_LOAI_LICH == "PHAT_VON").ToList(); lstThuVon = lstCumFull.Where(f => f.MA_LOAI_LICH == "THU_VON").ToList(); } else { lstPhatVon = new List <CUM_LICH>(); lstThuVon = new List <CUM_LICH>(); } radDanhSachLichPhat.ItemsSource = lstPhatVon; radDanhSachLichThu.ItemsSource = lstThuVon; radDanhSachLichPhat.Rebind(); radDanhSachLichThu.Rebind(); } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } finally { Cursor = Cursors.Arrow; } }
void ucThuControl_SelectedDatesGridViewChanged(object sender, CustomControl.SelectedDatesChangedGridViewEventArgs e) { CUM_LICH objCumLich = e.Cell.ParentRow.Item as CUM_LICH; string ValuesString = ""; foreach (DateTime datetime in e.NewDates.OrderBy(f => f)) { ValuesString += ";" + LDateTime.DateToString(datetime, "dd"); } if (ValuesString.Length > 1) { ValuesString = ValuesString.Substring(1); } int index = lstThuVon.IndexOf(objCumLich); if (e.Cell.Column.UniqueName == "THANGTHU_1") { objCumLich.JAN = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_2") { objCumLich.FEB = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_3") { objCumLich.MAR = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_4") { objCumLich.APR = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_5") { objCumLich.MAY = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_6") { objCumLich.JUN = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_7") { objCumLich.JUL = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_8") { objCumLich.AUG = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_9") { objCumLich.SEP = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_10") { objCumLich.OCT = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_11") { objCumLich.NOV = ValuesString; } else if (e.Cell.Column.UniqueName == "THANGTHU_12") { objCumLich.DEC = ValuesString; } lstThuVon[index] = objCumLich; }
private void LoadDuLieu() { try { TinDungProcess tindungProcess = new TinDungProcess(); string maDonVi = cmbDonVi.SelectedItem.Value;// "0001";// lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.ElementAt(0); string MaTTNVu = ""; if (cbChoduyet.Checked) { MaTTNVu = MaTTNVu + "''" + cbChoduyet.Value + "'',"; } if (cbDaduyet.Checked) { MaTTNVu = MaTTNVu + "''" + cbDaduyet.Value + "'',"; } if (cbThoaiduyet.Checked) { MaTTNVu = MaTTNVu + "''" + cbThoaiduyet.Value + "'',"; } if (cbDaduyet.Checked) { MaTTNVu = MaTTNVu + "''" + cbDaduyet.Value + "'',"; } if (MaTTNVu != "") { MaTTNVu = "(" + MaTTNVu.Substring(0, MaTTNVu.Length - 1) + ")"; } string MaLoaiSP = cmbLoaiSanPham.SelectedItem.Value; //lstLoaiSanPham.ElementAt(cmbLoaiSanPham.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaTinhTrangHLuc = cmbTinhTrang.SelectedItem.Value; // lstHieuLuc.ElementAt(cmbTinhTrang.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaMucDichVay = cmbMucDich.SelectedItem.Value; //lstMucDichSuDung.ElementAt(cmbMucDich.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaNguonVon = cmbLoaiVay.SelectedItem.Value; // lstNguonVon.ElementAt(cmbLoaiVay.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaPhuongThucTinhLai = cmbPhuongThucTinhLai.SelectedItem.Value; // lstPhuongThucTinhLai.ElementAt(cmbPhuongThucTinhLai.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaLoaiLSuat = cmbLoaiLaiSuat.SelectedItem.Value; //lstLoaiLaiSuat.ElementAt(cmbLoaiLaiSuat.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaSanPham = txtMaSanPham.Text; string TenSanPham = txtTenSanPham.Text; string NgayADungTu = ""; if (teldtNgayADungTu.Text != "") { NgayADungTu = LDateTime.DateToString(LDateTime.StringToDate(teldtNgayADungTu.Text, "dd/MM/yyyy"), ApplicationConstant.defaultDateTimeFormat); } string NgayADungDen = ""; if (teldtNgayADungDen.Text != "") { NgayADungDen = LDateTime.DateToString(LDateTime.StringToDate(teldtNgayADungDen.Text, "dd/MM/yyyy"), ApplicationConstant.defaultDateTimeFormat); } string NgayHetHanTu = ""; if (teldtNgayHetHanTu.Text != "") { NgayHetHanTu = LDateTime.DateToString(LDateTime.StringToDate(teldtNgayHetHanTu.Text, "dd/MM/yyyy"), ApplicationConstant.defaultDateTimeFormat); } string NgayHetHanDen = ""; if (teldtNgayHetHanDen.Text != "") { NgayHetHanDen = LDateTime.DateToString(LDateTime.StringToDate(teldtNgayHetHanDen.Text, "dd/MM/yyyy"), ApplicationConstant.defaultDateTimeFormat); } string UserName = ""; string ListPThucVay = ""; foreach (TreeNode item in tvwLoaiVay.CheckedNodes) { ListPThucVay += ",''" + item.Value.ToString() + "''"; } if (ListPThucVay.Length > 0) { ListPThucVay = "(" + ListPThucVay.Substring(1) + ")"; } grdDangKySanPhamDS.DataSource = tindungProcess.getDanhSachSanPhamTinDung(MaTTNVu, MaLoaiSP, MaTinhTrangHLuc, MaMucDichVay, MaNguonVon, MaPhuongThucTinhLai, MaLoaiLSuat, MaSanPham, TenSanPham, NgayADungTu, NgayADungDen, NgayHetHanTu, NgayHetHanDen, ListPThucVay, UserName, maDonVi).Tables["DANH_SACH"]; grdDangKySanPhamDS.DataBind(); // grdDangKySanPhamDS.DataSource = _mdata; // TotalRecords = _mdata.Rows.Count; // ClonePageData(_mdata, pagenumber, pagesize); // // .DefaultView; //// //if (!LObject.IsNullOrEmpty(grdDangKySanPhamDS.SelectedItems)) // // grdDangKySanPhamDS.SelectedItems.Clear(); // grdDangKySanPhamDS.DataSource = _mpageData; // pages1.TotalRecords = currentPage1.TotalRecords = TotalRecords; // currentPage1.TotalPages = pages1.CalculateTotalPages(); // currentPage1.PageIndex = pages1.PageIndex; } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void LoadDuLieu() { Cursor = Cursors.Wait; try { TinDungProcess tindungProcess = new TinDungProcess(); maDonVi = lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.ElementAt(0); string MaTTNVu = ucCheckBoxList.GetItemsSelected(); string MaLoaiSP = lstLoaiSanPham.ElementAt(cmbLoaiSanPham.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaTinhTrangHLuc = lstHieuLuc.ElementAt(cmbTinhTrang.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaMucDichVay = lstMucDichSuDung.ElementAt(cmbMucDich.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaNguonVon = lstNguonVon.ElementAt(cmbLoaiVay.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaPhuongThucTinhLai = lstPhuongThucTinhLai.ElementAt(cmbPhuongThucTinhLai.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaLoaiLSuat = lstLoaiLaiSuat.ElementAt(cmbLoaiLaiSuat.SelectedIndex).KeywordStrings.FirstOrDefault(); string MaSanPham = txtMaSanPham.Text; string TenSanPham = txtTenSanPham.Text; string NgayADungTu = ""; if (teldtNgayADungTu.Value != null) { NgayADungTu = LDateTime.DateToString((DateTime)teldtNgayADungTu.Value, ApplicationConstant.defaultDateTimeFormat); } string NgayADungDen = ""; if (teldtNgayADungDen.Value != null) { NgayADungDen = LDateTime.DateToString((DateTime)teldtNgayADungDen.Value, ApplicationConstant.defaultDateTimeFormat); } string NgayHetHanTu = ""; if (teldtNgayHetHanTu.Value != null) { NgayHetHanTu = LDateTime.DateToString((DateTime)teldtNgayHetHanTu.Value, ApplicationConstant.defaultDateTimeFormat); } string NgayHetHanDen = ""; if (teldtNgayHetHanDen.Value != null) { NgayHetHanDen = LDateTime.DateToString((DateTime)teldtNgayHetHanDen.Value, ApplicationConstant.defaultDateTimeFormat); } string ListPThucVay = ""; foreach (RadTreeViewItem item in tvwLoaiVay.CheckedItems) { ListPThucVay += ",''" + item.Tag.ToString() + "''"; } if (ListPThucVay.Length > 0) { ListPThucVay = "(" + ListPThucVay.Substring(1) + ")"; } string UserName = ""; DataSet ds = tindungProcess.getDanhSachSanPhamTinDung(MaTTNVu, MaLoaiSP, MaTinhTrangHLuc, MaMucDichVay, MaNguonVon, MaPhuongThucTinhLai, MaLoaiLSuat, MaSanPham, TenSanPham, NgayADungTu, NgayADungDen, NgayHetHanTu, NgayHetHanDen, ListPThucVay, UserName, maDonVi); if (ds != null && ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables["DANH_SACH"].Rows) { dr["TEN_TTHAI_NVU"] = BusinessConstant.layNgonNguNghiepVu(dr["TTHAI_NVU"].ToString()); } grdDangKySanPhamDS.ItemsSource = ds.Tables["DANH_SACH"].DefaultView; if (!LObject.IsNullOrEmpty(grdDangKySanPhamDS.SelectedItems)) { grdDangKySanPhamDS.SelectedItems.Clear(); } } } catch (Exception ex) { LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } finally { Cursor = Cursors.Arrow; } }
void LoadDataPhanTrang() { Cursor = Cursors.Wait; string TThaiNVu = ucTrangThaiNVu.GetItemsSelected(); string SoHDTD = txtSoHDTD.Text; string NgayHopDongTu = teldtNgayLapHDTu.Value != null?LDateTime.DateToString((DateTime)teldtNgayLapHDTu.Value, ApplicationConstant.defaultDateTimeFormat) : ""; string NgayHopDongDen = teldtNgayLapHDDen.Value != null?LDateTime.DateToString((DateTime)teldtNgayLapHDDen.Value, ApplicationConstant.defaultDateTimeFormat) : ""; string LSuatQHanTu = txtLaiSuatQHTu.Value != null?txtLaiSuatQHTu.Value.ToString() : ""; string LSuatQHanDen = txtLaiSuatQHDen.Value != null?txtLaiSuatQHDen.Value.ToString() : ""; string LSuatCoCauTu = txtLaiSuatTu.Value != null?txtLaiSuatTu.Value.ToString() : ""; string LSuatCoCauDen = txtLaiSuatDen.Value != null?txtLaiSuatDen.Value.ToString() : ""; string MaKhachHang = txtMaKhachHang.Text; string TenKhachHang = txtTenKhachHang.Text; string LoaiGiayTo = lstLoaiGiayTo.ElementAt(cmbLoaiGiayTo.SelectedIndex).KeywordStrings.First(); string SoGiayTo = txtSoGiayTo.Text; string DienThoai = txtDienThoai.Text; string Email = txtEmail.Text; if (tvwKhuVuc.SelectedItem == null) { tvwKhuVuc.SelectedItem = tvwKhuVuc.Items[0]; } string ListKVuc = ""; if (((RadTreeViewItem)tvwKhuVuc.SelectedItem).Tag.ToString().Substring(0, 3).Equals("DVI")) { RadTreeViewItem itemDVI = (RadTreeViewItem)tvwKhuVuc.SelectedItem; foreach (RadTreeViewItem item in itemDVI.Items) { if (item.Tag.ToString().Substring(0, 3).Equals("CNH")) { ListKVuc += ",''" + item.Tag.ToString() + "''"; } } ListKVuc = ListKVuc.Substring(3); ListKVuc = ListKVuc.Substring(0, ListKVuc.Length - 2); } else { ListKVuc = ((RadTreeViewItem)tvwKhuVuc.SelectedItem).Tag.ToString(); } DataSet ds = new TinDungProcess().getDanhSachHDTDVM(TThaiNVu, SoHDTD, NgayHopDongTu, NgayHopDongDen, LSuatQHanTu, LSuatQHanDen, LSuatCoCauTu, LSuatCoCauDen, MaKhachHang, TenKhachHang, LoaiGiayTo, SoGiayTo, DienThoai, Email, "", ListKVuc, ClientInformation.TenDangNhap, ClientInformation.MaDonViQuanLy, StartRow.ToString(), EndRow.ToString()); 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); //raddgrHDTDDS.ItemsSource = ds.Tables["DANH_SACH"].DefaultView; raddgrHDTDDS.ItemsSource = clientDataTable.DefaultView; if (!LObject.IsNullOrEmpty(raddgrHDTDDS.SelectedItems)) { raddgrHDTDDS.SelectedItems.Clear(); } lblSumKhachHang.Content = totalRecord.ToString(); } Cursor = Cursors.Arrow; }
/// <summary> /// Load dữ liệu /// </summary> private void LoadDuLieu() { Cursor = Cursors.Wait; try { TinDungProcess tindungProcess = new TinDungProcess(); string lstTrangThai = ucTrangThai.GetItemsSelected(); string sMaVongVay = txtMaVongVay.Text; string sNgayLapTu = teldtNgayLapTu.Value != null?LDateTime.DateToString((DateTime)teldtNgayLapTu.Value, ApplicationConstant.defaultDateTimeFormat) : ""; string sNgayLapDen = teldtNgayLapDen.Value != null?LDateTime.DateToString((DateTime)teldtNgayLapDen.Value, ApplicationConstant.defaultDateTimeFormat) : ""; string sHanMucGocVay = lstHanMucGocVay.ElementAt(cmbTinhChatGocVay.SelectedIndex).KeywordStrings.First(); string sHanMucKyHan = lstHanMucKyHan.ElementAt(cmbTinhChatKyHan.SelectedIndex).KeywordStrings.First(); if (tvwKhuVuc.SelectedItem == null) { tvwKhuVuc.SelectedItem = tvwKhuVuc.Items[0]; } string ListKVuc = ""; if (((RadTreeViewItem)tvwKhuVuc.SelectedItem).Tag.ToString().Substring(0, 3).Equals("DVI")) { RadTreeViewItem itemDVI = (RadTreeViewItem)tvwKhuVuc.SelectedItem; foreach (RadTreeViewItem item in itemDVI.Items) { if (item.Tag.ToString().Substring(0, 3).Equals("CNH")) { ListKVuc += ",''" + item.Tag.ToString() + "''"; } } ListKVuc = ListKVuc.Substring(3); ListKVuc = ListKVuc.Substring(0, ListKVuc.Length - 2); } else if (((RadTreeViewItem)tvwKhuVuc.SelectedItem).Tag.ToString().Substring(0, 3).Equals("CNH")) { ListKVuc = ((RadTreeViewItem)tvwKhuVuc.SelectedItem).Tag.ToString(); } else if (((RadTreeViewItem)tvwKhuVuc.SelectedItem).Tag.ToString().Substring(0, 3).Equals("PGD")) { ListKVuc = ((RadTreeViewItem)((RadTreeViewItem)tvwKhuVuc.SelectedItem).Parent).Tag.ToString(); } else if (((RadTreeViewItem)tvwKhuVuc.SelectedItem).Tag.ToString().Substring(0, 3).Equals("CUM")) { ListKVuc = ((RadTreeViewItem)((RadTreeViewItem)((RadTreeViewItem)tvwKhuVuc.SelectedItem).Parent).Parent).Tag.ToString(); } DataSet ds = tindungProcess.getDanhSachVongVonVay(lstTrangThai, sMaVongVay, sNgayLapTu, sNgayLapDen, sHanMucGocVay, sHanMucKyHan, "%", ListKVuc); if (ds != null & ds.Tables[0].Columns.Count > 0) { dgrVongVayDS.ItemsSource = null; dgrVongVayDS.ItemsSource = ds.Tables[0].DefaultView; if (!LObject.IsNullOrEmpty(dgrVongVayDS.SelectedItems)) { dgrVongVayDS.SelectedItems.Clear(); } } } catch (Exception ex) { LMessage.ShowMessage("M.DanhMuc.LoiChung", LMessage.MessageBoxType.Error); LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } Cursor = 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 tlbTinhLai_Click(object sender, RoutedEventArgs e) { Cursor = Cursors.Wait; string sidKheUoc = ""; foreach (DANH_SACH_KHE_UOC_DU_THU objDSKUOC in lstDuThu) { sidKheUoc += "," + objDSKUOC.ID_KHE_UOC.ToString(); } if (sidKheUoc.Length > 0) { sidKheUoc = sidKheUoc.Substring(1); } else { sidKheUoc = "0"; } List <string> lstDieuKien = new List <string>(); lstDieuKien.Add(sidKheUoc); lstDieuKien.Add(ClientInformation.MaDonViGiaoDich); lstDieuKien.Add("KUOCDUTHU"); lstDieuKien.Add(LDateTime.DateToString(teldtDuThuDenNgay.Value.Value, ApplicationConstant.defaultDateTimeFormat)); lstDieuKien.Add("%"); lstPopupKU = new List <DataRow>(); PopupProcess popupProcess = new PopupProcess(); popupProcess.getPopupInformation("POPUP_DS_KHEUOC", lstDieuKien); SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup; ucPopupKheUocViMo popup = new ucPopupKheUocViMo(true, simplePopupResponse, true); popup.LayGiaTriListDataRow = new ucPopupKheUocViMo.LayListDataRow(LayDuLieuTuPopup); Window win = new Window(); win.Content = popup; win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.ShowDialog(); if (lstPopupKU.Count > 0) { foreach (DataRow drv in lstPopupKU) { DANH_SACH_KHE_UOC_DU_THU objKUOC = new DANH_SACH_KHE_UOC_DU_THU(); foreach (DataColumn dtl in drv.Table.Columns) { PropertyInfo proper = objKUOC.GetType().GetProperty(dtl.ColumnName); if (proper != null) { if (proper.PropertyType == typeof(int)) { proper.SetValue(objKUOC, Convert.ToInt32(drv[dtl.ColumnName]), null); } else if (proper.PropertyType == typeof(decimal)) { proper.SetValue(objKUOC, Convert.ToDecimal(drv[dtl.ColumnName]), null); } else if (proper.PropertyType == typeof(string)) { proper.SetValue(objKUOC, Convert.ToString(drv[dtl.ColumnName]), null); } } } lstDuThu.Add(objKUOC); } LoadGridKheUoc(); } Cursor = Cursors.Arrow; }
private void LoadDuLieu() { try { TinDungProcess tindungProcess = new TinDungProcess(); string sMaTrangThaiNVu = ""; if (cbChoduyet.Checked) { sMaTrangThaiNVu = sMaTrangThaiNVu + "''" + cbChoduyet.Value + "'',"; } if (cbDaduyet.Checked) { sMaTrangThaiNVu = sMaTrangThaiNVu + "''" + cbDaduyet.Value + "'',"; } if (cbThoaiduyet.Checked) { sMaTrangThaiNVu = sMaTrangThaiNVu + "''" + cbThoaiduyet.Value + "'',"; } if (cbDaduyet.Checked) { sMaTrangThaiNVu = sMaTrangThaiNVu + "''" + cbDaduyet.Value + "'',"; } if (sMaTrangThaiNVu != "") { sMaTrangThaiNVu = "(" + sMaTrangThaiNVu.Substring(0, sMaTrangThaiNVu.Length - 1) + ")"; } string NgayNhanNoTu = ""; if (txtNgayNhanNoTu.Text != "") { NgayNhanNoTu = txtNgayNhanNoTu.Text != null?LDateTime.DateToString(DateTime.ParseExact(txtNgayNhanNoTu.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture), ApplicationConstant.defaultDateTimeFormat) : ""; } string NgayNhanNoDen = ""; if (txtNgayNhanNoTu.Text != "") { NgayNhanNoDen = txtNgayNhanNoTu.Text != null?LDateTime.DateToString(DateTime.ParseExact(txtNgayNhanNoTu.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture), ApplicationConstant.defaultDateTimeFormat) : ""; } string NgayDaoHanTu = ""; if (txtNgayNhanNoTu.Text != "") { NgayDaoHanTu = txtNgayNhanNoTu.Text != null?LDateTime.DateToString(DateTime.ParseExact(txtNgayNhanNoTu.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture), ApplicationConstant.defaultDateTimeFormat) : ""; } string NgayDaoHanDen = ""; if (txtNgayNhanNoTu.Text != "") { NgayDaoHanDen = txtNgayNhanNoTu.Text != null?LDateTime.DateToString(DateTime.ParseExact(txtNgayNhanNoTu.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture), ApplicationConstant.defaultDateTimeFormat) : ""; } string SoTienGNTu = txtSoTienGNTu.Text != null?txtSoTienGNTu.Text.ToString() : ""; string SoTienGNDen = txtSoTienGNTu.Text != null?txtSoTienGNTu.Text.ToString() : ""; string SoDuTu = txtSoTienGNTu.Text != null?txtSoTienGNTu.Text.ToString() : ""; string SoDuDen = txtSoTienGNTu.Text != null?txtSoTienGNTu.Text.ToString() : ""; string ThoiHanTu = ""; string ThoiHanDen = ""; string ThoiHanDViTu = "%"; string ThoiHanDViDen = "%"; string LaiSuatTu = ""; string LaiSuatDen = ""; string LoaiGiayTo = "%"; string MaSanPham = "%"; //if (cmbSanPham.SelectedIndex > -1) MaSanPham = lstSanPhamTinDung.ElementAt(cmbSanPham.SelectedIndex).KeywordStrings.First(); string SoGiayTo = "%"; //if (tvwKhuVuc.SelectedNode == null) //tvwKhuVuc.SelectedNode = tvwKhuVuc.Nodes[0]; string ListKVuc = "CNH0001"; //if (((TreeNode)tvwKhuVuc.SelectedNode).Value.ToString().Substring(0, 3).Equals("DVI")) //{ // TreeNode itemDVI = (TreeNode)tvwKhuVuc.SelectedNode; // foreach (TreeNode item in itemDVI.ChildNodes) // { // if (item.Value.ToString().Substring(0, 3).Equals("CNH")) // ListKVuc += ",''" + item.Value.ToString() + "''"; // } // ListKVuc = ListKVuc.Substring(3); // ListKVuc = ListKVuc.Substring(0, ListKVuc.Length - 2); //} //else // ListKVuc = ((TreeNode)tvwKhuVuc.SelectedNode).Value.ToString(); // Phân trang int StartRow = 1; int EndRow = ClientInformation.SoLuongBanGhi; DataSet ds = new TinDungProcess().getDanhSachKUOCVM(sMaTrangThaiNVu, txtSoDonVayVon.Text, txtSoKheUoc.Text, NgayNhanNoTu, NgayNhanNoDen, NgayDaoHanTu, NgayDaoHanDen, SoTienGNTu, SoTienGNDen, SoDuTu, SoDuDen, ThoiHanTu, ThoiHanDen, ThoiHanDViTu, ThoiHanDViDen, LaiSuatTu, LaiSuatDen, txtMaKH.Text, txtTenKH.Text, LoaiGiayTo, SoGiayTo, txtDienThoai.Text, txtEmail.Text, MaSanPham, ListKVuc, AppConfig.LoginedUser.UserName.ToString(), AppConfig.LoginedUser.MaDonViQuanLy.ToString(), StartRow.ToString(), "15"); grdDangKyKheUocDS.DataSource = ds.Tables[0]; grdDangKyKheUocDS.DataBind(); } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); } }
private void GetFormData(ref List <DC_HAN_MUC> lstObjHanMuc) { try { lstObjHanMuc = new List <DC_HAN_MUC>(); #region Thông tin hạn mức giao dịch DC_HAN_MUC objHMGiaoDich = new DC_HAN_MUC(); objHMGiaoDich.ID = 0; objHMGiaoDich.MA_DTUONG_LOAI = lstLoaiDoiTuong.ElementAt(cmbLoaiDoiTuong.SelectedIndex).KeywordStrings.First(); objHMGiaoDich.ID_DTUONG = LNumber.StringToInt32(txtMaDoiTuong.Tag.ToString()); objHMGiaoDich.MA_DTUONG = txtMaDoiTuong.Text; objHMGiaoDich.LOAI_HAN_MUC = BusinessConstant.LOAI_HAN_MUC.CHUNG.layGiaTri(); objHMGiaoDich.ID_CNANG = null; objHMGiaoDich.MA_CNANG = null; objHMGiaoDich.ID_TNANG = null; objHMGiaoDich.MA_TNANG = "ADD"; objHMGiaoDich.MIN = 0; if (chkHMGiaoDichToiDa.IsChecked == false) { objHMGiaoDich.MAX = (decimal)numHMGiaoDich.Value; } objHMGiaoDich.NGAY_ADUNG = LDateTime.DateToString(teldtNgayHieuLuc.Value.Value, "yyyyMMdd"); if (teldtNgayHetHieuLuc.Value is DateTime) { objHMGiaoDich.NGAY_HHAN = LDateTime.DateToString(teldtNgayHetHieuLuc.Value.Value, "yyyyMMdd"); } //Thông tin kiểm soát objHMGiaoDich.TTHAI_BGHI = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(); objHMGiaoDich.TTHAI_NVU = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri(); objHMGiaoDich.MA_DVI_QLY = ClientInformation.MaDonVi; objHMGiaoDich.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich; objHMGiaoDich.NGAY_NHAP = ClientInformation.NgayLamViecHienTai; objHMGiaoDich.NGUOI_NHAP = ClientInformation.TenDangNhap; if (_action == DatabaseConstant.Action.SUA) { objHMGiaoDich.NGAY_CNHAT = ClientInformation.NgayLamViecHienTai; objHMGiaoDich.NGUOI_CNHAT = ClientInformation.TenDangNhap; } lstObjHanMuc.Add(objHMGiaoDich); #endregion #region Thông tin hạn mức phê duyệt DC_HAN_MUC objHMPheDuyet = new DC_HAN_MUC(); objHMPheDuyet.ID = 0; objHMPheDuyet.MA_DTUONG_LOAI = lstLoaiDoiTuong.ElementAt(cmbLoaiDoiTuong.SelectedIndex).KeywordStrings.First(); objHMPheDuyet.ID_DTUONG = LNumber.StringToInt32(txtMaDoiTuong.Tag.ToString()); objHMPheDuyet.MA_DTUONG = txtMaDoiTuong.Text; objHMPheDuyet.LOAI_HAN_MUC = BusinessConstant.LOAI_HAN_MUC.CHUNG.layGiaTri(); objHMPheDuyet.ID_CNANG = null; objHMPheDuyet.MA_CNANG = null; objHMPheDuyet.ID_TNANG = null; objHMPheDuyet.MA_TNANG = "APPROVE"; objHMPheDuyet.MIN = 0; if (chkHMPheDuyetToiDa.IsChecked == false) { objHMPheDuyet.MAX = (decimal)numHMPheDuyet.Value; } objHMPheDuyet.NGAY_ADUNG = LDateTime.DateToString(teldtNgayHieuLuc.Value.Value, "yyyyMMdd"); if (teldtNgayHetHieuLuc.Value is DateTime) { objHMPheDuyet.NGAY_HHAN = LDateTime.DateToString(teldtNgayHetHieuLuc.Value.Value, "yyyyMMdd"); } //Thông tin kiểm soát objHMPheDuyet.TTHAI_BGHI = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(); objHMPheDuyet.TTHAI_NVU = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri(); objHMPheDuyet.MA_DVI_QLY = ClientInformation.MaDonVi; objHMPheDuyet.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich; objHMPheDuyet.NGAY_NHAP = ClientInformation.NgayLamViecHienTai; objHMPheDuyet.NGUOI_NHAP = ClientInformation.TenDangNhap; if (_action == DatabaseConstant.Action.SUA) { objHMPheDuyet.NGAY_CNHAT = ClientInformation.NgayLamViecHienTai; objHMPheDuyet.NGUOI_CNHAT = ClientInformation.TenDangNhap; } lstObjHanMuc.Add(objHMPheDuyet); #endregion } catch (Exception ex) { LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); throw ex; } }