Exemple #1
0
        private void olaRefreshDbName_Click(object sender, EventArgs e)
        {
            int nDigStatus = 0;

            try
            {
                if (otbDbLocation.Text == "")
                {
                    otbDbLocation.Focus();
                    return;
                }
                if (otbUserName.Text == "")
                {
                    otbUserName.Focus();
                    return;
                }
                if (otbUserPassword.Text == "")
                {
                    otbUserPassword.Focus();
                    return;
                }

                if (oBackgroundWorker.IsBusy != true)
                {
                    // Start the asynchronous operation.
                    oBackgroundWorker.RunWorkerAsync();
                    // New Dialog
                    oW_ProgressDlg = new wProgressDlg(nDigStatus);
                    oW_ProgressDlg.ShowDialog();
                }

                ocbDbName.DataSource    = cCNSP.SP_GEToDbName(otbDbLocation.Text, otbUserName.Text, otbUserPassword.Text);
                ocbDbName.DisplayMember = "NAME";
            }
            catch (Exception oEx)
            {
                MessageBox.Show("wSetting : olaRefresh_Click // " + oEx.Message);
            }
        }
Exemple #2
0
        private void W_GETxExport(string ptOpenMode)
        {
            int nDigStatus = 1;

            try
            {
                if (oBackgroundWorker.IsBusy != true)
                {
                    oBackgroundWorker.RunWorkerAsync();

                    oW_ProgressDlg = new wProgressDlg(nDigStatus);
                    oW_ProgressDlg.W_SEToStopProgress = new EventHandler((s, e1) =>
                    {
                        switch (oW_ProgressDlg.DialogResult)
                        {
                        case DialogResult.Cancel:
                            oBackgroundWorker.CancelAsync();
                            oW_ProgressDlg.Close();
                            break;
                        }
                    });
                    if (ptOpenMode == "AutoMode")
                    {
                        oW_ProgressDlg.Hide();
                    }
                    else
                    {
                        oW_ProgressDlg.Show();
                    }
                }
            }
            catch (Exception oEx)
            {
                MessageBox.Show("wMain : W_GETxExport // " + oEx.Message);
            }
        }