/// <summary>
        /// Tìm kiếm nâng cao
        /// </summary>
        private void TimKiem()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();
            KeToanProcess process = new KeToanProcess();

            try
            {
                HE_THONG_TKTH objHeThong = new HE_THONG_TKTH();
                if (process.HeThongTaiKhoanChiTiet(DatabaseConstant.Action.LOAD, ref objHeThong, ref lstResponse) == ApplicationConstant.ResponseStatus.THANH_CONG)
                {
                    raddgrDanhSachTK.ItemsSource = objHeThong.DSACHHTTLTHCT;
                    raddgrDanhSachTK.Rebind();
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                process = null;
            }

            Mouse.OverrideCursor = Cursors.Arrow;
        }
        private void onLoad()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            KeToanProcess process = new KeToanProcess();

            try
            {
                List <ClientResponseDetail>        listClientResponseDetail = new List <ClientResponseDetail>();
                ApplicationConstant.ResponseStatus ret = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG;
                objHeThong             = new HE_THONG_TKTH();
                objHeThong.HTTKTHCT    = new HT_TKTH_CTIET();
                objHeThong.HTTKTHCT.ID = id;
                if (process.HeThongTaiKhoanChiTiet(DatabaseConstant.Action.LOAD_DATA, ref objHeThong, ref listClientResponseDetail) == ApplicationConstant.ResponseStatus.THANH_CONG)
                {
                    LoadDuLieu();
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
                process = null;
            }
        }
        private int GetDataForm()
        {
            int iret = 1;

            try
            {
                if (objHeThong.IsNullOrEmpty())
                {
                    objHeThong = new HE_THONG_TKTH();
                }
                if (objHeThong.HTTKTHCT.IsNullOrEmpty())
                {
                    objHeThong.HTTKTHCT = new HT_TKTH_CTIET();
                }
                objHeThong.HTTKTHCT.ID         = id;
                objHeThong.HTTKTHCT.MA_DVI_QLY = ClientInformation.MaDonVi;
                objHeThong.HTTKTHCT.MA_DVI_TAO = ClientInformation.MaDonViGiaoDich;
                objHeThong.HTTKTHCT.MA_HT_TKTH = txtMaHeThongTaiKhoan.Text;
                objHeThong.HTTKTHCT.NGAY_ADUNG = dtNgayHieuLuc.Value.GetValueOrDefault().ToString(ApplicationConstant.defaultDateTimeFormat);
                if (!dtNgayHetHieuLuc.Value.IsNullOrEmpty())
                {
                    objHeThong.HTTKTHCT.NGAY_HET_HLUC = dtNgayHetHieuLuc.Value.GetValueOrDefault().ToString(ApplicationConstant.defaultDateTimeFormat);
                }
                objHeThong.HTTKTHCT.NGAY_NHAP    = ClientInformation.NgayLamViecHienTai;
                objHeThong.HTTKTHCT.NGUOI_NHAP   = ClientInformation.TenDangNhap;
                objHeThong.HTTKTHCT.NGUON_TAO_DL = "HTH";
                objHeThong.HTTKTHCT.TEN_HT_TKTH  = txtTenHeThongTaiKhoan.Text;
                objHeThong.HTTKTHCT.TTHAI_BGHI   = BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri();
                objHeThong.HTTKTHCT.TTHAI_NVU    = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();
                List <int> lstID = new List <int>();
                lstID.Add(id);
                objHeThong.DSACHID = lstID.ToArray();
                if (id > 0)
                {
                    objHeThong.HTTKTHCT.NGAY_CNHAT  = ClientInformation.NgayLamViecHienTai;
                    objHeThong.HTTKTHCT.NGUOI_CNHAT = ClientInformation.TenDangNhap;
                }
            }
            catch (Exception ex)
            {
                iret = 0;
                LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            return(iret);
        }
        /// <summary>
        /// Xử lý xóa dữ liệu
        /// </summary>
        private void Xoa()
        {
            try
            {
                KeToanProcess process     = new KeToanProcess();
                List <int>    lstKtTkhoan = new List <int>();
                List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();
                Mouse.OverrideCursor = Cursors.Wait;
                try
                {
                    foreach (HT_TKTH_CTIET dr in raddgrDanhSachTK.SelectedItems)
                    {
                        lstKtTkhoan.Add(dr.ID);
                    }

                    if (lstKtTkhoan.Count == 0)
                    {
                        LMessage.ShowMessage("M.DungChung.ChuaChonBanGhi", LMessage.MessageBoxType.Warning);
                        return;
                    }

                    MessageBoxResult messResult = LMessage.ShowMessage("M.DungChung.HoiXoa", LMessage.MessageBoxType.Question);
                    if (messResult == MessageBoxResult.Yes)
                    {
                        HE_THONG_TKTH objHeThong = new HE_THONG_TKTH();
                        objHeThong.DSACHID = lstKtTkhoan.ToArray();
                        ApplicationConstant.ResponseStatus ret = process.HeThongTaiKhoanChiTiet(DatabaseConstant.Action.XOA, ref objHeThong, ref lstResponse);
                        CommonFunction.ThongBaoKetQua(lstResponse);
                        TimKiem();
                    }
                }
                catch (System.Exception ex)
                {
                    this.Cursor = Cursors.Arrow;
                    CommonFunction.ThongBaoLoi(ex);
                    LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                }
                Mouse.OverrideCursor = Cursors.Arrow;
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }