private void Button1_Click(object sender, EventArgs e) { this.Hide(); UserType f = new UserType(); f.Show(); }
private void Button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TextboxFname.Text) == true) { MessageBox.Show("Please Enter Name"); TextboxFname.Focus(); } if (string.IsNullOrEmpty(textBoxAddress.Text) == true) { MessageBox.Show("Please Enter Address"); TextboxFname.Focus(); textBoxAddress.Focus(); } if (string.IsNullOrEmpty(textBoxPhone.Text) == true) { MessageBox.Show("Please Enter Phone"); textBoxAddress.Focus(); } if (string.IsNullOrEmpty(textBoxCusname.Text) == true) { MessageBox.Show("Please Enter Category"); textBoxCusname.Focus(); } else { PurchaseController.NewPurchases(TextboxFname.Text, textBoxAddress.Text, textBoxPhone.Text, textBoxCusname.Text); 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 Button2_Click(object sender, EventArgs e) { UserType f = new UserType(); f.Show(); }
private void Button1_Click(object sender, EventArgs e) { UserType v = new UserType(); v.Show(); }
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 } } }