Пример #1
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            frmMailSubject frmMailSubject = new ChinaUnion_Agent.frmMailSubject();
            frmMailSubject.subject = "重新发送:" + Settings.Default.MailSubject + "(" + feeMonth + ")";
            DialogResult dialogResult = frmMailSubject.ShowDialog();
            if (dialogResult == DialogResult.OK)
            {
                this.subject = frmMailSubject.subject;
                //异步执行开始
                worker.RunWorkerAsync();
                frmProgress frm = new frmProgress(this.worker);
                frm.StartPosition = FormStartPosition.CenterScreen;
                frm.ShowDialog(this);
                frm.Close();
            }

        }
Пример #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(this.txtUserName.Text))
            {
                MessageBox.Show("请输入用户名");
                txtUserName.Focus();
                return;
            }
            if (String.IsNullOrEmpty(this.txtPassword.Text))
            {
                MessageBox.Show("请输入密码");
                txtPassword.Focus();
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            UserDao userDao = new UserDao();
            this.loginUser = userDao.Get(this.txtUserName.Text);
            if (loginUser == null || (loginUser != null && !loginUser.password.Equals(this.txtPassword.Text)))
            {
                MessageBox.Show("用户名或者密码不正确,请重新输入.");
                txtUserName.Focus();
                this.Cursor = Cursors.Default;
                return;
            }
            this.DialogResult = DialogResult.OK;
            this.Hide();
            //异步执行开始
            worker.RunWorkerAsync();
            frmProgress frm = new frmProgress(this.worker);
          //  frm.Height = 100;
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog(this);
            frm.Close();
            this.Cursor = Cursors.Default;

            this.Close();
           
        }
Пример #3
0
        private void btnImport_Click(object sender, EventArgs e)
        {

            ImportLog importLog = new ChinaUnion_BO.ImportLog();
            importLog.type = "Agent";
            importLog.import_month = this.dtFeeMonth.Value.ToString("yyyy-MM");
            ImportLogDao importLogDao = new ChinaUnion_DataAccess.ImportLogDao();
            if (importLogDao.Get(importLog) != null)
            {
                if (MessageBox.Show("本月佣金已经导入,是否需要再次导入?", "数据导入", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                {
                    return;
                }
            }
            //异步执行开始
            worker.RunWorkerAsync();
            frmProgress frm = new frmProgress(this.worker);
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog(this);
            frm.Close();
            this.btnImport.Enabled = false;
           

        }
Пример #4
0
        private void btnImport_Click(object sender, EventArgs e)
        {

           
            //异步执行开始
            worker.RunWorkerAsync();
            frmProgress frm = new frmProgress(this.worker);
            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog(this);
            frm.Close();
            this.btnImport.Enabled = false;
           

        }