private void SetThongTin(DM_KHU_VUC obj)
 {
     try
     {
         idKhuVuc             = obj.ID;
         tthaiNVu             = obj.TTHAI_NVU;
         lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(tthaiNVu);
         txtMaKhuVuc.Text     = obj.MA_KVUC;
         txtNguoiDuyet.Text   = obj.NGUOI_CNHAT;
         if (!obj.NGAY_CNHAT.IsNullOrEmptyOrSpace())
         {
             txtNgayDuyet.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, ApplicationConstant.defaultDateTimeFormat);
         }
         txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
         action = DatabaseConstant.Action.XEM;
         CommonFunction.RefreshButton(Toolbar, action, tthaiNVu, mnuMain, DatabaseConstant.Function.DC_DM_KHU_VUC);
         SetEnabledAllControls(false);
     }
     catch (System.Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
     finally
     {
     }
 }
        /// <summary>
        /// Sau khi từ chối
        /// </summary>
        /// <param name="ret"></param>
        private void afterRefuse(bool ret)
        {
            if (ret)
            {
                LMessage.ShowMessage("M.DungChung.TuChoiDuyetThanhCong", LMessage.MessageBoxType.Information);

                tthaiNvu                = BusinessConstant.TrangThaiNghiepVu.TU_CHOI.layGiaTri();
                lblTrangThai.Content    = BusinessConstant.layNgonNguNghiepVu(tthaiNvu);
                txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguNghiepVu(tthaiNvu);

                CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.XEM, tthaiNvu, null, DatabaseConstant.Function.DC_DM_TINH_THANH);
            }
            else
            {
                LMessage.ShowMessage("M.DungChung.TuChoiDuyetKhongThanhCong", LMessage.MessageBoxType.Warning);
            }

            // Yêu cầu unlock dữ liệu
            UtilitiesProcess process    = new UtilitiesProcess();
            List <int>       listLockId = new List <int>();

            listLockId.Add(Id);

            bool retUnlockData = process.UnlockData(DatabaseConstant.Module.DMDC,
                                                    DatabaseConstant.Function.DC_DM_TINH_THANH,
                                                    DatabaseConstant.Table.DC_TSUAT,
                                                    DatabaseConstant.Action.TU_CHOI_DUYET,
                                                    listLockId);
        }
        /// <summary>
        /// Sau khi sửa
        /// </summary>
        /// <param name="ret"></param>
        private void afterModify(DC_TSUAT ret)
        {
            if (ret != null)
            {
                LMessage.ShowMessage("M.DungChung.CapNhatThanhCong", LMessage.MessageBoxType.Information);

                Id                      = ret.ID;
                tthaiNvu                = ret.TTHAI_NVU;
                txtMa.Text              = ret.MA_TSUAT;
                lblTrangThai.Content    = BusinessConstant.layNgonNguNghiepVu(ret.TTHAI_NVU);
                txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguNghiepVu(ret.TTHAI_NVU);

                CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.XEM, tthaiNvu, null, DatabaseConstant.Function.DC_DM_TINH_THANH);

                tbiThongTinChung.Focus();
            }
            else
            {
                LMessage.ShowMessage("M.DungChung.CapNhatKoThanhCong", LMessage.MessageBoxType.Error);
            }

            // Yêu cầu Unlock bản ghi cần sửa
            UtilitiesProcess process    = new UtilitiesProcess();
            List <int>       listLockId = new List <int>();

            listLockId.Add(Id);

            bool retUnlockData = process.UnlockData(DatabaseConstant.Module.DMDC,
                                                    DatabaseConstant.Function.DC_DM_TINH_THANH,
                                                    DatabaseConstant.Table.DC_TSUAT,
                                                    DatabaseConstant.Action.SUA,
                                                    listLockId);
        }
        /// <summary>
        /// Sau khi thêm mới
        /// </summary>
        /// <param name="ret"></param>
        private void afterAddNew(DC_TSUAT ret)
        {
            if (ret != null)
            {
                LMessage.ShowMessage("M.DungChung.ThemThanhCong", LMessage.MessageBoxType.Information);

                if (cbMultiAdd.IsChecked == true)
                {
                    Id = 0;
                    beforeAddNew();
                }
                else if (!DatabaseConstant.CLOSE_DETAIL_FORM)
                {
                    Id                      = ret.ID;
                    tthaiNvu                = ret.TTHAI_NVU;
                    txtMa.Text              = ret.MA_TSUAT;
                    lblTrangThai.Content    = BusinessConstant.layNgonNguNghiepVu(ret.TTHAI_NVU);
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguNghiepVu(ret.TTHAI_NVU);

                    CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.XEM, tthaiNvu, null, DatabaseConstant.Function.DC_DM_TINH_THANH);

                    tbiThongTinChung.Focus();
                }
                else
                {
                    onClose();
                }
            }
            else
            {
                LMessage.ShowMessage("M.DungChung.ThemKhongThanhCong", LMessage.MessageBoxType.Error);
            }
        }
        public void AfterAddNew(bool ret, NS_DM_DVI_TGIAN obj, List <ClientResponseDetail> listClientResponseDetail)
        {
            try
            {
                if (ret)
                {
                    LMessage.ShowMessage("M.DungChung.ThemThanhCong", LMessage.MessageBoxType.Information);

                    if (chkThemNhieuLan.IsChecked == true)
                    {
                        BeforeAddNew();
                    }
                    else
                    {
                        id                      = obj.ID;
                        trangThaiNVu            = obj.TTHAI_NVU;
                        lblTrangThai.Content    = BusinessConstant.layNgonNguNghiepVu(trangThaiNVu);
                        txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);

                        BeforeViewFromDetail();
                    }
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
        private void SetFormData()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                NhanSuProcess processNhanSu = new NhanSuProcess();
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;

                obj    = new NS_DM_PHUONG_XA();
                obj.ID = id;

                ret = processNhanSu.PhuongXa(DatabaseConstant.Action.LOAD_DATA, ref obj, ref listClientResponseDetail);
                if (ret == true)
                {
                    id = obj.ID;

                    #region Thông tin chung
                    lblTrangThai.Content       = BusinessConstant.layNgonNguNghiepVu(obj.TTHAI_NVU);
                    cmbQuocGia.SelectedIndex   = lstSourceQuocGia.IndexOf(lstSourceQuocGia.FirstOrDefault(i => i.KeywordStrings[1].Equals(obj.FN003)));
                    cmbTinhTP.SelectedIndex    = lstSourceTinhTP.IndexOf(lstSourceTinhTP.FirstOrDefault(i => i.KeywordStrings[1].Equals(obj.FN002)));
                    cmbQuanHuyen.SelectedIndex = lstSourceQuanHuyen.IndexOf(lstSourceQuanHuyen.FirstOrDefault(i => i.KeywordStrings[1].Equals(obj.FN001)));
                    txtMa.Text   = obj.MA;
                    txtTen.Text  = obj.TEN;
                    txtMoTa.Text = obj.MO_TA;

                    #endregion

                    #region Thông tin kiểm soát
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayLap.Value      = LDateTime.StringToDate(obj.NGAY_NHAP, "yyyyMMdd");
                    txtNguoiLap.Text        = obj.NGUOI_NHAP;
                    if (LDateTime.IsDate(obj.NGAY_CNHAT, "yyyyMMdd") == true)
                    {
                        raddtNgayCapNhat.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, "yyyyMMdd");
                    }
                    else
                    {
                        raddtNgayCapNhat.Value = null;
                    }
                    txtNguoiCapNhat.Text = obj.NGUOI_CNHAT;
                    #endregion
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = 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;
            }
        }
