예제 #1
0
        private void btn_RegisterInRegisterForm_Click(object sender, EventArgs e)
        {
            string _email = txb_EmailInRegisterForm.Text;

            if (!string.IsNullOrEmpty(this.txb_Name.Text) &&
                !string.IsNullOrEmpty(this.txb_Surname.Text) &&
                !string.IsNullOrEmpty(this.txb_PhoneNumber.Text) &&
                !string.IsNullOrEmpty(this.txb_EmailInRegisterForm.Text) &&
                !string.IsNullOrEmpty(this.txb_PasswordInRegisterForm.Text) &&
                !string.IsNullOrEmpty(this.txb_PasswordAgain.Text) &&
                txb_PasswordInRegisterForm.Text == txb_PasswordAgain.Text &&
                myDatabase.EmailChecking(_email))
            {
                User user = new User()
                {
                    Name        = txb_Name.Text,
                    Surname     = txb_Surname.Text,
                    Email       = txb_EmailInRegisterForm.Text,
                    PhoneNumber = txb_PhoneNumber.Text,
                    Password    = txb_PasswordInRegisterForm.Text
                };
                myDatabase.UserAdd(user);
                MessageBox.Show("Completed");
            }
            else
            {
                MessageBox.Show("Failed");
            }
        }