Пример #1
0
        private void btnSaoLuu2_Click(object sender, EventArgs e)
        {
            if (StringTools.TrimSpace(txtBrowse2.Text).Length <= 0)
            {
                new Taxi.MessageBox.MessageBoxBA().Show("Không có đường dẫn, bạn phải nhập file lưu..", "Thông báo");
            }
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(bw_DoWork2);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted2);

            // Create a progress form on the UI thread
            m_fmProgress = new fmProgress();

            // Kick off the Async thread
            bw.RunWorkerAsync();

            // Lock up the UI with this modal progress form.
            try
            {
                m_fmProgress.ShowDialog(this);
                m_fmProgress = null;
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        private void btnSaoLuu1_Click(object sender, EventArgs e)
        {
            // kiem tra thong tin duong dẫn


            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            // Create a progress form on the UI thread
            m_fmProgress = new fmProgress();

            // Kick off the Async thread
            bw.RunWorkerAsync();

            // Lock up the UI with this modal progress form.
            try
            {
                m_fmProgress.ShowDialog(this);
                m_fmProgress = null;
            }
            catch (Exception ex)
            {
            }
        }
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            DateTime timeServer = DieuHanhTaxi.GetTimeServer();

            if (calTuNgay.Value > timeServer)
            {
                MessageBox.MessageBoxBA msgDialog = new Taxi.MessageBox.MessageBoxBA();
                msgDialog.Show(this, "Bạn phải nhập  nhỏ hơn hoặc bằng tháng hiện tại.", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Warning);
                return;
            }
            // Create a background thread
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(bw_DoWorkNew);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            // Create a progress form on the UI thread
            m_fmProgress = new fmProgress();

            // Kick off the Async thread
            bw.RunWorkerAsync();

            // Lock up the UI with this modal progress form.
            try
            {
                m_fmProgress.ShowDialog(this);
                m_fmProgress = null;
            }
            catch (Exception ex)
            {
            }
            SetUnActiveRefreshButton();
        }
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            if (TimKiem_BaoCao.CheckTuNgayDenNgay(calTuNgay.Value, calDenNgay.Value))
            {
                // Create a background thread
                BackgroundWorker bw = new BackgroundWorker();
                bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
                bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

                // Create a progress form on the UI thread
                m_fmProgress = new fmProgress();

                // Kick off the Async thread
                bw.RunWorkerAsync();

                // Lock up the UI with this modal progress form.
                try
                {
                    m_fmProgress.ShowDialog(this);
                    m_fmProgress = null;
                }
                catch (Exception ex)
                {
                }
                btnExportExcel.Enabled = true;
            }
            else
            {
                MessageBox.MessageBoxBA msgDialog = new Taxi.MessageBox.MessageBoxBA();
                msgDialog.Show(this, "Bạn phải nhập [Từ ngày] nhỏ hơn hoặc bằng [Đến ngày].", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Warning);
                return;
            }
        }
Пример #5
0
        private void btnCapNhatThongtinMoiGioi_Click(object sender, EventArgs e)
        {
            if ((g_lstDoiTacChon == null) || (g_lstDoiTacChon.Count <= 0))
            {
                new MessageBox.MessageBox().Show(this, " Không có môi giới nào được chọn.");
                return;
            }

            // Create a background thread
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
            // Create a progress form on the UI thread
            m_fmProgress = new fmProgress();
            // Kick off the Async thread
            bw.RunWorkerAsync();
            // Lock up the UI with this modal progress form.
            try
            {
                m_fmProgress.ShowDialog(this);
                m_fmProgress = null;
                new MessageBox.MessageBox().Show(this, " Cập nhật cuộc gọi môi giới thành công.");
                return;
            }
            catch (Exception ex)
            {
            }
        }
Пример #6
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            DateTime timeServer = DieuHanhTaxi.GetTimeServer();

            if ((calDenNgay.Value.Year > timeServer.Year) || ((calDenNgay.Value.Year == timeServer.Year) && (calDenNgay.Value.Month > timeServer.Month)))
            {
                MessageBox.MessageBoxBA msgDialog = new Taxi.MessageBox.MessageBoxBA();
                msgDialog.Show(this, "Bạn chọn [tháng-năm] nhỏ hơn hoặc bằng [tháng-năm] hiện tại.", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Error);
                return;
            }

            // check thang co nho hơn hoặc bằng tháng hiện tại không.

            if (g_dtDuLieuBC17 == null)
            {
                MessageBox.MessageBoxBA msgDialog = new Taxi.MessageBox.MessageBoxBA();
                msgDialog.Show(this, "Không tạo được dữ liệu báo cáo.", "Thông báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Error);
                return;
            }


            // Create a background thread
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

            // Create a progress form on the UI thread
            m_fmProgress = new fmProgress();

            // Kick off the Async thread
            bw.RunWorkerAsync();

            // Lock up the UI with this modal progress form.
            try
            {
                m_fmProgress.ShowDialog(this);
                m_fmProgress = null;
            }
            catch (Exception ex)
            {
            }



            btnPrint.Enabled       = true;
            btnExportExcel.Enabled = true;
        }
Пример #7
0
        private void LoadData()
        {
            // Create a background thread

            bw.WorkerReportsProgress = true;
            bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
            bw.ProgressChanged    += new ProgressChangedEventHandler(bw_ProgressChanged);
            // Create a progress form on the UI thread
            m_fmProgress = new fmProgress();
            // Kick off the Async thread
            bw.RunWorkerAsync();
            // Lock up the UI with this modal progress form.
            try
            {
                m_fmProgress.ShowDialog(this);
                m_fmProgress = null;
                return;
            }
            catch (Exception ex)
            {
            }
        }