コード例 #1
0
        void Duyet()
        {
            if (!tlbApprove.IsEnabled)
            {
                return;
            }
            Cursor = Cursors.Wait;
            List <int>       lstID       = new List <int>();
            UtilitiesProcess process     = new UtilitiesProcess();
            bool             retLockData = false;

            try
            {
                if (raddgrHDTDDS.SelectedItems.Count > 0)
                {
                    if (LMessage.ShowMessage("M.DungChung.HoiDuyet", LMessage.MessageBoxType.Question) == MessageBoxResult.Yes)
                    {
                        TinDungTDProcess            tindungProcess       = new TinDungTDProcess();
                        List <ClientResponseDetail> ClientResponseDetail = new List <Presentation.Process.Common.ClientResponseDetail>();
                        List <TD_KIEM_SOAT_RR>      lstKiemSoat          = new List <TD_KIEM_SOAT_RR>();

                        lstKiemSoat = LayListGiaTriObject();
                        lstID       = lstKiemSoat.Select(e => e.ID).ToList();

                        // Yêu cầu lock dữ liệu
                        retLockData = process.UnlockData(DatabaseConstant.Module.TDTD,
                                                         DatabaseConstant.Function.TDTD_KIEM_SOAT_RR,
                                                         DatabaseConstant.Table.TD_KIEM_SOAT_RR,
                                                         DatabaseConstant.Action.DUYET,
                                                         lstID);

                        int iret = tindungProcess.KiemSoatRuiRo(DatabaseConstant.Action.DUYET, ref lstKiemSoat, ref ClientResponseDetail);
                        if (iret > 0)
                        {
                            LMessage.ShowMessage("M.DungChung.DuyetThanhCong", LMessage.MessageBoxType.Information);
                        }
                        else
                        {
                            CommonFunction.ThongBaoKetQua(ClientResponseDetail);
                        }
                        LoadData();
                    }
                }
            }
            catch (Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                // Yêu cầu Unlock dữ liệu
                retLockData = process.UnlockData(DatabaseConstant.Module.TDTD,
                                                 DatabaseConstant.Function.TDTD_KIEM_SOAT_RR,
                                                 DatabaseConstant.Table.TD_KIEM_SOAT_RR,
                                                 DatabaseConstant.Action.DUYET,
                                                 lstID);
                Cursor = Cursors.Arrow;
            }
        }