Example #8
0
        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;
            }
        }
        private void SetFormData()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                NhanSuProcess processNhanSu = new NhanSuProcess();
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;

                obj    = new NS_DM_DVI_TGIAN();
                obj.ID = id;

                ret = processNhanSu.DonViThoiGian(DatabaseConstant.Action.LOAD_DATA, ref obj, ref listClientResponseDetail);
                if (ret == true)
                {
                    id = obj.ID;

                    #region Thông tin chung
                    lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(obj.TTHAI_NVU);
                    txtMa.Text           = obj.MA;
                    txtTen.Text          = obj.TEN;
                    txtMoTa.Text         = obj.MO_TA;
                    #endregion

                    #region Thông tin kiểm soát
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayLap.Value      = LDateTime.StringToDate(obj.NGAY_NHAP, "yyyyMMdd");
                    txtNguoiLap.Text        = obj.NGUOI_NHAP;
                    if (LDateTime.IsDate(obj.NGAY_CNHAT, "yyyyMMdd") == true)
                    {
                        raddtNgayCapNhat.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, "yyyyMMdd");
                    }
                    else
                    {
                        raddtNgayCapNhat.Value = null;
                    }
                    txtNguoiCapNhat.Text = obj.NGUOI_CNHAT;
                    #endregion
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Example #10
0
 public void AfterSave(ApplicationConstant.ResponseStatus ret, List <ClientResponseDetail> listClientResponseDetail)
 {
     CommonFunction.ThongBaoKetQua(listClientResponseDetail);
     if (ret == ApplicationConstant.ResponseStatus.THANH_CONG)
     {
         TTHAI_NVU = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();
         lblLabelTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(TTHAI_NVU);
         CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.XEM, TTHAI_NVU, mnuMain, DatabaseConstant.Function.DC_DM_DTUONG_SODU);
         SetEnabledControls(false);
     }
 }
