コード例 #1
0
        /// <summary>
        /// Khởi tạo các combobox
        /// </summary>
        private void LoadCombobox()
        {
            // khởi tạo combobox
            AutoComboBox auto = new AutoComboBox();
            // Khởi tạo điều kiện gọi danh mục
            List <string> lstDieuKien = new List <string>();

            string ThamSoHThongTK = new UtilitiesProcess().LayGiaTriThamSo(BusinessConstant.LoaiThamSo.TW, BusinessConstant.MaThamSo.TW_HE_THONG_TKHOAN_HTHI, ClientInformation.MaDonVi);

            if (ThamSoHThongTK.IsNullOrEmptyOrSpace())
            {
                ThamSoHThongTK = "CHI_TIET";
            }

            // khởi tạo combobox
            auto = new AutoComboBox();
            lstDieuKien.Add(ClientInformation.TenDangNhap);
            lstDieuKien.Add(ClientInformation.MaDonViQuanLy);
            new AutoComboBoxListCheckes().GenAutoComboBox(ref lstSourceChiNhanh, ref cmbChiNhanh, DatabaseConstant.DanhSachTruyVan.COMBOBOX_CNHANHLIST.getValue(), lstDieuKien);
            //// khởi tạo combobox
            //auto = new AutoComboBox();
            //auto.GenAutoComboBox(ref lstSourcePhongGD, ref cmbPhongGD, DatabaseConstant.DanhSachTruyVan.COMBOBOX_PHONG_GD.getValue());
            //LoadComboboxPhongGD();
            LoadComboboxPhongGD();

            //Hệ thống tài khoản
            lstSourceHeThongTK.Insert(0, new AutoCompleteEntry(LLanguage.SearchResourceByKey("U.DungChung.ChiTiet"), new string[2] {
                "CHI_TIET", "0"
            }));
            auto.GenAutoComboBox(ref lstSourceHeThongTK, ref cmbHeThongTKhoan, DatabaseConstant.DanhSachTruyVan.COMBOBOX_HE_THONG_TK.getValue(), null, ThamSoHThongTK);

            //Nguồn vốn
            lstSourceNguonVon.Insert(0, new AutoCompleteEntry(LLanguage.SearchResourceByKey("U.DungChung.TatCa"), new string[2] {
                "%", "0"
            }));
            auto.GenAutoComboBox(ref lstSourceNguonVon, ref cmbNguonVon, DatabaseConstant.DanhSachTruyVan.COMBOBOX_NGUON_VON.getValue(), null);
            cmbNguonVon.SelectedIndex = 0;

            lstDieuKien = new List <string>();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.DONG_TIEN_CAC_NUOC.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceLoaiTien, ref cmbLoaiTien, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ClientInformation.MaDongNoiTe);

            lstDieuKien = new List <string>();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.NGON_NGU.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceNgonNgu, ref cmbNgonNgu, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ClientInformation.NgonNgu);

            lstDieuKien = new List <string>();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.DINH_DANG_BAO_CAO.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();
            //auto.GenAutoComboBox(ref lstSourceDinhDang, ref cmbDinhDang, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ApplicationConstant.LoaiDinhDangBaoCao.WORD.layGiaTri());
            //cmbDinhDang.SelectedIndex = lstSourceDinhDang.FindIndex(e => e.KeywordStrings[0].Equals(ApplicationConstant.LoaiDinhDangBaoCao.EXCEL.layGiaTri()));
            auto.GenAutoComboBox(ref lstSourceDinhDang, ref cmbDinhDang, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ReportInformation.DinhDang);
            cmbDinhDang.IsEnabled = false;
        }
