Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (currUser == null)
         currUser = allUser[0];
     DownLoadMails f = new DownLoadMails();
     f.FormClosed += new FormClosedEventHandler((object o, FormClosedEventArgs exc) =>
     {
         this.Enabled = true;
     });
     this.Enabled = false;
     f.Show();
     f.Activate();
 }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (currUser == null)
            {
                currUser = allUser[0];
            }
            DownLoadMails f = new DownLoadMails();

            f.FormClosed += new FormClosedEventHandler((object o, FormClosedEventArgs exc) =>
            {
                this.Enabled = true;
            });
            this.Enabled = false;
            f.Show();
            f.Activate();
        }
Esempio n. 3
0
        private void button1_Create_Click(object sender, EventArgs e)
        {
            if (!ValiInput())
            {
                return;
            }
            UserInfo userInfo = new UserInfo();

            userInfo.EmailAddress = textBox1.Text;
            userInfo.UserName     = textBox5.Text;
            userInfo.Password     = textBox2.Text;
            userInfo.PopAddress   = textBox4.Text;
            userInfo.SmtpAddress  = textBox3.Text;
            userInfo.PopPort      = int.Parse(textBox7.Text);
            userInfo.SmtpPort     = int.Parse(textBox6.Text);
            userInfo.CreateDate   = DateTime.Now;

            UserManage userMng = new UserManage();

            userMng.OnCreateUserErrorEvent += new UserManage.CreateUserErrorHandler((Exception ex) =>
            {
                Common.AppLog.SysLog(ex.ToString());
                MessageBox.Show(LanguageSelect.getResc("CreateUserError"));
            });

            userMng.OnCreatedUserEvent += new UserManage.CreatedUserHandler(() =>
            {
                Common.AppLog.SysLog(string.Format(LanguageSelect.getResc("SysUserCreate"), userInfo.EmailAddress));
            });

            switch (userMng.CreateUser(userInfo))
            {
            case 1: MessageBox.Show(LanguageSelect.getResc("CreateUserSuccess"));
                AppMain.currUser = userInfo;
                DownLoadMails f = new DownLoadMails();
                f.Show();
                f.Activate();
                this.Close();
                break;

            case 2: MessageBox.Show(LanguageSelect.getResc("RepeatUser"));
                break;
            }
        }
Esempio n. 4
0
        private void button1_Create_Click(object sender, EventArgs e)
        {
            if (!ValiInput())
                return;
            UserInfo userInfo = new UserInfo();
            userInfo.EmailAddress = textBox1.Text;
            userInfo.UserName = textBox5.Text;
            userInfo.Password = textBox2.Text;
            userInfo.PopAddress = textBox4.Text;
            userInfo.SmtpAddress = textBox3.Text;
            userInfo.PopPort = int.Parse(textBox7.Text);
            userInfo.SmtpPort = int.Parse(textBox6.Text);
            userInfo.CreateDate = DateTime.Now;

            UserManage userMng = new UserManage();

            userMng.OnCreateUserErrorEvent += new UserManage.CreateUserErrorHandler((Exception ex) =>
            {
                Common.AppLog.SysLog(ex.ToString());
                MessageBox.Show(LanguageSelect.getResc("CreateUserError"));
            });

            userMng.OnCreatedUserEvent += new UserManage.CreatedUserHandler(() =>
            {
                Common.AppLog.SysLog(string.Format(LanguageSelect.getResc("SysUserCreate"),userInfo.EmailAddress));
            });

            switch (userMng.CreateUser(userInfo))
            {
                case 1: MessageBox.Show(LanguageSelect.getResc("CreateUserSuccess"));
                        AppMain.currUser = userInfo;
                        DownLoadMails f = new DownLoadMails();
                        f.Show();
                        f.Activate();
                        this.Close();
                        break;
                case 2: MessageBox.Show(LanguageSelect.getResc("RepeatUser"));
                        break;
            }
        }