Exemple #1
0
        /// <summary>
        /// Handles the Click event of the btnUpdateCustomer control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        public void btnUpdateCustomer_Click(object sender, EventArgs e)
        {
            if (dataGridView1.RowCount > 0)
            {
                int j = 0;

                for (int i = 0; i < dataGridView1.RowCount; i++)
                {
                    if (dataGridView1.Rows[i].Selected == true)
                    {
                        j = j + 1;
                    }
                }

                if (j > 0)
                {
                    if (Convert.ToString(dataGridView1.SelectedCells[13].Value) == "VVIP STORE MEMBER" | Convert.ToString(dataGridView1.SelectedCells[13].Value) == "VVIP BEAUTICIAN")
                    {
                        MyMessageBox.ShowBox("NOT AUTHORIZED ON THE REGISTER", "ERROR");
                        return;
                    }
                    else
                    {
                        if (auth == true)
                        {
                            UpdateCustomer updateCustomerForm = new UpdateCustomer();
                            updateCustomerForm.parentForm1 = this.parentForm;
                            //updateCustomerForm.parentForm2 = this;
                            updateCustomerForm.ShowDialog();
                        }
                        else
                        {
                            Authentication authenticationForm = new Authentication(4);
                            authenticationForm.parentForm1 = this.parentForm;
                            //authenticationForm.parentForm3 = this;
                            authenticationForm.ShowDialog();
                        }
                    }
                }
            }
        }
Exemple #2
0
 private void Menu_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Back)
     {
         this.Hide();
         Menu menu = new Menu();
         menu.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D1)
     {
         this.Hide();
         RegisterNewCar registerNewCar = new RegisterNewCar();
         registerNewCar.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D2)
     {
         this.Hide();
         UpdateCarRental updateCarRental = new UpdateCarRental();
         updateCarRental.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D3)
     {
         this.Hide();
         ListRents listRents = new ListRents();
         listRents.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D4)
     {
         this.Hide();
         AvailableCars availableCars = new AvailableCars();
         availableCars.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D5)
     {
         this.Hide();
         RegisterNewCustomer registerNewCustomer = new RegisterNewCustomer();
         registerNewCustomer.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D6)
     {
         this.Hide();
         UpdateCustomer updateCustomer = new UpdateCustomer();
         updateCustomer.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D7)
     {
         this.Hide();
         ListCustomers listCustomers = new ListCustomers();
         listCustomers.ShowDialog();
         this.Close();
     }
     else if (e.KeyChar == (char)Keys.D8)
     {
         this.Close();
     }
     else
     {
         MessageBox.Show("Please insert a valid number");
         this.Hide();
         Menu menu = new Menu();
         menu.ShowDialog();
         this.Close();
     }
 }