/// <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 List <string> XuLy(string listitem, DatabaseConstant.Action action, string alert)
        {
            List <string> listResult = new List <string>();
            List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();

            if (listitem != "")
            {
                List <KT_PLOAI> lstKtPloai = new List <KT_PLOAI>();
                string[]        str        = listitem.Split(';');
                if (str != null && str.Length > 0)
                {
                    for (int k = 0; k < str.Length; k++)
                    {
                        KT_PLOAI obj = new KT_PLOAI();
                        obj.ID = Convert.ToInt32(str[k]);
                        lstKtPloai.Add(obj);
                    }
                }

                bool bResult = new KeToanProcess().XuLyPhanLoaiTaiKhoanDS(lstKtPloai.ToArray(), ref lstResponse, action);
                if (bResult)
                {
                    foreach (ClientResponseDetail cl in lstResponse)
                    {
                        listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0]));
                    }
                }
                else
                {
                    listResult.Add(alert + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong"));
                }
            }
            return(listResult);
        }
示例#3
0
        private void TimKiemDuLieu()
        {
            AutoCompleteEntry au      = lstSourcePGD.ElementAt(cmbPhongGDich.SelectedIndex);
            string            maDonVi = au.KeywordStrings.FirstOrDefault();

            try
            {
                lst = new List <GHI_SO_KBAO>();
                DataSet ds = new KeToanProcess().getThongTinChungTuGhiSoKBao(maDonVi, ClientInformation.MaDonVi);
                if (!LObject.IsNullOrEmpty(ds) && ds.Tables.Count > 0)
                {
                    DataTable dt = ds.Tables["TKHOAN_KBAO"];
                    foreach (DataRow drv in dt.Rows)
                    {
                        GHI_SO_KBAO objGhiSo = new GHI_SO_KBAO();
                        objGhiSo.CO           = drv["CO"].ToString();
                        objGhiSo.MA_DVI_QLY   = drv["MA_DVI_QLY"].ToString();
                        objGhiSo.MA_DVI_TAO   = drv["MA_DVI_TAO"].ToString();
                        objGhiSo.MA_PLOAI     = drv["MA_PLOAI"].ToString();
                        objGhiSo.MA_PLOAI_CHA = drv["MA_PLOAI_CHA"].ToString();
                        objGhiSo.NO           = drv["NO"].ToString();
                        objGhiSo.TATCA        = drv["TATCA"].ToString();
                        objGhiSo.TEN_PLOAI    = drv["TEN_PLOAI"].ToString();
                        lst.Add(objGhiSo);
                    }
                    raddgrTaiKhoan.ItemsSource = lst;
                    raddgrTaiKhoan.Rebind();
                }
            }
            catch (Exception ex)
            {
            }
        }
示例#4
0
        /// <summary>
        /// Lưu dữ liệu (hay trình duyệt)
        /// </summary>
        private void onSave()
        {
            raddgrTaiKhoan.CommitEdit();
            if (Validation())
            {
                KeToanProcess process = new KeToanProcess();
                try
                {
                    ApplicationConstant.ResponseStatus ret = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG;
                    List <ClientResponseDetail>        listResponseDetail = new List <ClientResponseDetail>();
                    // Dữ liệu truyền vào và dữ liệu trả về

                    this.Cursor = Cursors.Wait;
                    if (GetDataForm())
                    {
                        ret = process.ChungTuGhiSoKBao(DatabaseConstant.Function.KT_CHUNG_TU_GHI_SO, DatabaseConstant.Action.THEM, ref obj, ref listResponseDetail);
                        afterSave(ret, obj, listResponseDetail);
                    }
                }
                catch (System.Exception ex)
                {
                    this.Cursor = Cursors.Arrow;
                    CommonFunction.ThongBaoLoi(ex);
                    LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                }
                finally
                {
                    this.Cursor = Cursors.Arrow;
                    process     = null;
                }
            }
        }
        /// <summary>
        /// Khoi tao combobox
        /// </summary>
        private void InitCombobox()
        {
            AutoComboBox auto = new AutoComboBox();
            List<string> lstDK = new List<string>();
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                // Khởi tạo điều kiện gọi danh mục
                List<string> lstDieuKien = new List<string>();

                // khởi tạo combobox
                auto.GenAutoComboBox(ref lstSourceDonVi, ref cmbChiNhanh, DatabaseConstant.DanhSachTruyVan.COMBOBOX_CNHANH.getValue(), lstDieuKien, ClientInformation.MaDonVi);
                dtTuNgay.Value = ClientInformation.NgayLamViecHienTai.StringToDate(ApplicationConstant.defaultDateTimeFormat);
                DataTable dt=null;
                LDatatable.MakeParameterTable(ref dt);
                DataSet ds = new KeToanProcess().getDanhSachTongHop(dt);
                raddgrDoiTuongTK.ItemsSource = ds.Tables[0].DefaultView;
                raddgrDoiTuongTK.Rebind();
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
        private List <string> XuLy(string listitem, DatabaseConstant.Action action, string alert)
        {
            List <string> listResult = new List <string>();
            List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();

            if (listitem != "")
            {
                List <KT_TKHOAN> lstKtTkhoan = new List <KT_TKHOAN>();
                string[]         str         = listitem.Split(';');
                if (str != null && str.Length > 0)
                {
                    for (int k = 0; k < str.Length; k++)
                    {
                        KT_TKHOAN obj = new KT_TKHOAN();
                        obj.ID = Convert.ToInt32(str[k]);
                        lstKtTkhoan.Add(obj);
                    }
                }

                ApplicationConstant.ResponseStatus bResult = new KeToanProcess().TaiKhoanChiTietDS(action, lstKtTkhoan, ref lstResponse);
                if (bResult == ApplicationConstant.ResponseStatus.THANH_CONG)
                {
                    foreach (ClientResponseDetail cl in lstResponse)
                    {
                        listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0]));
                    }
                }
                else
                {
                    listResult.Add(alert + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong"));
                }
            }
            return(listResult);
        }