コード例 #2
0
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            AutoCompleteEntry ace = (AutoCompleteEntry)cmbPhongGD.SelectedItem;

            if (ace != null)
            {
                string id             = ace.KeywordStrings[2];
                string ma             = ace.KeywordStrings[0];
                string ten            = ace.DisplayName;
                string hachtoan       = ace.KeywordStrings[1];
                string maDonViCha     = ace.KeywordStrings[3];
                string maTinhThanhPho = ace.KeywordStrings[4];
                string soLuongBGhi    = "";

                ClientInformation.TenDonViGiaoDich    = ten;
                ClientInformation.MaDonViGiaoDich     = ma;
                ClientInformation.IdDonViGiaoDich     = Int32.Parse(id);
                ClientInformation.PhuongPhapHachToan  = hachtoan;
                ClientInformation.TinhTPDonViGiaoDich = maTinhThanhPho;

                // Nếu đơn vị vận hành khác đơn vị quản lý
                // 1. Lấy thông tin chi nhánh của phòng giao dịch được chọn
                // 2. Lấy thông tin ngày làm việc phòng giao dịch được chọn
                if (maDonViCha != null && !maDonViCha.Equals(ClientInformation.MaDonVi))
                {
                    DanhMucProcess process = new DanhMucProcess();
                    ApplicationConstant.ResponseStatus ret = new ApplicationConstant.ResponseStatus();
                    Presentation.Process.DanhMucServiceRef.DM_DON_VI     dmDonVi     = new Presentation.Process.DanhMucServiceRef.DM_DON_VI();
                    Presentation.Process.DanhMucServiceRef.HT_NGAY_LVIEC ngayLamViec = new Presentation.Process.DanhMucServiceRef.HT_NGAY_LVIEC();
                    string responseMessage = "";

                    ret = process.GetDonViChaByMaDonVi(ma, ref dmDonVi, ref ngayLamViec, ref responseMessage);
                    if (ret == ApplicationConstant.ResponseStatus.THANH_CONG)
                    {
                        ClientInformation.IdDonVi  = dmDonVi.ID;
                        ClientInformation.MaDonVi  = dmDonVi.MA_DVI;
                        ClientInformation.TenDonVi = dmDonVi.TEN_GDICH;

                        ClientInformation.NgayLamViecTruoc   = ngayLamViec.NGAY_TRUOC;
                        ClientInformation.NgayLamViecHienTai = ngayLamViec.NGAY_LVIEC;
                        ClientInformation.NgayLamViecSau     = ngayLamViec.NGAY_TTHEO;
                    }
                    process = null;
                }
                soLuongBGhi = new UtilitiesProcess().LayGiaTriThamSo(BusinessConstant.LoaiThamSo.TW, BusinessConstant.MaThamSo.TW_SOLUONG_BANGHI, ClientInformation.MaDonVi);
                if (soLuongBGhi.IsNullOrEmptyOrSpace())
                {
                    soLuongBGhi = "10";
                }
                ClientInformation.SoLuongBanGhi = soLuongBGhi.StringToInt32();
            }

            MainWindow mainWindow = new MainWindow();

            mainWindow.Show();
            this.Cursor = Cursors.Arrow;
            Close();
        }
コード例 #3
0
        /// <summary>
        /// Khởi tạo các combobox
        /// </summary>
        private void LoadCombobox()
        {
            // khởi tạo combobox
            AutoComboBox auto = new AutoComboBox();
            // Khởi tạo điều kiện gọi danh mục
            List <string> lstDieuKien = new List <string>();

            string ThamSoHThongTK = new UtilitiesProcess().LayGiaTriThamSo(BusinessConstant.LoaiThamSo.TW, BusinessConstant.MaThamSo.TW_HE_THONG_TKHOAN_HTHI, ClientInformation.MaDonVi);

            if (ThamSoHThongTK.IsNullOrEmptyOrSpace())
            {
                ThamSoHThongTK = "CHI_TIET";
            }

            // khởi tạo combobox
            auto = new AutoComboBox();
            lstDieuKien.Add(ClientInformation.TenDangNhap);
            lstDieuKien.Add(ClientInformation.MaDonViQuanLy);
            new AutoComboBoxListCheckes().GenAutoComboBox(ref lstSourceChiNhanh, ref cmbChiNhanh, DatabaseConstant.DanhSachTruyVan.COMBOBOX_CNHANHLIST.getValue(), lstDieuKien);
            //// khởi tạo combobox
            //auto = new AutoComboBox();
            //auto.GenAutoComboBox(ref lstSourcePhongGD, ref cmbPhongGD, DatabaseConstant.DanhSachTruyVan.COMBOBOX_PHONG_GD.getValue());
            //LoadComboboxPhongGD();
            LoadComboboxPhongGD();

            lstDieuKien = new List <string>();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.NGON_NGU.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceNgonNgu, ref cmbNgonNgu, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ClientInformation.NgonNgu);

            lstDieuKien = new List <string>();
            lstDieuKien.Add(DatabaseConstant.DanhMuc.DINH_DANG_BAO_CAO.getValue());
            // khởi tạo combobox
            auto = new AutoComboBox();
            auto.GenAutoComboBox(ref lstSourceDinhDang, ref cmbDinhDang, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ReportInformation.DinhDang);
            cmbDinhDang.IsEnabled = false;
            //auto.GenAutoComboBox(ref lstSourceDinhDang, ref cmbDinhDang, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ApplicationConstant.LoaiDinhDangBaoCao.WORD.layGiaTri());
            //cmbDinhDang.SelectedIndex = lstSourceDinhDang.FindIndex(e => e.KeywordStrings[0].Equals(ApplicationConstant.LoaiDinhDangBaoCao.EXCEL.layGiaTri()));
        }
