private void Login_Click(object sender, EventArgs e)
        {
            UserType v = new UserType();

            v.Show();
        }
Esempio n. 2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            UserType f = new UserType();

            f.Show();
        }
Esempio n. 3
0
        private void ButtonConfirm_Click(object sender, EventArgs e)
        {
            int Phonenum  = textBoxPhone.Text.Length;
            int Passwordl = textBoxPass.Text.Length;

            if (radioMale.Checked)
            {
                groupBoxGander.Text = radioMale.Text;
            }
            if (radioFemale.Checked)
            {
                groupBoxGander.Text = radioFemale.Text;
            }



            if (string.IsNullOrEmpty(textBoxname.Text) == true)
            {
                MessageBox.Show("Please Enter Name");
                textBoxname.Focus();
            }
            else if (string.IsNullOrEmpty(textBoxPass.Text) == true)
            {
                MessageBox.Show("Please Enter phone number");
                textBoxPass.Focus();
            }
            else if (string.IsNullOrEmpty(textBoxUname.Text) == true)
            {
                MessageBox.Show("Please Enter USername");
                textBoxUname.Focus();
            }

            else if (Passwordl <= 6)
            {
                MessageBox.Show("Your password should contain minimum 6 characters or numbers");

                textBoxPass.Focus();
            }
            else if (string.IsNullOrEmpty(textBoxPhone.Text) == true)
            {
                MessageBox.Show("Please enter Phone Number");
                textBoxPhone.Focus();
            }
            else if (Phonenum != 11)
            {
                MessageBox.Show("Please enter valid phone number");
                textBoxPhone.Focus();
            }
            else if (string.IsNullOrEmpty(textBoxEmail.Text) == true)
            {
                MessageBox.Show("Invalid email!!");
                textBoxEmail.Focus();
            }

            else if (string.IsNullOrEmpty(textBoxaddress.Text) == true)
            {
                MessageBox.Show("Please enter Address");
            }

            else if (textBoxPass.Text != textBoxConpass.Text)
            {
                MessageBox.Show("You typed the wrong password");
                textBoxPass.Focus();
            }

            else if (Regex.IsMatch(textBoxEmail.Text, emailValStr) == false)
            {
                MessageBox.Show("Invalid Email..!!");

                textBoxEmail.Focus();
            }
            else if (string.IsNullOrEmpty(groupBoxGander.Text) == true)
            {
                MessageBox.Show("Please select gender");
                groupBoxGander.Focus();
            }
            else
            {
                CustomerController.AddCustomers(textBoxname.Text, textBoxUname.Text, textBoxPass.Text, textBoxEmail.Text, textBoxaddress.Text, textBoxPhone.Text, groupBoxGander.Text, dateTimePicker1.Value.ToString("dd-MM-yyyy"));


                string            message = "Do you want to confirm this program..?";
                string            title   = "Alert";
                MessageBoxButtons buttons = MessageBoxButtons.YesNo;


                DialogResult result = MessageBox.Show(message, title, buttons);
                if (result == DialogResult.Yes)
                {
                    this.Hide();
                    UserType f = new UserType();
                    f.Show();
                }
                else
                {
                    // Do something
                }
            }
        }
        private void Button1_Click_1(object sender, EventArgs e)
        {
            UserType v = new UserType();

            v.Show();
        }