Ejemplo n.º 1
0
        private void buttonOrder_Click(object sender, EventArgs e)
        {
            Button           pushedButton = (Button)sender;
            AvailableBicycle bicycle;

            if (client != null)
            {
                for (int i = 0; i < availableBikeList.Count; i++)
                {
                    if (availableBikeList[i].id.ToString() == pushedButton.Name)
                    {
                        bicycle = availableBikeList[i];
                        OrderPage order = new OrderPage(bicycle, user, client);
                        order.Show();
                        this.Close();
                        break;
                    }
                }
            }
            else
            {
                ClientIdentification clientIdentificationPage = new ClientIdentification(user, client);
                clientIdentificationPage.Show();
                this.Close();
            }
        }
Ejemplo n.º 2
0
        private void buttonvalidate_Click(object sender, EventArgs e)
        {
            //int newClientId;
            string clientName    = textBoxname.Text;
            string clientPhone   = textBoxphone.Text;
            string clientEmail   = textBoxmail.Text;
            string clientaddress = textBoxaddress.Text;
            string clientZipCode = textBoxZipCode.Text;
            string clientCity    = textBoxCity.Text;
            string clientVat     = textBoxVat.Text;

            if (!(string.IsNullOrEmpty(textBoxname.Text) || string.IsNullOrEmpty(textBoxphone.Text) || string.IsNullOrEmpty(textBoxmail.Text) ||
                  string.IsNullOrEmpty(textBoxaddress.Text) || string.IsNullOrEmpty(textBoxZipCode.Text) || string.IsNullOrEmpty(textBoxCity.Text)))
            {
                if (EmailValide.IsValidEmail(textBoxmail.Text))
                {
                    AddNewClient addNewClient = new AddNewClient(clientName, clientPhone, clientEmail, clientaddress, clientZipCode, clientCity, clientVat);
                    DBConnection.InsertNewClient(addNewClient);
                    ClientIdentification clientIdentification = new ClientIdentification(user, client);
                    clientIdentification.Show();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Email not valide", "wrong Email", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Every box is not full", "textBox empty", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
        private static void ButtonClient_Click(object sender, EventArgs e)
        {
            Control              button = (Control)sender;
            BoveloBaseForm       form   = (BoveloBaseForm)button.Parent;
            ClientIdentification clientIdentificationPage = new ClientIdentification(form.user, form.client);

            clientIdentificationPage.Show();
            form.Close();
        }