コード例 #4
0
        /// <summary>
        /// Khởi tạo các combobox
        /// </summary>
        private void LoadCombobox()
        {
            // khởi tạo combobox
            AutoComboBox auto = new AutoComboBox();
            // Khởi tạo điều kiện gọi danh mục
            List <string> lstDieuKien = new List <string>();

            string ThamSoHThongTK = new UtilitiesProcess().LayGiaTriThamSo(BusinessConstant.LoaiThamSo.TW, BusinessConstant.MaThamSo.TW_HE_THONG_TKHOAN_HTHI, ClientInformation.MaDonVi);

            if (ThamSoHThongTK.IsNullOrEmptyOrSpace())
            {
                ThamSoHThongTK = "CHI_TIET";
            }

            // khởi tạo combobox
            Dispatcher.CurrentDispatcher.DelayInvoke("cmbChiNhanh", () =>
            {
                auto = new AutoComboBox();
                auto.GenAutoComboBox(ref lstSourceChiNhanh, ref cmbChiNhanh, DatabaseConstant.DanhSachTruyVan.COMBOBOX_CNHANH.getValue(), null, ClientInformation.MaDonVi);
            }, TimeSpan.FromSeconds(0));

            // khởi tạo combobox
            Dispatcher.CurrentDispatcher.DelayInvoke("cmbHeThongTKhoan", () =>
            {
                lstSourceHeThongTK.Insert(0, new AutoCompleteEntry(LLanguage.SearchResourceByKey("U.DungChung.ChiTiet"), new string[2] {
                    "CHI_TIET", "0"
                }));
                auto.GenAutoComboBox(ref lstSourceHeThongTK, ref cmbHeThongTKhoan, DatabaseConstant.DanhSachTruyVan.COMBOBOX_HE_THONG_TK.getValue(), null, ThamSoHThongTK);
            }, TimeSpan.FromSeconds(0));


            // khởi tạo combobox
            Dispatcher.CurrentDispatcher.DelayInvoke("cmbPhongGD", () =>
            {
                auto = new AutoComboBox();
                auto.GenAutoComboBox(ref lstSourcePhongGD, ref cmbPhongGD, DatabaseConstant.DanhSachTruyVan.COMBOBOX_PHONG_GD.getValue());
                LoadComboboxPhongGD();
            }, TimeSpan.FromSeconds(0));

            Dispatcher.CurrentDispatcher.DelayInvoke("cmbLoaiTien", () =>
            {
                lstDieuKien = new List <string>();
                lstDieuKien.Add(DatabaseConstant.DanhMuc.DONG_TIEN_CAC_NUOC.getValue());
                // khởi tạo combobox
                auto = new AutoComboBox();
                auto.GenAutoComboBox(ref lstSourceLoaiTien, ref cmbLoaiTien, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien);
            }, TimeSpan.FromSeconds(0));

            Dispatcher.CurrentDispatcher.DelayInvoke("cmbNgonNgu", () =>
            {
                lstDieuKien = new List <string>();
                lstDieuKien.Add(DatabaseConstant.DanhMuc.NGON_NGU.getValue());
                // khởi tạo combobox
                auto = new AutoComboBox();
                auto.GenAutoComboBox(ref lstSourceNgonNgu, ref cmbNgonNgu, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ApplicationConstant.LoaiNgonNguBaoCao.vi_VN.layGiaTri());
            }, TimeSpan.FromSeconds(0));

            Dispatcher.CurrentDispatcher.DelayInvoke("cmbDinhDang", () =>
            {
                lstDieuKien = new List <string>();
                lstDieuKien.Add(DatabaseConstant.DanhMuc.DINH_DANG_BAO_CAO.getValue());
                // khởi tạo combobox
                auto = new AutoComboBox();
                auto.GenAutoComboBox(ref lstSourceDinhDang, ref cmbDinhDang, DatabaseConstant.DanhSachTruyVan.COMBOBOX_DMUC.getValue(), lstDieuKien, ApplicationConstant.LoaiDinhDangBaoCao.EXCEL.layGiaTri());
            }, TimeSpan.FromSeconds(0));
        }