Esempio n. 1
0
        private void add_btn_Click(object sender, EventArgs e)
        {
            ConfirmPasswordForm confirmPasswordForm = new ConfirmPasswordForm();

            if (confirmPasswordForm.ShowDialog() == DialogResult.Yes)
            {
                if (password_tb.Text != reEnter_tb.Text)
                {
                    MessageBox.Show("Password not match!");
                    return;
                }
                if (manager.CheckUserName(username_tb.Text) == false)
                {
                    MessageBox.Show("Username existed!");
                    return;
                }

                if (manager.addNewAccount(username_tb.Text, password_tb.Text) == true)
                {
                    MessageBox.Show("Add complete!");
                }
                else
                {
                    MessageBox.Show("Something wrong!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Esempio n. 2
0
        private void EditProfileForm_Load(object sender, EventArgs e)
        {
            this.Visible = false;
            ConfirmPasswordForm confirmPasswordForm = new ConfirmPasswordForm();

            confirmPasswordForm.ShowDialog();
            if (confirmPasswordForm.DialogResult == DialogResult.Yes)
            {
                this.Visible     = true;
                username_tb.Text = CurrentUser.UserName;
                fname_tb.Text    = CurrentUser.fname;
                lname_tb.Text    = CurrentUser.lname;
                pictureBox.Image = CurrentUser.Avatar;
            }
            else
            {
                this.Close();
            }
        }