示例#7
0
        /// <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
            {
                TKTONGHOP objHeThong = new TKTONGHOP();
                objHeThong.HTTKTHCT = new TKTONGHOP_CTIET();
                if (cmbDonVi.SelectedIndex < 0)
                {
                    return;
                }
                AutoCompleteEntry au = lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex);
                objHeThong.HTTKTHCT.MA_HT_TKTH = au.KeywordStrings.FirstOrDefault();
                if (process.TaiKhoanTongHop(DatabaseConstant.Action.LOAD, ref objHeThong, ref lstResponse) == ApplicationConstant.ResponseStatus.THANH_CONG)
                {
                    dtMaPhanLoai = objHeThong;
                    TaoTreeView();
                }
            }
            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 BuildTree()
        {
            KeToanProcess process = new KeToanProcess();

            try
            {
                tvwLoaiGD.Nodes.Clear();
                DataSet ds = process.getTreePhanHeGD(AppConfig.LoginedUser.UserName, AppConfig.LoginedUser.MaDonViQuanLy);
                if (ds != null && ds.Tables.Count > 0)
                {
                    DataView v_dv = ds.Tables[0].DefaultView;
                    v_dv.RowFilter = "ID_PHAN_HE_CHA IS NULL";
                    if (v_dv.Count > 0)
                    {
                        for (int i = 0; i < v_dv.Count; i++)
                        {
                            TreeNode v_objNode = new TreeNode();
                            v_objNode.Text  = v_dv[i]["TEN_PHAN_HE"].ToString();
                            v_objNode.Value = v_dv[i]["ID_PHAN_HE"].ToString() + "|" + v_dv[i]["TEN_BANG"].ToString();
                            if (i == 0)
                            {
                                v_objNode.Selected = true;
                            }
                            BuidSubNode(v_objNode, v_dv);
                            tvwLoaiGD.Nodes.Add(v_objNode);
                        }
                    }
                }
            }
            catch
            {
            }

            tvwLoaiGD.ExpandAll();
        }
        private void LoadDetailGrid()
        {
            string v_strMaDonVi    = "";
            string v_strIDGiaoDich = hdIDGD.Value;

            foreach (ListItem v_objItem in cmbDonVi.Items)
            {
                if (v_objItem.Value.Contains(cmbDonVi.SelectedValue))
                {
                    v_strMaDonVi += "''" + v_objItem.Value + "'',";
                }
            }

            if (v_strMaDonVi.EndsWith(","))
            {
                v_strMaDonVi = v_strMaDonVi.Substring(0, v_strMaDonVi.Length - 1);
            }
            v_strMaDonVi = "(" + v_strMaDonVi + ")";
            if (v_strIDGiaoDich.Length > 0)
            {
                DataSet ds = new KeToanProcess().getDanhSachGiaoDichCT(v_strMaDonVi, v_strIDGiaoDich);
                if ((null != ds) && (ds.Tables.Count > 0))
                {
                    grdChiTietGD.DataSource = ds.Tables[0];
                    grdChiTietGD.DataBind();
                }
            }
        }
        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;
            }
        }
示例#11
0
        private void OnProccess(BusinessConstant.NGHIEP_VU_CUOI_NGAY maNghiepVu)
        {
            KeToanProcess proccess = new KeToanProcess();

            try
            {
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                afterModify(proccess.ThucHienCuoiNgay(maNghiepVu, DatabaseConstant.Action.THUC_HIEN, ref listClientResponseDetail, ClientInformation.MaDonVi));
                if (listClientResponseDetail.Count > 0)
                {
                    DataTable dt = new DataTable();
                    dt.Columns.Add("STT", typeof(string));
                    dt.Columns.Add("OBJECT", typeof(string));
                    dt.Columns.Add("RESULT", typeof(string));
                    dt.Columns.Add("DETAIL", typeof(string));
                    foreach (ClientResponseDetail detail in listClientResponseDetail)
                    {
                        dt.NewRow();
                        dt.Rows.Add(detail.Stt, detail.Object, detail.Result, detail.Detail);
                    }
                    raddgrGiaoDichLoi.ItemsSource = dt;
                }
            }
            catch (System.Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                proccess = null;
            }
        }