コード例 #2
0
        void Xoa()
        {
            if (!tlbApprove.IsEnabled)
            {
                return;
            }
            Cursor = Cursors.Wait;
            List <int>       lstID       = new List <int>();
            UtilitiesProcess process     = new UtilitiesProcess();
            bool             retLockData = false;

            try
            {
                if (grdDieuChinhLS.SelectedItems.Count > 0)
                {
                    if (LMessage.ShowMessage("M.DungChung.HoiXoa", LMessage.MessageBoxType.Question) == MessageBoxResult.Yes)
                    {
                        List <int> lstId = new List <int>();
                        foreach (DataRowView drv in grdDieuChinhLS.SelectedItems)
                        {
                            lstId.Add(Convert.ToInt32(drv["ID"]));
                        }
                        TDVMDCHINHLSUAT.LST_ID_GIAO_DICH = lstId.ToArray();
                        TDVMDCHINHLSUAT.NGAY_GIAO_DICH   = ClientInformation.NgayLamViecHienTai;
                        // Yêu cầu Unlock dữ liệu
                        retLockData = process.LockData(DatabaseConstant.Module.TDVM,
                                                       DatabaseConstant.Function.TDVM_DIEU_CHINH_LAI_SUAT,
                                                       DatabaseConstant.Table.TD_TDOI_LSUAT,
                                                       DatabaseConstant.Action.XOA,
                                                       lstId);
                        List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();
                        new TinDungProcess().XoaDieuChinhLSuatTinDung(ref TDVMDCHINHLSUAT, ref lstResponse);
                        CommonFunction.ThongBaoKetQua(lstResponse);
                        retLockData = process.UnlockData(DatabaseConstant.Module.TDVM,
                                                         DatabaseConstant.Function.TDVM_DIEU_CHINH_LAI_SUAT,
                                                         DatabaseConstant.Table.TD_TDOI_LSUAT,
                                                         DatabaseConstant.Action.XOA,
                                                         lstId);
                        LoadData();
                    }
                }
            }
            catch (Exception ex)
            {
                LMessage.ShowMessage("M.DanhMuc.LoiChung", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                // Yêu cầu Unlock dữ liệu
                retLockData = process.UnlockData(DatabaseConstant.Module.TDVM,
                                                 DatabaseConstant.Function.TDVM_CHI_TIET_HOP_DONG,
                                                 DatabaseConstant.Table.TD_HDTDVM,
                                                 DatabaseConstant.Action.DUYET,
                                                 lstID);
                Cursor = Cursors.Arrow;
            }
        }
コード例 #3
0
        private void Duyet()
        {
            if (!tlbApprove.IsEnabled)
            {
                return;
            }
            Cursor = Cursors.Wait;
            List <int>       lstID       = new List <int>();
            UtilitiesProcess process     = new UtilitiesProcess();
            bool             retLockData = false;

            try
            {
                if (raddgrSanPham.SelectedItems.Count > 0)
                {
                    if (LMessage.ShowMessage("M.DungChung.HoiDuyet", LMessage.MessageBoxType.Question) == MessageBoxResult.Yes)
                    {
                        TinDungTDProcess            tindungProcess       = new TinDungTDProcess();
                        List <ClientResponseDetail> ClientResponseDetail = new List <Presentation.Process.Common.ClientResponseDetail>();
                        List <TDTD_SAN_PHAM>        lstSanPham           = new List <TDTD_SAN_PHAM>();
                        List <KT_PHAN_HE_PLOAI>     lstPhanHePloai       = new List <KT_PHAN_HE_PLOAI>();

                        foreach (DataRowView dr in raddgrSanPham.SelectedItems)
                        {
                            TDTD_SAN_PHAM objSP = new TDTD_SAN_PHAM();
                            objSP.ID = Convert.ToInt32(dr["ID"]);
                            lstSanPham.Add(objSP);
                            lstID.Add(objSP.ID);
                        }

                        // Yêu cầu lock dữ liệu
                        retLockData = process.UnlockData(DatabaseConstant.Module.TDTD,
                                                         DatabaseConstant.Function.TDTD_SAN_PHAM,
                                                         DatabaseConstant.Table.TDTD_SAN_PHAM,
                                                         DatabaseConstant.Action.DUYET,
                                                         lstID);

                        int iret = tindungProcess.SanPhamTinDung(DatabaseConstant.Action.DUYET, ref lstSanPham, ref lstPhanHePloai, ref ClientResponseDetail);
                        CommonFunction.ThongBaoKetQua(ClientResponseDetail);
                    }
                }
            }
            catch (Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                // Yêu cầu Unlock dữ liệu
                retLockData = process.UnlockData(DatabaseConstant.Module.TDTD,
                                                 DatabaseConstant.Function.TDTD_DON_XIN_VAY_VON,
                                                 DatabaseConstant.Table.TDTD_HDTD,
                                                 DatabaseConstant.Action.DUYET,
                                                 lstID);
                Cursor = Cursors.Arrow;
            }
        }
コード例 #4
0
 void AfterDelete(List <ClientResponseDetail> lstResponse, int iret)
 {
     CommonFunction.ThongBaoKetQua(lstResponse);
     if (iret > 0)
     {
         List <int> lstId = new List <int>();
         lstId.Add(TDVMDUTHU.ID_GIAO_DICH);
         // Yêu cầu Unlock dữ liệu
         UtilitiesProcess process     = new UtilitiesProcess();
         bool             retLockData = process.UnlockData(DatabaseConstant.Module.TDVM,
                                                           DatabaseConstant.Function.TDVM_DU_THU,
                                                           DatabaseConstant.Table.KT_GIAO_DICH,
                                                           DatabaseConstant.Action.XOA,
                                                           lstId);
         if (OnSavingCompleted != null)
         {
             OnSavingCompleted(null, EventArgs.Empty);
         }
         if (iret > 0)
         {
             CommonFunction.CloseUserControl(this);
         }
         LoadDataForm();
         if ((bool)cbMultiAdd.IsChecked)
         {
             ClearForm();
         }
     }
 }
コード例 #5
0
 void AfterSave(List <ClientResponseDetail> lstResponseDetail, bool kq)
 {
     try
     {
         CommonFunction.ThongBaoKetQua(lstResponseDetail);
         // Yêu cầu Unlock dữ liệu
         UtilitiesProcess process     = new UtilitiesProcess();
         bool             retLockData = process.UnlockData(DatabaseConstant.Module.TDVM,
                                                           DatabaseConstant.Function.DC_TY_GIA,
                                                           DatabaseConstant.Table.DC_TY_GIA,
                                                           DatabaseConstant.Action.SUA,
                                                           idTienTeCT);
         action = DatabaseConstant.Action.XEM;
         if (!cbMultiAdd.IsChecked.GetValueOrDefault(false))
         {
             if (kq)
             {
                 SetInfomation();
             }
         }
         else
         {
             if (kq)
             {
                 ClearForm();
             }
         }
     }
     catch (System.Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
コード例 #6
0
        /// <summary>
        /// Sau khi xóa
        /// </summary>
        /// <param name="ret"></param>
        private void AfterDelete(ref string msg, int id, bool ret, List <ClientResponseDetail> listClientResponseDetail)
        {
            if (ret)
            {
                msg = "S#" + LanguageNode.GetValueMessageLanguage("M.DungChung.XoaThanhCong");
            }
            else
            {
                //msg = LanguageNode.GetValueMessageLanguage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                //CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                msg = "E#";
            }

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

            listLockId.Add(id);
            List <int> listUnlockId = new List <int>();

            bool retUnlockData = process.UnlockData(DatabaseConstant.Module.QTHT,
                                                    DatabaseConstant.Function.HT_NHNSD,
                                                    DatabaseConstant.Table.HT_NHNSD,
                                                    DatabaseConstant.Action.XOA,
                                                    listLockId);
        }
コード例 #7
0
        /// <summary>
        /// Sau khi sửa
        /// </summary>
        /// <param name="ret"></param>
        private void afterModify(ref string msg, ApplicationConstant.ResponseStatus ret, HT_NHNSD obj, string responseMessage)
        {
            if (ret == ApplicationConstant.ResponseStatus.THANH_CONG)
            {
                msg = "S#" + LanguageNode.GetValueMessageLanguage("M.DungChung.CapNhatThanhCong");

                // Bind lại giao diện
            }
            else
            {
                msg = "E#" + LanguageNode.GetValueMessageLanguage(responseMessage);
            }

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

            listLockId.Add(obj.ID);

            bool retUnlockData = process.UnlockData(DatabaseConstant.Module.QTHT,
                                                    DatabaseConstant.Function.HT_NHNSD,
                                                    DatabaseConstant.Table.HT_NHNSD,
                                                    DatabaseConstant.Action.SUA,
                                                    listLockId);
        }
コード例 #8
0
        void onCancel(List <int> lstId)
        {
            if (LMessage.ShowMessage("M.DungChung.HoiTuChoiDuyet", LMessage.MessageBoxType.Question) != MessageBoxResult.Yes)
            {
                return;
            }
            // Yêu cầu look dữ liệu
            UtilitiesProcess process = new UtilitiesProcess();

            bool retLockData = process.UnlockData(DatabaseConstant.Module.TIN_DUNG_VI_MO,
                                                  DatabaseConstant.Function.TD_DANH_SACH_HOP_DONG_THE_CHAP,
                                                  DatabaseConstant.Table.TD_HDTC,
                                                  DatabaseConstant.Action.THOAI_DUYET,
                                                  lstId);

            //Bắt đầu xóa dữ liệu
            if (retLockData)
            {
                List <ClientResponseDetail> responseDetail = new List <ClientResponseDetail>();
                new TaiSanDamBaoProcess().ThoaiDuyetHopDongTheChap(lstId, ref responseDetail);
                afterCancel(lstId, responseDetail);
            }
            else
            {
                LMessage.ShowMessage("M.ResponseMessage.Common.LockDataInvalid", LMessage.MessageBoxType.Information);
                return;
            }
        }
コード例 #9
0
        public void AfterModify(bool ret, List <ClientResponseDetail> listClientResponseDetail)
        {
            try
            {
                if (ret)
                {
                    LMessage.ShowMessage("M.DungChung.CapNhatThanhCong", LMessage.MessageBoxType.Information);

                    sTrangThaiNVu = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();

                    BeforeViewFromDetail();
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                    //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(idKhachHang);

                bool retUnlockData = process.UnlockData(DatabaseConstant.Module.TDTT,
                                                        DatabaseConstant.Function.TD_SAN_PHAMTT,
                                                        DatabaseConstant.Table.TD_SAN_PHAMTT,
                                                        DatabaseConstant.Action.SUA,
                                                        listLockId);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
コード例 #10
0
        /// <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);
        }
コード例 #11
0
 void AfterCancel(List <ClientResponseDetail> lstResponse, int iret)
 {
     CommonFunction.ThongBaoKetQua(lstResponse);
     if (iret > 0)
     {
         action = DatabaseConstant.Action.XEM;
         List <int> lstId = new List <int>();
         lstId.Add(TDVMDUTHU.ID_GIAO_DICH);
         // Yêu cầu Unlock dữ liệu
         UtilitiesProcess process     = new UtilitiesProcess();
         bool             retLockData = process.UnlockData(DatabaseConstant.Module.TDVM,
                                                           DatabaseConstant.Function.TDVM_DU_THU,
                                                           DatabaseConstant.Table.KT_GIAO_DICH,
                                                           DatabaseConstant.Action.THOAI_DUYET,
                                                           lstId);
         LoadDataForm();
         CommonFunction.RefreshButton(Toolbar, action, TThaiNV, mnuMain);
         if (OnSavingCompleted != null)
         {
             OnSavingCompleted(null, EventArgs.Empty);
         }
         if ((bool)cbMultiAdd.IsChecked)
         {
             ClearForm();
         }
     }
 }
コード例 #12
0
        public void AfterDelete(bool ret, List <ClientResponseDetail> listClientResponseDetail)
        {
            try
            {
                if (ret)
                {
                    LMessage.ShowMessage("M.DungChung.XoaThanhCong", LMessage.MessageBoxType.Information);
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                    //LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                }

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

                bool retUnlockData = process.UnlockData(DatabaseConstant.Module.NSTL,
                                                        DatabaseConstant.Function.NS_DM_DVI_TGIAN_CT,
                                                        DatabaseConstant.Table.NS_DM_DVI_TGIAN,
                                                        DatabaseConstant.Action.XOA,
                                                        listLockId);

                // Đóng cửa sổ chi tiết sau khi xóa
                OnClose();
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
コード例 #13
0
        /// <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);
        }
コード例 #14
0
        /// <summary>
        /// Sau khi xóa
        /// </summary>
        /// <param name="ret"></param>
        private void afterDelete(bool ret,
                                 List <int> listId,
                                 List <ClientResponseDetail> listClientResponseDetail)
        {
            if (ret)
            {
                LMessage.ShowMessage("M.DungChung.XoaThanhCong", LMessage.MessageBoxType.Information);
                //LoadTree();
                if (maParent != null)
                {
                    LoadGrid();
                }
            }
            else
            {
                //LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                //LoadTree();
                if (maParent != null)
                {
                    LoadGrid();
                }
            }

            LoadGrid();
            // Yêu cầu unlock dữ liệu
            UtilitiesProcess process = new UtilitiesProcess();

            bool retUnlockData = process.UnlockData(this.Module,
                                                    this.Function,
                                                    this.Table,
                                                    DatabaseConstant.Action.XOA,
                                                    listId);
        }
コード例 #15
0
        /// <summary>
        /// Sau khi xóa
        /// </summary>
        /// <param name="ret"></param>
        private void afterDelete(bool ret, List <ClientResponseDetail> listClientResponseDetail)
        {
            if (ret)
            {
                LMessage.ShowMessage("M.DungChung.XoaThanhCong", LMessage.MessageBoxType.Information);
            }
            else
            {
                //LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                CommonFunction.ThongBaoKetQua(listClientResponseDetail);
            }

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

            listLockId.Add(id);
            List <int> listUnlockId = new List <int>();

            bool retUnlockData = process.UnlockData(DatabaseConstant.Module.QTHT,
                                                    DatabaseConstant.Function.HT_NHNSD,
                                                    DatabaseConstant.Table.HT_NHNSD,
                                                    DatabaseConstant.Action.XOA,
                                                    listLockId);

            // Đóng cửa sổ chi tiết sau khi xóa thành công
            if (ret)
            {
                onClose();
            }
        }
コード例 #16
0
        /// <summary>
        /// Sau khi từ chối
        /// </summary>
        /// <param name="ret"></param>
        private void afterRefuse(bool ret,
                                 List <int> listId,
                                 List <ClientResponseDetail> listClientResponseDetail)
        {
            if (ret)
            {
                LMessage.ShowMessage("M.DungChung.TuChoiDuyetThanhCong", LMessage.MessageBoxType.Information);
                LoadDuLieu();
            }
            else
            {
                //LMessage.ShowMessage("M.DungChung.TuChoiDuyetKhongThanhCong", LMessage.MessageBoxType.Warning);
                CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                LoadDuLieu();
            }

            // Yêu cầu unlock dữ liệu
            UtilitiesProcess process = new UtilitiesProcess();

            bool retUnlockData = process.UnlockData(this.Module,
                                                    this.Function,
                                                    this.Table,
                                                    DatabaseConstant.Action.TU_CHOI_DUYET,
                                                    listId);
        }
コード例 #17
0
        /// <summary>
        /// Sau khi xóa
        /// </summary>
        /// <param name="ret"></param>
        private void afterDelete(bool ret)
        {
            if (ret)
            {
                LMessage.ShowMessage("M.DungChung.XoaThanhCong", LMessage.MessageBoxType.Information);

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

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

            listLockId.Add(Id);
            List <int> listUnlockId = new List <int>();

            bool retUnlockData = process.UnlockData(DatabaseConstant.Module.DMDC,
                                                    DatabaseConstant.Function.DC_DM_TINH_THANH,
                                                    DatabaseConstant.Table.DC_TSUAT,
                                                    DatabaseConstant.Action.SUA,
                                                    listLockId);

            // Đóng cửa sổ chi tiết sau khi xóa
            onClose();
        }
コード例 #18
0
        /// <summary>
        /// Xóa dữ liệu
        /// </summary>
        private void onDelete(List <int> listId)
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = danhmucProcess.XoaNhom(listId.ToArray(), ref listClientResponseDetail);

                afterDelete(ret, listId, listClientResponseDetail);
            }
            catch (System.Exception ex)
            {
                // Yêu cầu unlock dữ liệu
                UtilitiesProcess process = new UtilitiesProcess();

                bool retUnlockData = process.UnlockData(this.Module,
                                                        this.Function,
                                                        this.Table,
                                                        DatabaseConstant.Action.XOA,
                                                        listId);
                this.Cursor = Cursors.Arrow;
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
コード例 #19
0
        private void Xoa()
        {
            if (tlbDelete.IsEnabled == false)
            {
                return;
            }
            Cursor = Cursors.Wait;
            List <int>       lstID       = new List <int>();
            UtilitiesProcess process     = new UtilitiesProcess();
            bool             retLockData = true;

            try
            {
                if (dgrVongVayDS.SelectedItems.Count > 0)
                {
                    if (LMessage.ShowMessage("M.DungChung.HoiXoa", LMessage.MessageBoxType.Question) == MessageBoxResult.Yes)
                    {
                        foreach (DataRowView dr in dgrVongVayDS.SelectedItems)
                        {
                            lstID.Add(Convert.ToInt32(dr["ID"]));
                        }
                        // Yêu cầu lock dữ liệu

                        retLockData = process.LockData(DatabaseConstant.Module.TDTT,
                                                       DatabaseConstant.Function.TDVM_VONG_VAY,
                                                       DatabaseConstant.Table.TD_VONG_VAY,
                                                       DatabaseConstant.Action.XOA,
                                                       lstID);
                        if (!retLockData)
                        {
                            return;
                        }
                        List <ClientResponseDetail> ResponseDetail = new List <ClientResponseDetail>();
                        bool bResult = new TinDungProcess().XoaVongVayTinDung(lstID.ToArray(), ref ResponseDetail);
                        if (bResult)
                        {
                            LoadDuLieu();
                        }
                        CommonFunction.ThongBaoKetQua(ResponseDetail);
                    }
                }
            }
            catch (Exception ex)
            {
                LMessage.ShowMessage("M.DanhMuc.LoiChung", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                // Yêu cầu Unlock dữ liệu
                retLockData = process.UnlockData(DatabaseConstant.Module.TDTT,
                                                 DatabaseConstant.Function.TDVM_VONG_VAY,
                                                 DatabaseConstant.Table.TD_VONG_VAY,
                                                 DatabaseConstant.Action.XOA,
                                                 lstID);
            }
            Cursor = Cursors.Arrow;
        }
コード例 #20
0
 void Xoa()
 {
     if (!tlbDelete.IsEnabled)
     {
         return;
     }
     Cursor = Cursors.Wait;
     try
     {
         if (raddgrHDTDDS.SelectedItems.Count > 0)
         {
             if (LMessage.ShowMessage("M.DungChung.HoiXoa", LMessage.MessageBoxType.Question) == MessageBoxResult.Yes)
             {
                 List <TD_HDTDVM> lstHDTDVM = new List <TD_HDTDVM>();
                 List <int>       lstID     = new List <int>();
                 foreach (DataRowView dr in raddgrHDTDDS.SelectedItems)
                 {
                     lstID.Add(Convert.ToInt32(dr["ID"]));
                     objHDTDVM.HDTD_VM           = new TD_HDTDVM();
                     objHDTDVM.HDTD_VM.ID        = Convert.ToInt32(dr["ID"]);
                     objHDTDVM.HDTD_VM.MA_HDTDVM = dr["MA_HDTDVM"].ToString();
                     objHDTDVM.HDTD_VM.TTHAI_NVU = dr["TTHAI_NVU"].ToString();
                     objHDTDVM.HDTD_VM.SO_GDICH  = dr["SO_GDICH"].ToString();
                     lstHDTDVM.Add(objHDTDVM.HDTD_VM);
                 }
                 objHDTDVM.DSACH_HDTD_VM = lstHDTDVM.ToArray();
                 // Yêu cầu lock dữ liệu
                 UtilitiesProcess process     = new UtilitiesProcess();
                 bool             retLockData = process.LockData(DatabaseConstant.Module.TDVM,
                                                                 DatabaseConstant.Function.TDVM_CHI_TIET_HOP_DONG,
                                                                 DatabaseConstant.Table.TD_HDTDVM,
                                                                 DatabaseConstant.Action.XOA,
                                                                 lstID);
                 List <ClientResponseDetail> ResponseDetail = new List <ClientResponseDetail>();
                 int bResult = new TinDungProcess().XoaHopDongTinDungViMo(objHDTDVM, ref ResponseDetail);
                 if (bResult == 1)
                 {
                     LoadData();
                 }
                 CommonFunction.ThongBaoKetQua(ResponseDetail);
                 // Yêu cầu Unlock dữ liệu
                 retLockData = process.UnlockData(DatabaseConstant.Module.TDVM,
                                                  DatabaseConstant.Function.TDVM_CHI_TIET_HOP_DONG,
                                                  DatabaseConstant.Table.TD_HDTDVM,
                                                  DatabaseConstant.Action.XOA,
                                                  lstID);
             }
         }
     }
     catch (Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
     Cursor = Cursors.Arrow;
 }
コード例 #21
0
        public void OnSave()
        {
            if (MessageBoxResult.Yes != LMessage.ShowMessage("M.KeToan.HoiTruocKhiLuuDoiTuongSoDu", LMessage.MessageBoxType.Question))
            {
                return;
            }
            Cursor = Cursors.Wait;
            List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();

            ApplicationConstant.ResponseStatus iret = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG;
            try
            {
                if (!Validation())
                {
                    return;
                }

                _obj = new DOI_TUONG_SDU_TKHOAN();
                GetFormData(ref _obj);
                action = DatabaseConstant.Action.LUU;
                // Yêu cầu lock bản ghi cần sửa
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(ID_TKHOAN);

                bool ret = process.LockData(DatabaseConstant.Module.GDKT,
                                            DatabaseConstant.Function.DC_DM_DTUONG_SODU,
                                            DatabaseConstant.Table.KT_TKHOAN,
                                            DatabaseConstant.Action.LUU,
                                            listLockId);
                iret = new KeToanProcess().DoiTuongSoDuCT(DatabaseConstant.Function.DC_DM_DTUONG_SODU, action, ref _obj, ref listClientResponseDetail);
                AfterSave(iret, listClientResponseDetail);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                // Yêu cầu lock bản ghi cần sửa
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(ID_TKHOAN);

                bool ret = process.UnlockData(DatabaseConstant.Module.GDKT,
                                              DatabaseConstant.Function.DC_DM_DTUONG_SODU,
                                              DatabaseConstant.Table.KT_TKHOAN,
                                              DatabaseConstant.Action.LUU,
                                              listLockId);
            }
            finally
            {
                Cursor = Cursors.Arrow;
            }
        }
コード例 #22
0
        private void AfterSave(BusinessConstant.TrangThaiNghiepVu nghiepvu, BusinessConstant.TrangThaiSuDung sudung)
        {
            try
            {
                Cursor = Cursors.Wait;
                if (!Validation() && nghiepvu.Equals(BusinessConstant.TrangThaiNghiepVu.CHO_DUYET))
                {
                    return;
                }
                DM_KHU_VUC obj = GetDataForm(nghiepvu, sudung);

                // Lock dữ liệu nếu người dùng chấp nhận cảnh báo
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(idKhuVuc);
                bool retLockData = true;
                if (idKhuVuc > 0)
                {
                    retLockData = process.LockData(DatabaseConstant.Module.DMDC,
                                                   DatabaseConstant.Function.DC_DM_KHU_VUC,
                                                   DatabaseConstant.Table.DM_KHU_VUC,
                                                   DatabaseConstant.Action.SUA,
                                                   listLockId);
                }
                if (retLockData)
                {
                    OnSave(obj);
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                Cursor = Cursors.Arrow;
                // Unlock dữ liệu nếu người dùng chấp nhận cảnh báo
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(idKhuVuc);
                bool retLockData = true;
                if (idKhuVuc > 0)
                {
                    retLockData = process.UnlockData(DatabaseConstant.Module.DMDC,
                                                     DatabaseConstant.Function.DC_DM_KHU_VUC,
                                                     DatabaseConstant.Table.DM_KHU_VUC,
                                                     DatabaseConstant.Action.SUA,
                                                     listLockId);
                }
            }
        }
コード例 #23
0
        private bool UnLock()
        {
            List <int> lstId = new List <int>();

            lstId.Add(idHDTC);
            UtilitiesProcess process = new UtilitiesProcess();

            return(process.UnlockData(DatabaseConstant.Module.TSDB,
                                      DatabaseConstant.Function.TDTD_HDTC_CT,
                                      DatabaseConstant.Table.TD_HDTC,
                                      action,
                                      lstId));
        }
コード例 #24
0
        /// <summary>
        /// Hàm xử lý giải phóng lock dữ liệu cho form
        /// </summary>
        private void Release()
        {
            // Yêu cầu unlock dữ liệu
            UtilitiesProcess process = new UtilitiesProcess();
            List<int> listLockId = new List<int>();
            listLockId.Add(id);

            bool ret = process.UnlockData(DatabaseConstant.Module.NSTL,
                DatabaseConstant.Function.NS_DM_LOAI_TNHAP_CT,
                DatabaseConstant.Table.NS_DM_LOAI_TNHAP,
                DatabaseConstant.Action.SUA,
                listLockId);
        }
コード例 #25
0
        public void BeforeDelete()
        {
            try
            {
                // Cảnh báo người dùng
                MessageBoxResult ret = LMessage.ShowMessage("M.DungChung.HoiXoa", LMessage.MessageBoxType.Question);

                if (ret == MessageBoxResult.Yes)
                {
                    // Lock dữ liệu nếu người dùng chấp nhận cảnh báo
                    UtilitiesProcess process    = new UtilitiesProcess();
                    List <int>       listLockId = new List <int>();
                    listLockId.Add(id);
                    List <int> listLockedId = new List <int>();

                    bool retLockData = process.LockData(DatabaseConstant.Module.NSTL,
                                                        DatabaseConstant.Function.NS_DM_DVI_TGIAN_CT,
                                                        DatabaseConstant.Table.NS_DM_DVI_TGIAN,
                                                        DatabaseConstant.Action.XOA,
                                                        listLockId);

                    if (retLockData)
                    {
                        action = DatabaseConstant.Action.XOA;
                        OnDelete();
                    }
                    else
                    {
                        LMessage.ShowMessage("M.ResponseMessage.Common.LockDataInvalid", LMessage.MessageBoxType.Information);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                // Yêu cầu unlock dữ liệu
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(id);
                List <int> listUnlockId = new List <int>();

                bool retUnlockData = process.UnlockData(DatabaseConstant.Module.NSTL,
                                                        DatabaseConstant.Function.NS_DM_DVI_TGIAN_CT,
                                                        DatabaseConstant.Table.NS_DM_DVI_TGIAN,
                                                        DatabaseConstant.Action.XOA,
                                                        listLockId);

                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
コード例 #26
0
        void AfterCancel(List <ClientResponseDetail> lstResponseDetail, int iret)
        {
            CommonFunction.ThongBaoKetQua(lstResponseDetail);
            // Yêu cầu Unlock dữ liệu
            UtilitiesProcess process     = new UtilitiesProcess();
            bool             retLockData = process.UnlockData(DatabaseConstant.Module.TDTD,
                                                              DatabaseConstant.Function.TDTD_HDTC_DS,
                                                              DatabaseConstant.Table.TDTD_HDTC,
                                                              DatabaseConstant.Action.THOAI_DUYET,
                                                              lstId);

            LoadDuLieu();
            Cursor = Cursors.Arrow;
        }
コード例 #27
0
        /// <summary>
        /// Hàm xử lý giải phóng lock dữ liệu cho form
        /// </summary>
        private void Release()
        {
            // Yêu cầu unlock dữ liệu
            UtilitiesProcess process    = new UtilitiesProcess();
            List <int>       listLockId = new List <int>();

            listLockId.Add(id);

            bool ret = process.UnlockData(DatabaseConstant.Module.QTHT,
                                          DatabaseConstant.Function.HT_NHNSD,
                                          DatabaseConstant.Table.HT_NHNSD,
                                          DatabaseConstant.Action.SUA,
                                          listLockId);
        }
コード例 #28
0
        void afterCancel(List <int> lstId, List <ClientResponseDetail> responseDetail)
        {
            CommonFunction.ThongBaoKetQua(responseDetail);
            LoadDuLieu();

            // Yêu cầu unlock dữ liệu
            UtilitiesProcess process = new UtilitiesProcess();

            bool retLockData = process.UnlockData(DatabaseConstant.Module.TIN_DUNG_VI_MO,
                                                  DatabaseConstant.Function.TD_DANH_SACH_HOP_DONG_THE_CHAP,
                                                  DatabaseConstant.Table.TD_HDTC,
                                                  DatabaseConstant.Action.THOAI_DUYET,
                                                  lstId);
        }
コード例 #29
0
        private List <string> Tuchoi(string listitem)
        {
            List <string> listResult = new List <string>();

            if (listitem != "")
            {
                List <int> lstID = new List <int>();
                string[]   str   = listitem.Split(';');
                if (str != null && str.Length > 0)
                {
                    for (int k = 0; k < str.Length; k++)
                    {
                        lstID.Add(Convert.ToInt32(str[k]));
                    }
                }
                List <ClientResponseDetail> ResponseDetail = new List <ClientResponseDetail>();
                UtilitiesProcess            process        = new UtilitiesProcess();
                if (process.LockData(DatabaseConstant.Module.TDVM,
                                     DatabaseConstant.Function.TDVM_SAN_PHAM_TDVM,
                                     DatabaseConstant.Table.TD_SAN_PHAM,
                                     DatabaseConstant.Action.TU_CHOI_DUYET,
                                     lstID))
                {
                    bool bResult = new TinDungProcess().TuChoiSanPhamTinDung(lstID, ref ResponseDetail);
                    if (bResult)
                    {
                        foreach (ClientResponseDetail cl in ResponseDetail)
                        {
                            listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0]));
                        }
                        // Yeu cau Unlook du lieu
                        process.UnlockData(DatabaseConstant.Module.TDVM,
                                           DatabaseConstant.Function.TDVM_SAN_PHAM_TDVM,
                                           DatabaseConstant.Table.TD_SAN_PHAM,
                                           DatabaseConstant.Action.TU_CHOI_DUYET,
                                           lstID);
                        LoadDuLieu();
                    }
                    else
                    {
                        listResult.Add("M.DungChung.DuyetKhongThanhCong#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong"));
                    }
                }
                else
                {
                    listResult.Add("M.ResponseMessage.Common.LockDataInvalid#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.ResponseMessage.Common.LockDataInvalid"));
                }
            }
            return(listResult);
        }
コード例 #30
0
        /// <summary>
        /// Hàm xử lý giải phóng lock dữ liệu cho form
        /// </summary>
        private void Release()
        {
            // Yêu cầu unlock dữ liệu
            UtilitiesProcess process    = new UtilitiesProcess();
            List <int>       listLockId = new List <int>();

            listLockId.Add(id);

            bool ret = process.UnlockData(DatabaseConstant.Module.DMDC,
                                          DatabaseConstant.Function.KTDL_MAPPING_MATK_CT,
                                          DatabaseConstant.Table.BC_MATK,
                                          DatabaseConstant.Action.SUA,
                                          listLockId);
        }