private void ButtonConfirm_Click(object sender, EventArgs e)
        {
            this.Hide();
            DeliverymansController.DeleteDeliverymans(textBoxdelDeliveryman.Text);
            Admin_Panel v = new Admin_Panel();

            v.Show();
        }
Example #2
0
        private void ButtonLogin_Click(object sender, EventArgs e)
        {
            var result = DeliverymansController.AuthenticateUser(textBoxUname.Text, textBoxPass.Text);

            if (result == true)
            {
                MessageBox.Show("Success", "Alert");
                this.Hide();
                var Purchases = PurchaseController.GetAllOrder();

                DeliveryManpanel l = new DeliveryManpanel(Purchases);
                l.Show();
            }
            else
            {
                MessageBox.Show("Failed", "Alert");
            }
        }
        private void ButtonConfirm_Click(object sender, EventArgs e)
        {
            DeliverymansController.ChanagePassword(textBoxEmail.Text, textBoxPass.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();
                Deliveryman_Login v = new Deliveryman_Login();
                v.Show();
            }
            else
            {
                // Do something
            }
        }
        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
            {
                DeliverymansController.AddDeliverymans(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();
                    Admin_Panel v = new Admin_Panel();
                    v.Show();
                }
                else
                {
                    // Do something
                }
            }
        }