示例#12
0
        /// <summary>
        /// Xử lý xóa dữ liệu
        /// </summary>
        private void Xoa()
        {
            try
            {
                KeToanProcess               process     = new KeToanProcess();
                List <KT_PLOAI>             lstKtPloai  = new List <KT_PLOAI>();
                List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();

                Mouse.OverrideCursor = Cursors.Wait;
                try
                {
                    for (int i = 0; i < raddgrPhanLoaiTK.Items.Count; i++)
                    {
                        DataRowView dr = (DataRowView)raddgrPhanLoaiTK.Items[i];
                        if (Convert.ToBoolean(dr["CHON"]) == true)
                        {
                            KT_PLOAI obj = new KT_PLOAI();
                            obj.ID       = Convert.ToInt32(dr["ID"]);
                            obj.MA_PLOAI = dr["MA_PLOAI"].ToString();
                            lstKtPloai.Add(obj);
                        }
                    }

                    if (lstKtPloai.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)
                    {
                        bool ret = process.XuLyPhanLoaiTaiKhoanDS(lstKtPloai.ToArray(), ref lstResponse, DatabaseConstant.Action.XOA);
                        if (!ret)
                        {
                            LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                        }
                        else
                        {
                            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);
            }
        }
示例#13
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;
            }
        }