Example #11
0
        private void SetFormData()
        {
            DanhMucProcess processDanhMuc = new DanhMucProcess();

            List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();

            obj = new DM_KHU_VUC();
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                bool ret = false;
                obj.ID = id;
                ret    = processDanhMuc.KhuVuc02(DatabaseConstant.Action.LOAD, ref obj, ref listClientResponseDetail);
                if (ret == true)
                {
                    sTrangThaiNVu        = obj.TTHAI_NVU;
                    lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(sTrangThaiNVu);

                    #region Thông tin chung
                    cmbChiNhanh.SelectedIndex      = lstSourceChiNhanh.IndexOf(lstSourceChiNhanh.FirstOrDefault(e => e.KeywordStrings.First().Equals(obj.MA_DVI_QLY)));
                    cmbPhongGiaoDich.SelectedIndex = lstSourcePhongGiaoDich.IndexOf(lstSourcePhongGiaoDich.FirstOrDefault(e => e.KeywordStrings.First().Equals(obj.MA_DVI)));
                    txtMaKhuVuc.Text      = obj.MA_KVUC;
                    txtTenKhuVuc.Text     = obj.TEN_KVUC;
                    txtTenTat.Text        = obj.TEN_TAT;
                    cmbCBQL.SelectedIndex = lstSourceCBQL.IndexOf(lstSourceCBQL.FirstOrDefault(e => e.KeywordStrings.First().Equals(obj.MA_CBO_QLY)));
                    #endregion

                    #region Thông tin kiểm soát
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayLap.Value      = LDateTime.StringToDate(obj.NGAY_NHAP, "yyyyMMdd");
                    txtNguoiLap.Text        = obj.NGUOI_NHAP;
                    if (LDateTime.IsDate(obj.NGAY_CNHAT, "yyyyMMdd") == true)
                    {
                        raddtNgayCapNhat.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, "yyyyMMdd");
                    }
                    txtNguoiCapNhat.Text = obj.NGUOI_CNHAT;
                    #endregion
                }
                else
                {
                    LMessage.ShowMessage("M_ResponseMessage_HanhDong_LayDuLieuKhongThanhCong", LMessage.MessageBoxType.Warning);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                LMessage.ShowMessage("M_ResponseMessage_HanhDong_LayDuLieuKhongThanhCong", LMessage.MessageBoxType.Warning);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Example #12
0
        public void AfterModify(bool ret, BC_MATK obj, List <ClientResponseDetail> listClientResponseDetail)
        {
            try
            {
                if (ret)
                {
                    LMessage.ShowMessage("M.DungChung.CapNhatThanhCong", LMessage.MessageBoxType.Information);

                    trangThaiNVu            = obj.TTHAI_NVU;
                    TTHAI_NVU               = obj.TTHAI_NVU;
                    TTHAI_BGHI              = obj.TTHAI_BGHI;
                    MA_DVI_QLY              = obj.MA_DVI_QLY;
                    MA_DVI_TAO              = obj.MA_DVI_TAO;
                    NGAY_NHAP               = obj.NGAY_NHAP;
                    NGUOI_NHAP              = obj.NGUOI_NHAP;
                    LOAI_BCTK               = obj.LOAI_BCTK;
                    MA_TK                   = obj.MATK;
                    ID                      = obj.ID;
                    lblTrangThai.Content    = BusinessConstant.layNgonNguNghiepVu(trangThaiNVu);
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayCapNhat.Value  = LDateTime.StringToDate(ClientInformation.NgayLamViecHienTai, "yyyyMMdd");
                    txtNguoiCapNhat.Text    = ClientInformation.TenDangNhap;

                    BeforeViewFromDetail();
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }

                // Yêu cầu Unlock bản ghi cần sửa
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(id);

                bool retUnlockData = process.UnlockData(DatabaseConstant.Module.DMDC,
                                                        DatabaseConstant.Function.KTDL_MAPPING_MATK_CT,
                                                        DatabaseConstant.Table.BC_MATK,
                                                        DatabaseConstant.Action.SUA,
                                                        listLockId);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
Example #13
0
        void LoadTabThongTinChung(DataSet ds)
        {
            DataTable dt = ds.Tables["TTIN_CTIET"];

            if (dt != null)
            {
                txtSoGD.Text            = TDVMDUTHU.MA_GIAO_DICH;
                teldtNgayGD.Value       = LDateTime.StringToDate(dt.Rows[0]["NGAY_GIAO_DICH"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                teldtDuThuDenNgay.Value = LDateTime.StringToDate(dt.Rows[0]["DTHU_DEN_NGAY"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                numTyLe.Value           = Convert.ToDouble(dt.Rows[0]["TY_LE"]);
                txtDienGiai.Text        = dt.Rows[0]["DIEN_GIAI"].ToString();
                lblTrangThai.Content    = BusinessConstant.layNgonNguNghiepVu(dt.Rows[0]["TTHAI_NVU"].ToString());
                iDGiaoDich = Convert.ToInt32(dt.Rows[0]["ID"]);
            }
            dt = ds.Tables["KHE_UOC"];
            if (dt != null && dt.Rows.Count > 0)
            {
                lstDuThu = new List <DANH_SACH_KHE_UOC_DU_THU>();
                foreach (DataRow dr in dt.Rows)
                {
                    DANH_SACH_KHE_UOC_DU_THU objDSKUoc = new DANH_SACH_KHE_UOC_DU_THU();
                    foreach (DataColumn dc in dt.Columns)
                    {
                        PropertyInfo proper = objDSKUoc.GetType().GetProperty(dc.ColumnName);
                        if (proper != null)
                        {
                            if (proper.PropertyType == typeof(decimal))
                            {
                                proper.SetValue(objDSKUoc, Convert.ToDecimal(dr[dc.ColumnName]), null);
                            }
                            else if (proper.PropertyType == typeof(int))
                            {
                                proper.SetValue(objDSKUoc, Convert.ToInt32(dr[dc.ColumnName]), null);
                            }
                            else if (proper.PropertyType == typeof(string))
                            {
                                proper.SetValue(objDSKUoc, Convert.ToString(dr[dc.ColumnName]), null);
                            }
                        }
                    }
                    lstDuThu.Add(objDSKUoc);
                }
                LoadGridKheUoc();
            }
        }
 private void LoadDuLieu()
 {
     lblTrangThai.Content       = BusinessConstant.layNgonNguNghiepVu(objHeThong.HTTKTHCT.TTHAI_NVU);
     txtTrangThai.Text          = BusinessConstant.layNgonNguSuDung(objHeThong.HTTKTHCT.TTHAI_BGHI);
     txtMaHeThongTaiKhoan.Text  = objHeThong.HTTKTHCT.MA_HT_TKTH;
     txtTenHeThongTaiKhoan.Text = objHeThong.HTTKTHCT.TEN_HT_TKTH;
     dtNgayHieuLuc.Value        = LDateTime.StringToDate(objHeThong.HTTKTHCT.NGAY_ADUNG, ApplicationConstant.defaultDateTimeFormat);
     if (!objHeThong.HTTKTHCT.NGAY_HET_HLUC.IsNullOrEmptyOrSpace())
     {
         dtNgayHetHieuLuc.Value = LDateTime.StringToDate(objHeThong.HTTKTHCT.NGAY_HET_HLUC, ApplicationConstant.defaultDateTimeFormat);
     }
     txtNguoiLap.Text     = objHeThong.HTTKTHCT.NGUOI_NHAP;
     txtNguoiCapNhat.Text = objHeThong.HTTKTHCT.NGUOI_CNHAT;
     raddtNgayNhap.Value  = LDateTime.StringToDate(objHeThong.HTTKTHCT.NGAY_NHAP, ApplicationConstant.defaultDateTimeFormat);
     if (!objHeThong.HTTKTHCT.NGAY_CNHAT.IsNullOrEmptyOrSpace())
     {
         raddtNgayCNhat.Value = LDateTime.StringToDate(objHeThong.HTTKTHCT.NGAY_CNHAT, ApplicationConstant.defaultDateTimeFormat);
     }
 }
 public void LoadForm(bool bBool)
 {
     //STT,ID,MA_TSUAT,TEN_TanSuat,TEN_TAT,MA_MIEN,TEN_MIEN,MA_VUNG,TEN_VUNG,TTHAI_BGHI,TTHAI_NVU,NGAY_NHAP,NGUOI_NHAP,NGAY_CNHA,NGUOI_CNHA,KEY
     Id = int.Parse(LstChiTiet[1].ToString());
     txtMa.IsEnabled         = false;
     lblTrangThai.Content    = LstChiTiet[10].ToString();
     txtTrangThaiBanGhi.Text = LstChiTiet[9].ToString();
     if (!LstChiTiet[11].ToString().IsNullOrEmptyOrSpace())
     {
         txtNgayLap.Value = LDateTime.StringToDate(LstChiTiet[11].ToString(), "yyyyMMdd");
     }
     if (!LstChiTiet[13].ToString().IsNullOrEmptyOrSpace())
     {
         txtNgayDuyet.Value = LDateTime.StringToDate(LstChiTiet[13].ToString(), "yyyyMMdd");
     }
     txtNguoiLap.Text   = LstChiTiet[12].ToString();
     txtNguoiDuyet.Text = LstChiTiet[14].ToString();
     //Sua(bBool);
     lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(lblTrangThai.Content.ToString());
 }
 public void SetDataForm(int id)
 {
     try
     {
         idKhuVuc = id;
         DM_KHU_VUC obj = new DanhMucProcess().getKhuVucById(idKhuVuc);
         if (!LObject.IsNullOrEmpty(obj))
         {
             tthaiNVu               = obj.TTHAI_NVU;
             txtMaKhuVuc.Text       = obj.MA_KVUC;
             txtTenKhuVuc.Text      = obj.TEN_KVUC;
             txtTenTat.Text         = obj.TEN_TAT;
             lblTrangThai.Content   = BusinessConstant.layNgonNguNghiepVu(tthaiNVu);
             cmbDonVi.SelectedIndex = lstSourcePGD.IndexOf(lstSourcePGD.FirstOrDefault(e => e.KeywordStrings.First().Equals(obj.MA_DVI)));
             txtNguoiLap.Text       = obj.NGUOI_NHAP;
             txtNgayLap.Value       = LDateTime.StringToDate(obj.NGAY_NHAP, ApplicationConstant.defaultDateTimeFormat);
             txtNguoiDuyet.Text     = obj.NGUOI_CNHAT;
             if (!obj.NGAY_CNHAT.IsNullOrEmptyOrSpace())
             {
                 txtNgayDuyet.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, ApplicationConstant.defaultDateTimeFormat);
             }
             txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
             if (action.Equals(DatabaseConstant.Action.SUA))
             {
                 SetEnabledAllControls(true);
             }
             else
             {
                 SetEnabledAllControls(false);
             }
             CommonFunction.RefreshButton(Toolbar, action, tthaiNVu, mnuMain, DatabaseConstant.Function.DC_DM_KHU_VUC);
         }
     }
     catch (System.Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
Example #17
0
        public void KhoiTaoThongTin()
        {
            List <string> lstDieuKien = new List <string>();
            List <string> lstMaChon   = new List <string>();

            string[] arr = new string[1];
            if (!lstLyDo.IsNullOrEmpty())
            {
                arr[0] = BusinessConstant.layNgonNguNghiepVu(lstLyDo[0].TRANG_THAI);
                grbThongTinTinDung.Header     = LLanguage.SearchResourceByKey("U.CustomControl.ucLyDoDS.GrbThongTin", arr);
                raddgrCapPheDuyet.ItemsSource = lstLyDo;
            }
            raddgrCapPheDuyet.CellValidating += new EventHandler <Telerik.Windows.Controls.GridViewCellValidatingEventArgs>(raddgrCapPheDuyet_CellValidating);
            if (lstLyDo[0].ACTION.Equals(DatabaseConstant.Action.DUYET.getValue()))
            {
                object       item = raddgrCapPheDuyet.Columns["ucCapPheDuyet"];
                PropertyInfo prty = item.GetType().GetProperty("IsVisible");
                prty.SetValue(item, false, null);
                item = raddgrCapPheDuyet.Columns["MUC_PHE_DUYET"];
                prty = item.GetType().GetProperty("IsReadOnly");
                prty.SetValue(item, false, null);
            }
            else if (lstLyDo[0].ACTION.Equals(DatabaseConstant.Action.TU_CHOI_DUYET.getValue()))
            {
                object       item = raddgrCapPheDuyet.Columns["ucCapPheDuyet"];
                PropertyInfo prty = item.GetType().GetProperty("IsVisible");
                prty.SetValue(item, true, null);
                item = raddgrCapPheDuyet.Columns["MUC_PHE_DUYET"];
                prty = item.GetType().GetProperty("IsVisible");
                prty.SetValue(item, false, null);
                item = raddgrCapPheDuyet.Columns["LOAI_TIEN"];
                prty = item.GetType().GetProperty("IsVisible");
                prty.SetValue(item, false, null);
            }
            ucCapPheDuyet.EditCellEnd += new EventHandler(ucCapPheDuyet_EditCellEnd);
            this.Unloaded             += new RoutedEventHandler(ucLyDoDS_Unloaded);
        }
        void LoadDataPhanTrang()
        {
            Cursor = Cursors.Wait;
            //AutoCompleteEntry auLoaiSanPham = lstSourceLoaiSPham.ElementAt(cmbLoaiSanPham.SelectedIndex);
            string ngayKiemSoatTu  = "";
            string ngayKiemSoatDen = "";

            DataTable dt = null;

            LDatatable.MakeParameterTable(ref dt);
            string TThaiNVu = ucTrangThaiNVu.GetItemsSelected();

            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();
            }

            LDatatable.AddParameter(ref dt, "@INP_MA_TRANG_THAI_NGHIEP_VU", "String", TThaiNVu);
            LDatatable.AddParameter(ref dt, "@INP_MA_PHIEU_KIEM_SOAT", "String", txtSoPhieuKiemSoat.Text.Trim());
            LDatatable.AddParameter(ref dt, "@INP_NGAY_KIEM_SOAT_TU", "String", ngayKiemSoatTu);
            LDatatable.AddParameter(ref dt, "@INP_NGAY_KIEM_SOAT_DEN", "String", ngayKiemSoatDen);
            LDatatable.AddParameter(ref dt, "@INP_SO_KHE_UOC", "String", txtSoKheUoc.Text.Trim());
            LDatatable.AddParameter(ref dt, "@INP_SO_HDTD", "String", txtSoHDTD.Text.Trim());
            LDatatable.AddParameter(ref dt, "@INP_MA_KHACH_HANG", "String", txtMaKhachHang.Text.Trim());
            LDatatable.AddParameter(ref dt, "@INP_TEN_KHACH_HANG", "String", txtTenKhachHang.Text.Trim());
            LDatatable.AddParameter(ref dt, "@INP_KHUVUC", "String", ListKVuc);
            LDatatable.AddParameter(ref dt, "@INP_USERNAME", "String", ClientInformation.TenDangNhap);
            LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "String", ClientInformation.MaDonViQuanLy);
            LDatatable.AddParameter(ref dt, "@INP_START_ROW", "String", StartRow.ToString());
            LDatatable.AddParameter(ref dt, "@INP_END_ROW", "String", EndRow.ToString());

            DataSet ds = new TinDungTDProcess().GetDanhSachKiemSoatRuiRo(dt);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null)
            {
                DataTable serverDataTable = ds.Tables[0];
                foreach (DataRow dr in serverDataTable.Rows)
                {
                    dr["TTHAI_NVU_TEN"] = BusinessConstant.layNgonNguNghiepVu(dr["TTHAI_NVU_TEN"].ToString());
                }

                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;
        }
Example #19
0
        private void SetFormData()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                DanhMucProcess processDanhMuc = new DanhMucProcess();
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;

                obj    = new DM_DTUONG();
                obj.ID = id;

                ret = processDanhMuc.getDoiTuongById(id, ref obj, ref listClientResponseDetail);
                if (ret == true)
                {
                    id = obj.ID;

                    #region Thông tin chung
                    lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(obj.TTHAI_NVU);

                    cmbLoaiDoiTuong.SelectedIndex = lstSourceDoiTuongLoai.IndexOf(lstSourceDoiTuongLoai.FirstOrDefault(i => i.KeywordStrings[1].ToString().Equals(obj.ID_LOAI_DTUONG.ToString())));

                    txtMaDoiTuong.Text       = obj.MA_DTUONG;
                    cmbMaDonVi.SelectedIndex = lstSourceDonVi.IndexOf(lstSourceDonVi.FirstOrDefault(i => i.KeywordStrings[0].ToString().Equals(obj.MA_DVI.ToString())));
                    txtMaLoaiThamChieu.Text  = obj.MA_LOAI_TCHIEU;
                    txtMaThamChieu.Text      = obj.MA_TCHIEU;
                    txtMota.Text             = obj.MO_TA;
                    txtTenDoiTuong.Text      = obj.TEN_DTUONG;
                    #endregion

                    #region Thông tin kiểm soát
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayLap.Value      = LDateTime.StringToDate(obj.NGAY_NHAP, "yyyyMMdd");
                    txtNguoiLap.Text        = obj.NGUOI_NHAP;
                    if (LDateTime.IsDate(obj.NGAY_CNHAT, "yyyyMMdd") == true)
                    {
                        raddtNgayCapNhat.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, "yyyyMMdd");
                    }
                    else
                    {
                        raddtNgayCapNhat.Value = null;
                    }
                    txtNguoiCapNhat.Text = obj.NGUOI_CNHAT;
                    #endregion

                    #region Lưu thông tin chung
                    TTHAI_BGHI = obj.TTHAI_BGHI;
                    TTHAI_NVU  = obj.TTHAI_NVU;
                    MA_DVI_QLY = obj.MA_DVI_QLY;
                    MA_DVI_TAO = obj.MA_DVI_TAO;
                    NGAY_NHAP  = obj.NGAY_NHAP;
                    NGUOI_NHAP = obj.NGUOI_NHAP;
                    #endregion
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
        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;
            }
        }
Example #21
0
        /// <summary>
        /// Tìm kiếm nâng cao
        /// </summary>
        private void TimKiem()
        {
            string maPhanLoai = "(";
            string tthaiNvu   = "";

            foreach (object item in trvPhanLoai.CheckedItems)
            {
                DataRowView dr = (DataRowView)item;
                maPhanLoai += dr["MA_PLOAI"] + ",";
            }

            if (trvPhanLoai.CheckedItems.Count > 0)
            {
                maPhanLoai = maPhanLoai.Substring(0, maPhanLoai.Length - 1) + ")";
            }
            else
            {
                maPhanLoai = "";
            }

            if (ucTrangThaiNVu.GetItemsSelected() != "NULL")
            {
                tthaiNvu = ucTrangThaiNVu.GetItemsSelected();
            }
            else
            {
                tthaiNvu = "";
            }

            KeToanProcess process = new KeToanProcess();
            AutoComboBox  au      = new AutoComboBox();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                AutoCompleteEntry auDonVi = au.getEntryByDisplayName(lstSourceDonVi, ref cmbDonVi);
                DataSet           ds      = process.getDanhSachMaPhanLoai(auDonVi.KeywordStrings[0], tthaiNvu, BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(), maPhanLoai);
                raddgrPhanLoaiTK.ItemsSource = null;
                if (ds != null && ds.Tables.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        dr["TRANG_THAI"] = BusinessConstant.layNgonNguNghiepVu(dr["TTHAI_NVU"].ToString());
                        dr["TCHAT_CNO"]  = BusinessConstant.layNgonNguTuGiaTri(dr["MA_TCHAT_CNO"].ToString(), "CO_KHONG");
                    }

                    raddgrPhanLoaiTK.ItemsSource = ds.Tables[0].DefaultView;
                    lblSum.Content = ds.Tables[0].Rows.Count.ToString("#");
                }
                else
                {
                    raddgrPhanLoaiTK.ItemsSource = null;
                    lblSum.Content = 0;
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                process = null;
                au      = null;
            }
            Mouse.OverrideCursor = 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)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        dr["TEN_TTHAI_NVU"] = BusinessConstant.layNgonNguNghiepVu(dr["TTHAI_NVU"].ToString());
                    }

                    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;
        }
Example #23
0
        private void SetFormData()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                KhaiThacDuLieuProcess       processKTDL = new KhaiThacDuLieuProcess();
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;

                obj    = new BC_MATK();
                obj.ID = ID;

                ret = processKTDL.MaTK(DatabaseConstant.Action.LOAD, ref obj, ref listClientResponseDetail);
                if (ret == true)
                {
                    ID = obj.ID;

                    #region Thông tin chung
                    lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(obj.TTHAI_NVU);

                    cmbLoaiTK.SelectedIndex = lstSourceLoaiTK.IndexOf(lstSourceLoaiTK.FirstOrDefault(i => i.KeywordStrings[0].ToString().Equals(obj.MA_LOAITK.ToString())));

                    txtMaTK.Text  = obj.MA_LOAITK;
                    txtTenTK.Text = obj.TEN_MATK;
                    #endregion

                    #region Thông tin kiểm soát
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayLap.Value      = LDateTime.StringToDate(obj.NGAY_NHAP, "yyyyMMdd");
                    txtNguoiLap.Text        = obj.NGUOI_NHAP;
                    if (LDateTime.IsDate(obj.NGAY_CNHAT, "yyyyMMdd") == true)
                    {
                        raddtNgayCapNhat.Value = LDateTime.StringToDate(obj.NGAY_CNHAT, "yyyyMMdd");
                    }
                    else
                    {
                        raddtNgayCapNhat.Value = null;
                    }
                    txtNguoiCapNhat.Text = obj.NGUOI_CNHAT;
                    #endregion

                    #region Lưu thông tin chung
                    TTHAI_BGHI = obj.TTHAI_BGHI;
                    TTHAI_NVU  = obj.TTHAI_NVU;
                    MA_DVI_QLY = obj.MA_DVI_QLY;
                    MA_DVI_TAO = obj.MA_DVI_TAO;
                    NGAY_NHAP  = obj.NGAY_NHAP;
                    NGUOI_NHAP = obj.NGUOI_NHAP;
                    #endregion
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Example #24
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         if (!isLoaded)
         {
             if (luuAction == DatabaseConstant.Action.XEM)
             {
                 formCase = "XEM";
             }
             if (luuAction == DatabaseConstant.Action.SUA || luuAction == DatabaseConstant.Action.THEM)
             {
                 formCase = "MANAGE";
             }
             if (formCase == null)
             {
                 formCase = ClientInformation.FormCase;
             }
             string strTrangThai = string.Empty;
             if (obj != null)
             {
                 txtMaLoaiThamSo.Text         = obj.MA_TSO_LOAI;
                 txtMaThamSo.Text             = obj.MA_TSO;
                 txtTenThamSo.Text            = obj.TEN_TSO;
                 txtMoTaThamSo.Text           = obj.MO_TA;
                 txtGiaTriMacDinh.Text        = obj.HTHI_GTRI_MDINH;
                 cmbKieuDuLieu.SelectedIndex  = lstSourceKieuDL.IndexOf(lstSourceKieuDL.FirstOrDefault(d => d.KeywordStrings.First().Equals(obj.KIEU_DU_LIEU)));
                 cmbHienThiTren.SelectedIndex = lstSourceLoaiControl.IndexOf(lstSourceLoaiControl.FirstOrDefault(d => d.KeywordStrings.First().Equals(obj.HTHI_DIEU_KHIEN)));
                 txtCauLenhHienThi.Text       = obj.HTHI_SQL;
                 txtGiaTri.Text = obj.GIA_TRI;
                 cmbThuocPhanHe.SelectedIndex  = lstSourcePhanHe.IndexOf(lstSourcePhanHe.FirstOrDefault(d => d.KeywordStrings.First().Equals(obj.MA_PHAN_HE)));
                 cmbPhamViAHuong.SelectedIndex = lstSourcePhamVi.IndexOf(lstSourcePhamVi.FirstOrDefault(d => d.KeywordStrings.First().Equals(obj.PVI_AHUONG)));
                 strTrangThai = obj.TTHAI_NVU;
                 //cmbHanhDong.SelectedIndex = lstSource.IndexOf(lstSourceKieuDL.FirstOrDefault(d => d.KeywordStrings.First().Equals(obj.KIEU_DU_LIEU)));
             }
             else
             {
                 lblTrangThai.Content = BusinessConstant.layNgonNguNghiepVu(BusinessConstant.TrangThaiNghiepVu.CHO_DUYET.layGiaTri());
                 txtTrangThai.Text    = BusinessConstant.layNgonNguSuDung(BusinessConstant.TrangThaiSuDung.SU_DUNG.layGiaTri());
                 raddtNgayNhap.Value  = DateTime.Today;
                 txtNguoiLap.Text     = ClientInformation.TenDangNhap;
                 strTrangThai         = string.Empty;
             }
             CommonFunction.RefreshButton(Toolbar, luuAction, strTrangThai, mnuMain, DatabaseConstant.Function.HT_THAM_SO);
             if (luuAction != DatabaseConstant.Action.THEM)
             {
                 cbMultiAdd.Visibility = Visibility.Collapsed;
             }
             HideControl();
             if (ClientInformation.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_SA.layGiaTri()) ||
                 ClientInformation.LoaiNguoiSuDung.Equals(BusinessConstant.LoaiNguoiSuDung.CAP_QTTW.layGiaTri()))
             {
                 formCase = "SETVALUE";
                 HideControl();
             }
         }
     }
     catch (System.Exception ex)
     {
         CommonFunction.ThongBaoLoi(ex);
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
     }
     Mouse.OverrideCursor = Cursors.Arrow;
 }