Exemplo n.º 1
0
        private void can_Submit_MouseDown(object sender, MouseButtonEventArgs e)
        {
            connect = new CTUConnection();

            if (txt_serial.MaxLength != 13 || string.IsNullOrEmpty(txt_serial.Text))
            {
                MessageBox.Show("Please enter a serial number for the vehicle");
            }

            else if (string.IsNullOrEmpty(txt_Brand.Text))
            {
                MessageBox.Show("Please enter the serial number of the vehicle");
            }

            else if (string.IsNullOrEmpty(txt_Color.Text))
            {
                MessageBox.Show("Please enter the color of vehicle");
            }

            else if (string.IsNullOrEmpty(txt_Model.Text))
            {
                MessageBox.Show("Please enter the model of the vehicle");
            }

            else if (string.IsNullOrEmpty(txt_Price.Text))
            {
                MessageBox.Show("Please enter a serial number for the vehicle");
            }

            else
            {
                connect.GetNewVehicles(txt_Brand.Text, txt_Model.Text, txt_serial.Text, txt_Color.Text, txt_Price.Text, Convert.ToDateTime(DTP_Year.SelectedDate.ToString()));
            }
        }