Exemplo n.º 1
0
        private void LoadComboboxKhuVuc()
        {
            if (cmbPhongGD.SelectedIndex >= 0)
            {
                // khởi tạo combobox
                string maPhongGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First();
                string idPhongGD = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings[3];

                // khởi tạo combobox
                var results = dtSourceKhuVuc.AsEnumerable().Select(x => x).Where(x => x.Field <int>("ID_DVI").Equals(LNumber.StringToInt32(idPhongGD))).ToList();

                if (results.Count() > 0)
                {
                    dtSourceKhuVuc_Select = results.CopyToDataTable();
                    new AutoComboBoxListCheckes().GenAutoComboBox(dtSourceKhuVuc_Select, ref cmbKhuVuc);
                }
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
        private void GetFormData(ref TDTD_HOP_DONG_TCHAP obj, BusinessConstant.TrangThaiNghiepVu tthaiNVu)
        {
            try
            {
                obj            = new TDTD_HOP_DONG_TCHAP();
                obj.ID         = idHDTC;
                obj.MA_HDTC    = txtSoHopDong.Text;
                obj.MA_KHANG   = txtMaKH.Text;
                obj.NGAY_HDTC  = teldtNgayHopDong.Value.Value.ToString("yyyyMMdd");
                lstTSDB        = raddgrDSachTSDB.ItemsSource as List <DataRow>;
                obj.SO_PLUC_HD = soPhuLucTC;
                if (idHDTC == 0)
                {
                    obj.MA_DVI_QLY = ClientInformation.MaDonVi;
                    obj.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich;
                    obj.NGAY_NHAP  = ClientInformation.NgayLamViecHienTai;
                    obj.NGUOI_NHAP = ClientInformation.TenDangNhap;
                    obj.TTHAI_BGHI = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri();
                }
                else
                {
                    obj.MA_DVI_QLY  = maDviQLy;
                    obj.MA_DVI_TAO  = maDViTao;
                    obj.NGAY_NHAP   = teldtNgayNhap.Value.GetValueOrDefault().ToString(ApplicationConstant.defaultDateTimeFormat);
                    obj.NGUOI_NHAP  = txtNguoiLap.Text;
                    obj.NGAY_CNHAT  = ClientInformation.NgayLamViecHienTai;
                    obj.NGUOI_CNHAT = ClientInformation.TenDangNhap;
                    obj.TTHAI_BGHI  = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri();
                }
                obj.TTHAI_NVU = tthaiNVu.layGiaTri();
                obj.DIEN_GIAI = txtDienGiai.Text;

                List <TDTD_TAI_SAN_DAM_BAO> lstTaiSan = new List <TDTD_TAI_SAN_DAM_BAO>();
                foreach (DataRow dr in lstTSDB)
                {
                    TDTD_TAI_SAN_DAM_BAO objTS = new TDTD_TAI_SAN_DAM_BAO();
                    objTS.ID              = LNumber.StringToInt32(dr["ID"].ToString());
                    objTS.MA_TSDB         = dr["MA_TSDB"].ToString();
                    objTS.TEN_TSDB        = dr["TEN_TSDB"].ToString();
                    objTS.MA_LOAI_TSDB    = dr["MA_LOAI_TSDB"].ToString();
                    objTS.SO_SO_TK        = dr["SO_SO_TK"].ToString();
                    objTS.MO_TAI_LMF      = dr["MO_TAI_LMF"].ToString();
                    objTS.GIA_TRI_TAI_SAN = LNumber.ToDecimal(dr["GTRI_TAI_SAN"].ToString());
                    objTS.TI_LE_DAM_BAO   = LNumber.ToDecimal(dr["TI_LE_DAM_BAO"].ToString());
                    objTS.GIA_TRI_DAM_BAO = LNumber.ToDecimal(dr["GTRI_DAM_BAO"].ToString());
                    objTS.DIEN_GIAI       = dr["DIEN_GIAI"].ToString();
                    objTS.TTHAI_BGHI      = dr["TTHAI_BGHI"].ToString();
                    objTS.TTHAI_NVU       = dr["TTHAI_NVU"].ToString();
                    objTS.MA_DVI_QLY      = dr["MA_DVI_QLY"].ToString();
                    objTS.MA_DVI_TAO      = dr["MA_DVI_TAO"].ToString();
                    objTS.NGAY_NHAP       = dr["NGAY_NHAP"].ToString();
                    objTS.NGUOI_NHAP      = dr["NGUOI_NHAP"].ToString();
                    objTS.NGAY_CNHAT      = dr["NGAY_CNHAT"].ToString();
                    objTS.NGUOI_CNHAT     = dr["NGUOI_CNHAT"].ToString();

                    lstTaiSan.Add(objTS);
                }
                obj.DSACH_TAI_SAN_DBAO = lstTaiSan.ToArray();
                obj.TONG_GIA_TRI       = lstTaiSan.Sum(f => f.GIA_TRI_DAM_BAO);
                if (lstIDXoa.IsNullOrEmpty())
                {
                    lstIDXoa = new List <int>();
                }
                obj.DSACH_ID_XOA = lstIDXoa.ToArray();
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
Exemplo n.º 4
0
        private void LoadGridViewKhuVuc()
        {
            if (cmbPhongGD.SelectedIndex >= 0)
            {
                string maPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First();
                string idPhongGiaoDich = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings[3];

                var results = dtSourceKhuVuc.AsEnumerable().Select(x => x).Where(x => x.Field <int>("ID_DVI").Equals(LNumber.StringToInt32(idPhongGiaoDich))).ToList();
                if (!LObject.IsNullOrEmpty(results) && results.Count() > 0)
                {
                    dtSourceKhuVuc_Select = results.CopyToDataTable();
                    grKhuVuc.ItemsSource  = dtSourceKhuVuc_Select;
                }
                else
                {
                    grKhuVuc.ItemsSource = null;
                }
            }

            grCum.ItemsSource = null;
        }