Beispiel #1
0
        private void BtnSalvarVei_Click(object sender, EventArgs e)
        {
           
            try
            {
                conn.Open();
                comando.CommandText = "INSERT INTO Veiculo (placa_veiculo,tipo_veiculo, modelo_veiculo, Ano_veiculo,seguro_veiculo) VALUES ('" + txtPlaca.Text + "','" +cbTipo.Text + "','" + txtModeloVei.Text + "','"+txtAno.Text+"','" + cbSeguro.Text + "')";
                comando.ExecuteNonQuery();
                LimparDados();
                Manutencao man = new Manutencao();
                man.Show();


            }
            catch (Exception)
            {

                MessageBox.Show("ERRO: Verifique se todos os campos foram informados corretamente!", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
           
            finally
            {
                conn.Close();
                CarregarDados();
                txtPlaca.Enabled = true;
            }
        }
Beispiel #2
0
        private void BtnManutencao_Click(object sender, EventArgs e)
        {
            Manutencao manu = new Manutencao();

            manu.Show();
        }