示例#14
0
        private void BuildTree()
        {
            tvwPhanLoai.Nodes.Clear();

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

            try
            {
                string maDonVi = cmbDonVi.SelectedItem.Value;
                if (maDonVi != null)
                {
                    //trvPhanLoai.Items.Clear();
                    DataSet ds = process.getDanhSachMaPhanLoai(maDonVi, "(''" + BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri() + "'')", BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(), "%");

                    tvwPhanLoai.Nodes.Clear();
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        DataView v_dv = ds.Tables[0].DefaultView;
                        v_dv.RowFilter = "MA_PLOAI_CHA = ''";
                        if (v_dv.Count > 0)
                        {
                            for (int i = 0; i < v_dv.Count; i++)
                            {
                                TreeNode v_objNode = new TreeNode();
                                v_objNode.Text  = v_dv[i]["TEN_PLOAI"].ToString();
                                v_objNode.Value = v_dv[i]["MA_PLOAI"].ToString();
                                if (i == 0)
                                {
                                    v_objNode.Selected = true;
                                }
                                BuidSubNode(v_objNode, v_dv);
                                tvwPhanLoai.Nodes.Add(v_objNode);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                au      = null;
                process = null;
            }

            tvwPhanLoai.CollapseAll();
            tvwPhanLoai.ShowCheckBoxes = TreeNodeTypes.All;
        }
示例#15
0
        void LoadDulieu()
        {
            AutoComboBox au = new AutoComboBox();

            try
            {
                DataTable         dtBaoCao = null;
                AutoCompleteEntry auDonVi  = au.getEntryByDisplayName(lstSourceDonVi, ref cmbDonVi);
                LDatatable.MakeParameterTable(ref dtBaoCao);
                string maPhanLoai = "(";
                foreach (object item in trvPhanLoai.CheckedItems)
                {
                    DataRowView dr = item as DataRowView;
                    if (dr["MA_PLOAI"].ToString().Length != 1)
                    {
                        maPhanLoai += "''" + dr["MA_PLOAI"].ToString() + "'',";
                    }
                }

                if (trvPhanLoai.CheckedItems.Count > 0)
                {
                    maPhanLoai = maPhanLoai.Substring(0, maPhanLoai.Length - 1) + ")";
                }
                else
                {
                    maPhanLoai = "";
                }
                string ngayHluc = "";
                if (teldtNgayHieuLuc.Value.HasValue)
                {
                    ngayHluc = teldtNgayHieuLuc.Value.GetValueOrDefault().ToString(ApplicationConstant.defaultDateTimeFormat);
                }
                LDatatable.AddParameter(ref dtBaoCao, "@MaDViTao", "STRING", auDonVi.KeywordStrings.FirstOrDefault());
                LDatatable.AddParameter(ref dtBaoCao, "@MaDViQLy", "STRING", ClientInformation.MaDonViQuanLy);
                LDatatable.AddParameter(ref dtBaoCao, "@MaPhanLoai", "STRING", ClientInformation.MaDonViQuanLy);
                LDatatable.AddParameter(ref dtBaoCao, "@MaSo", "STRING", txtMaSo.Text);
                LDatatable.AddParameter(ref dtBaoCao, "@TenSo", "STRING", txtTenSo.Text);
                LDatatable.AddParameter(ref dtBaoCao, "@TinhChat", "STRING", cmbTinhChat.SelectedValue.ToString());
                LDatatable.AddParameter(ref dtBaoCao, "@NgayHLuc", "STRING", ngayHluc);

                DataSet   ds = new KeToanProcess().GetDSGhiSoKBao(dtBaoCao);
                DataTable dt = ds.Tables["DANH_SACH"];
                grdGhiSoTKhoan.ItemsSource = dt.DefaultView;
            }
            catch (Exception ex)
            {
            }
        }
        /// <summary>
        /// Xử lý xóa dữ liệu
        /// </summary>
        private void Xoa()
        {
            try
            {
                KeToanProcess               process     = new KeToanProcess();
                List <KT_TKHOAN>            lstKtTkhoan = new List <KT_TKHOAN>();
                List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();

                Mouse.OverrideCursor = Cursors.Wait;
                try
                {
                    foreach (DataRowView dr in raddgrDanhSachTK.SelectedItems)
                    {
                        KT_TKHOAN obj = new KT_TKHOAN();
                        obj.ID           = Convert.ToInt32(dr["ID"]);
                        obj.SO_TAI_KHOAN = dr["SO_TAI_KHOAN"].ToString();
                        lstKtTkhoan.Add(obj);
                    }

                    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)
                    {
                        ApplicationConstant.ResponseStatus ret = process.TaiKhoanChiTietDS(DatabaseConstant.Action.XOA, lstKtTkhoan, 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);
            }
        }
示例#17
0
        private void LoadDuLieu()
        {
            try
            {
                KeToanProcess ketoanProcess = new KeToanProcess();
                string        maDonVi       = cmbDonVi.SelectedItem.Value;
                string        MaTTNVu       = "";

                if (cbChoduyet.Checked)
                {
                    MaTTNVu = MaTTNVu + "''" + cbChoduyet.Value + "'',";
                }
                if (cbDaduyet.Checked)
                {
                    MaTTNVu = MaTTNVu + "''" + cbDaduyet.Value + "'',";
                }
                if (cbThoaiduyet.Checked)
                {
                    MaTTNVu = MaTTNVu + "''" + cbThoaiduyet.Value + "'',";
                }
                if (cbDaduyet.Checked)
                {
                    MaTTNVu = MaTTNVu + "''" + cbDaduyet.Value + "'',";
                }
                if (MaTTNVu != "")
                {
                    MaTTNVu = "(" + MaTTNVu.Substring(0, MaTTNVu.Length - 1) + ")";
                }
                string ListMaPloai = "";
                foreach (TreeNode item in tvwPhanLoai.CheckedNodes)
                {
                    ListMaPloai += item.Value.ToString() + ",";
                }
                if (ListMaPloai.Length > 0)
                {
                    ListMaPloai = "(" + ListMaPloai.Substring(1) + ")";
                }

                grdPhanLoaiDS.DataSource = ketoanProcess.getDanhSachMaPhanLoai(maDonVi, MaTTNVu, BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(), ListMaPloai);
                grdPhanLoaiDS.DataBind();
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
        /// <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);
            }
        }
示例#19
0
        private void LoadDuLieu()
        {
            try
            {
                KeToanProcess process = new KeToanProcess();
                string        maDonVi = "(''" + cmbDonVi.SelectedItem.Value + "'',";
                maDonVi = maDonVi.Substring(0, maDonVi.Length - 1) + ")";

                string ngayDL = "";
                if (teldtSoDuNgay.Text != "")
                {
                    ngayDL = LDateTime.DateToString(LDateTime.StringToDate(teldtSoDuNgay.Text, "dd/MM/yyyy"), ApplicationConstant.defaultDateTimeFormat);
                }

                string ListMaPloai = "";
                foreach (TreeNode item in tvwPhanLoai.CheckedNodes)
                {
                    ListMaPloai += "''" + item.Value.ToString() + "'',";
                }
                if (ListMaPloai.Length > 0)
                {
                    ListMaPloai = "(" + ListMaPloai.Substring(0, ListMaPloai.Length - 1) + ")";
                }

                DataTable dtThamSo = null;
                LDatatable.MakeParameterTable(ref dtThamSo);
                LDatatable.AddParameter(ref dtThamSo, "@MaDonVi", "STRING", maDonVi);
                LDatatable.AddParameter(ref dtThamSo, "@MaPhanLoai", "STRING", ListMaPloai);
                LDatatable.AddParameter(ref dtThamSo, "@MaTK", "STRING", txtMaPhanLoaiTK.Text);
                LDatatable.AddParameter(ref dtThamSo, "@TenTK", "STRING", "");
                LDatatable.AddParameter(ref dtThamSo, "@NgayDL", "STRING", ngayDL);
                LDatatable.AddParameter(ref dtThamSo, "@SoDuTu", "DECIMAL", "0");
                LDatatable.AddParameter(ref dtThamSo, "@SoDuDen", "DECIMAL", "0");
                LDatatable.AddParameter(ref dtThamSo, "@TinhChat", "STRING", "");

                grdTaiKhoanDS.DataSource = process.getDanhSachTaiKhoanChiTiet(dtThamSo, "DANH_SACH");
                grdTaiKhoanDS.DataBind();
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
        private void onSave()
        {
            string trangThai = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();

            if (Validation())
            {
                KeToanProcess process = new KeToanProcess();
                try
                {
                    List <ClientResponseDetail>        listClientResponseDetail = new List <ClientResponseDetail>();
                    ApplicationConstant.ResponseStatus ret = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG;
                    // Dữ liệu truyền vào và dữ liệu trả về

                    Mouse.OverrideCursor = Cursors.Wait;
                    if (GetDataForm() == 1)
                    {
                        if (process.HeThongTaiKhoanChiTiet(DatabaseConstant.Action.THEM, ref objHeThong, ref listClientResponseDetail) == ApplicationConstant.ResponseStatus.THANH_CONG)
                        {
                            CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                            LoadDuLieu();
                            SetEnableControl(false);
                            action = DatabaseConstant.Action.XEM;
                            CommonFunction.RefreshButton(Toolbar, action, objHeThong.HTTKTHCT.TTHAI_NVU, mnuMain, DatabaseConstant.Function.KT_HE_THONG_TKTH);
                        }
                        else
                        {
                            CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                        }
                    }
                }
                catch (System.Exception ex)
                {
                    this.Cursor = Cursors.Arrow;
                    CommonFunction.ThongBaoLoi(ex);
                    LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                }
                finally
                {
                    process = null;
                }
            }
        }
        private void onDelete()
        {
            string trangThai = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();

            if (Validation())
            {
                KeToanProcess process = new KeToanProcess();
                try
                {
                    List <ClientResponseDetail>        listClientResponseDetail = new List <ClientResponseDetail>();
                    ApplicationConstant.ResponseStatus ret = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG;
                    // Dữ liệu truyền vào và dữ liệu trả về

                    Mouse.OverrideCursor = Cursors.Wait;
                    if (GetDataForm() == 1)
                    {
                        if (process.HeThongTaiKhoanChiTiet(DatabaseConstant.Action.THEM, ref objHeThong, ref listClientResponseDetail) == ApplicationConstant.ResponseStatus.THANH_CONG)
                        {
                            CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                            this.onClose();
                        }
                        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;
                }
            }
        }
示例#22
0
        private void LoadGDGrid()
        {
            string v_strMaDonVi = "";
            string v_strMaPhanHe = "", v_strLoaiPhanHe = "", v_strTrangThai = "";
            string v_strTuNgay  = teldtNgayGDTu.Text.Trim();
            string v_strDenNgay = teldtNgayGDDen.Text.Trim();
            string v_strSoGD    = tetxSoGiaoDich.Text.Trim();
            string v_strSoPhieu = tetxSoPhieu.Text.Trim();

            foreach (ListItem v_objItem in cmbDonVi.Items)
            {
                if (v_objItem.Value.Contains(cmbDonVi.SelectedValue))
                {
                    v_strMaDonVi += "''" + v_objItem.Value + "'',";
                }
            }

            if (v_strMaDonVi.EndsWith(","))
            {
                v_strMaDonVi = v_strMaDonVi.Substring(0, v_strMaDonVi.Length - 1);
            }
            v_strMaDonVi = "(" + v_strMaDonVi + ")";

            string v_strTreeVal = "";

            if (null != tvwLoaiGD.SelectedNode)
            {
                v_strTreeVal    = tvwLoaiGD.SelectedNode.Value;
                v_strMaPhanHe   = v_strTreeVal.Split('|')[0];
                v_strLoaiPhanHe = v_strTreeVal.Split('|')[1];
            }

            if (cbChoduyet.Checked)
            {
                v_strTrangThai = v_strTrangThai + "''" + cbChoduyet.Value + "'',";
            }
            if (cbDaduyet.Checked)
            {
                v_strTrangThai = v_strTrangThai + "''" + cbDaduyet.Value + "'',";
            }
            if (cbThoaiduyet.Checked)
            {
                v_strTrangThai = v_strTrangThai + "''" + cbThoaiduyet.Value + "'',";
            }
            if (cbDaduyet.Checked)
            {
                v_strTrangThai = v_strTrangThai + "''" + cbDaduyet.Value + "'',";
            }
            if (v_strTrangThai != "")
            {
                v_strTrangThai = "(" + v_strTrangThai.Substring(0, v_strTrangThai.Length - 1) + ")";
            }

            if (!Utils.IsDate(v_strTuNgay, "dd/MM/yyyy"))
            {
                v_strTuNgay = AppConfig.LoginedUser.NgayLamViecHienTai;
            }
            else
            {
                v_strTuNgay = DateTime.ParseExact(v_strTuNgay, "dd/MM/yyyy", null).ToString("yyyyMMdd");
            }

            if (!Utils.IsDate(v_strDenNgay, "dd/MM/yyyy"))
            {
                v_strDenNgay = AppConfig.LoginedUser.NgayLamViecHienTai;
            }
            else
            {
                v_strDenNgay = DateTime.ParseExact(v_strDenNgay, "dd/MM/yyyy", null).ToString("yyyyMMdd");
            }

            DataTable dt = null;

            LDatatable.MakeParameterTable(ref dt);
            LDatatable.AddParameter(ref dt, "@MaDonVi", "STRING", v_strMaDonVi);
            LDatatable.AddParameter(ref dt, "@MaPhanHe", "STRING", v_strMaPhanHe);
            LDatatable.AddParameter(ref dt, "@LoaiPhanHe", "STRING", v_strLoaiPhanHe);
            LDatatable.AddParameter(ref dt, "@TrangThai", "STRING", v_strTrangThai);
            LDatatable.AddParameter(ref dt, "@TuNgay", "STRING", v_strTuNgay);
            LDatatable.AddParameter(ref dt, "@DenNgay", "STRING", v_strDenNgay);
            LDatatable.AddParameter(ref dt, "@SoGD", "STRING", v_strSoGD);
            LDatatable.AddParameter(ref dt, "@SoPhieu", "STRING", v_strSoPhieu);
            LDatatable.AddParameter(ref dt, "@StartRow", "INT", "1");
            LDatatable.AddParameter(ref dt, "@EndRow", "INT", "1000000000");
            LDatatable.AddParameter(ref dt, "@UserName", "STRING", AppConfig.LoginedUser.UserName);
            LDatatable.AddParameter(ref dt, "@MaDViQLy", "STRING", AppConfig.LoginedUser.MaDonViQuanLy);
            DataSet ds = new KeToanProcess().getDanhSachGiaoDich(dt);

            if ((null != ds) && (ds.Tables.Count > 0))
            {
                ds.Tables[0].Columns.Add("URL", typeof(string));
                ds.Tables[0].Columns.Add("TRANG_THAI_DT", typeof(string));

                DataTable v_dt = AppConfig.LoginedUser.CayMenu;
                DataView  v_dv = v_dt.DefaultView;

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    string v_strMa_CNANG = "";
                    switch (dr["MA_LOAI_GDICH"].ToString())
                    {
                    case "GT01":
                    {
                        v_strMa_CNANG = "WEB_522_GUI_THEM_TIEN";
                        break;
                    }

                    case "GT02":
                    {
                        v_strMa_CNANG = "WEB_522_GUI_THEM_TIEN_TUNG_SO";
                        break;
                    }
                    }
                    string v_strID  = dr["ID"].ToString();
                    string v_strURL = "";

                    if (dr["SO_GDICH"].ToString() == "GD201610000112")
                    {
                        v_dv.RowFilter = "";
                    }

                    v_dv.RowFilter = "";
                    v_dv.RowFilter = "MA_CNANG='" + v_strMa_CNANG + "'";
                    if (v_dv.Count > 0)
                    {
                        if (DBNull.Value != v_dv[0]["URL"])
                        {
                            v_strURL = v_dv[0]["URL"].ToString();
                            if (v_strURL.Contains("&"))
                            {
                                v_strURL = v_strURL.Substring(0, v_strURL.IndexOf("&"));
                            }
                        }
                    }
                    v_dv.RowFilter = "";
                    dr["URL"]      = v_strURL.Replace("~", "");

                    string v_strTT = "";
                    switch (dr["TRANG_THAI"].ToString())
                    {
                    case "DDU":
                    {
                        v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.DaDuyet");
                        break;
                    }

                    case "CDU":
                    {
                        v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.ChoDuyet");
                        break;
                    }

                    case "TCD":
                    {
                        v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.TuChoi");
                        break;
                    }

                    case "THD":
                    {
                        v_strTT = LanguageEngine.Instance().GetContent(LanguageType.TypeUI, "U.DungChung.TrangThaiNghiepVu.ThoaiDuyet");
                        break;
                    }
                    }

                    dr["TRANG_THAI_DT"] = v_strTT;
                }

                ListGiaoDich             = ds.Tables[0];
                grdKiemSoatDS.DataSource = ds.Tables[0];
                grdKiemSoatDS.DataBind();
            }
        }
        /// <summary>
        /// Tìm kiếm nâng cao
        /// </summary>
        private void TimKiem()
        {
            Mouse.OverrideCursor = Cursors.Wait;

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

            try
            {
                if (cmbDonVi.SelectedIndex < 0)
                {
                    return;
                }

                AutoCompleteEntry auDonVi = au.getEntryByDisplayName(lstSourceDonVi, ref cmbDonVi);

                string maDonVi    = "(";
                string ngayDL     = "";
                string maPhanLoai = "(";
                string tinhChatTK = "";


                string maChon = lstSourceDonVi.ElementAt(cmbDonVi.SelectedIndex).KeywordStrings.ElementAt(0);
                string donVi  = "";
                foreach (AutoCompleteEntry item in lstSourceDonVi)
                {
                    donVi = item.KeywordStrings.ElementAt(0);
                    if (donVi.Contains(maChon))
                    {
                        maDonVi += "''" + donVi + "'',";
                    }
                }
                maDonVi = maDonVi.Substring(0, maDonVi.Length - 1) + ")";


                foreach (object item in trvPhanLoai.CheckedItems)
                {
                    DataRowView dr = item as DataRowView;
                    if (dr["MA_PLOAI"].ToString().Length != 1)
                    {
                        maPhanLoai += "''" + dr["MA_PLOAI"].ToString() + "'',";
                    }
                }

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

                if (raddtSoDuNgay.Value != null)
                {
                    ngayDL = Convert.ToDateTime(raddtSoDuNgay.Value).ToString("yyyyMMdd");
                }

                DataTable dtThamSo = null;
                LDatatable.MakeParameterTable(ref dtThamSo);
                LDatatable.AddParameter(ref dtThamSo, "@MaDonVi", "STRING", maDonVi);
                LDatatable.AddParameter(ref dtThamSo, "@MaPhanLoai", "STRING", maPhanLoai);
                LDatatable.AddParameter(ref dtThamSo, "@MaTK", "STRING", txtMaPhanLoaiTK.Text);
                LDatatable.AddParameter(ref dtThamSo, "@TenTK", "STRING", "");
                LDatatable.AddParameter(ref dtThamSo, "@NgayDL", "STRING", ngayDL);
                LDatatable.AddParameter(ref dtThamSo, "@SoDuTu", "DECIMAL", "0");
                LDatatable.AddParameter(ref dtThamSo, "@SoDuDen", "DECIMAL", "0");
                LDatatable.AddParameter(ref dtThamSo, "@TinhChat", "STRING", tinhChatTK);

                DataSet ds = process.getDanhSachTaiKhoanChiTiet(dtThamSo, "DANH_SACH");
                raddgrDanhSachTK.ItemsSource = null;
                if (ds != null && ds.Tables.Count > 0)
                {
                    raddgrDanhSachTK.ItemsSource = ds.Tables[0].DefaultView;
                    lblSumSoTK.Content           = ds.Tables[0].Rows.Count.ToString("###,###,###");

                    decimal tongSoDu = 0;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        tongSoDu += Convert.ToDecimal(dr["SODU"]);
                    }
                    lblSumSoDu.Content = tongSoDu.ToString("###,###,###,###,###,###");
                }
            }
            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;
        }
示例#24
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;
        }
示例#25
0
        private void ThoaiDuyet()
        {
            try
            {
                KeToanProcess               process     = new KeToanProcess();
                List <KT_PLOAI>             lstKtPloai  = new List <KT_PLOAI>();
                List <ClientResponseDetail> lstResponse = new List <ClientResponseDetail>();
                lstLyDo = new List <TTHAI_LY_DO>();
                Mouse.OverrideCursor = Cursors.Wait;
                try
                {
                    for (int i = 0; i < raddgrPhanLoaiTK.Items.Count; i++)
                    {
                        DataRowView dr = (DataRowView)raddgrPhanLoaiTK.Items[i];
                        if (Convert.ToBoolean(dr["CHON"]) == true)
                        {
                            KT_PLOAI obj = new KT_PLOAI();
                            obj.ID       = Convert.ToInt32(dr["ID"]);
                            obj.MA_PLOAI = dr["MA_PLOAI"].ToString();
                            lstKtPloai.Add(obj);
                            TTHAI_LY_DO objTThai = new TTHAI_LY_DO();
                            objTThai.ID  = Convert.ToInt32(dr["ID"]);
                            objTThai.MA  = dr["MA_PLOAI"].ToString();
                            objTThai.TEN = dr["TEN_PLOAI"].ToString();
                            lstLyDo.Add(objTThai);
                        }
                    }
                    if (lstKtPloai.Count == 0)
                    {
                        LMessage.ShowMessage("M.DungChung.ChuaChonBanGhi", LMessage.MessageBoxType.Warning);
                        return;
                    }

                    MessageBoxResult messResult = LMessage.ShowMessage("M.DungChung.HoiThoaiDuyet", LMessage.MessageBoxType.Question);
                    if (messResult == MessageBoxResult.Yes)
                    {
                        ucLyDo lydo = new ucLyDo(lstLyDo);
                        lydo.DuLieuTraVe = new ucLyDo.LayDuLieu(LayDuLieuLyDo);
                        Window win = new Window();
                        //win.Title = "Danh sách mã phân loại tài khoản";
                        win.Content = lydo;
                        win.Title   = LLanguage.SearchResourceByKey("U.KeToan.KiemSoat.frmLyDo.LyDo") + "-" + LLanguage.SearchResourceByKey("U.DungChung.Button.ThoaiDuyet");
                        win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                        win.ShowDialog();
                        lstKtPloai.ForEach(f => f.TTHAI_LY_DO = lstLyDo.FirstOrDefault(g => g.ID == f.ID).LY_DO);
                        bool ret = process.XuLyPhanLoaiTaiKhoanDS(lstKtPloai.ToArray(), ref lstResponse, DatabaseConstant.Action.THOAI_DUYET);
                        if (!ret)
                        {
                            LMessage.ShowMessage("M.DungChung.ThoaiDuyetKhongThanhCong", LMessage.MessageBoxType.Warning);
                        }
                        else
                        {
                            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);
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
示例#26
0
        private void btnSoTaiKhoan_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //Bat popup
                if (cmbNguonVon.SelectedIndex < 0)
                {
                    return;
                }
                PopupProcess      process     = new PopupProcess();
                List <string>     lstDieuKien = new List <string>();
                AutoCompleteEntry au          = lstSourceNguonVon.ElementAt(cmbNguonVon.SelectedIndex);
                lstDieuKien.Add("%");
                lstDieuKien.Add("%");
                lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonViGiaoDich);
                lstDieuKien.Add(au.KeywordStrings.FirstOrDefault());
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET.getValue(), lstDieuKien);
                SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;

                lstPopup.Clear();
                ucPopup popup = new ucPopup(false, simplePopupResponse, false);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title = simplePopupResponse.PopupTitle;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.Content = popup;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    txtSoTaiKhoan.Text     = lstPopup[0][2].ToString();
                    lblTenTaiKhoan.Content = lstPopup[0][3].ToString();
                    numSoDu.Value          = Convert.ToDouble(lstPopup[0]["SODU"]);
                    ID_TKHOAN = Convert.ToInt32(lstPopup[0][1]);
                    MA_LSDU   = lstPopup[0]["MA_LSDU"].ToString();
                    if (!lstPopup[0]["LOAI_DTUONG"].ToString().IsNullOrEmptyOrSpace())
                    {
                        cmbLoaiDoiTuong.SelectedIndex = lstSourceDoiTuongLoai.IndexOf(lstSourceDoiTuongLoai.FirstOrDefault(f => f.KeywordStrings.FirstOrDefault().Equals(lstPopup[0]["LOAI_DTUONG"].ToString())));
                        cmbLoaiDoiTuong.IsEnabled     = false;
                    }
                    else
                    {
                        cmbLoaiDoiTuong.SelectedIndex = -1;
                        cmbLoaiDoiTuong.IsEnabled     = true;
                    }
                    if (lstPopup[0]["MA_NHOM_PLOAI"].ToString().Equals("LT"))
                    {
                        raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = false;
                    }
                    else
                    {
                        raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = true;
                    }
                    if (lstPopup[0]["NGAY_GDICH"] != DBNull.Value)
                    {
                        telNgayChotDL.Value = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                        ngayChotDL          = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                    }
                    DataTable dt = null;
                    LDatatable.MakeParameterTable(ref dt);
                    LDatatable.AddParameter(ref dt, "@IdTaiKhoan", "INT", ID_TKHOAN.ToString());
                    DataSet ds = new KeToanProcess().getDanhSachTaiKhoanChiTiet(dt, "DOI_TUONG");
                    lstDTuongCT = new List <DOI_TUONG_SDU_TKHOAN_CT>();
                    if (!ds.IsNullOrEmpty() && !ds.Tables[0].IsNullOrEmpty())
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            DOI_TUONG_SDU_TKHOAN_CT objDTuongCT = new DOI_TUONG_SDU_TKHOAN_CT();
                            objDTuongCT.MA_DTUONG     = dr["MA_DTUONG"].ToString();
                            objDTuongCT.TEN_TAI_KHOAN = dr["TEN_DTUONG"].ToString();
                            objDTuongCT.MA_LSDU       = dr["MA_LSDU"].ToString();
                            objDTuongCT.NGAY_DL       = dr["NGAY_DL"].ToString();
                            objDTuongCT.NGAY_GDICH    = dr["NGAY_GDICH"].ToString();
                            objDTuongCT.NGAY_HLUC     = dr["NGAY_HLUC"].ToString();
                            objDTuongCT.SODU          = Convert.ToDecimal(dr["SO_DU"].ToString());
                            objDTuongCT.ID_DTUONG     = Convert.ToInt32(dr["ID"].ToString());
                            lstDTuongCT.Add(objDTuongCT);
                        }
                    }
                    raddgrTUngCT.ItemsSource = lstDTuongCT;
                    raddgrTUngCT.Rebind();
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }