示例#1
0
 private void retornarVeiculo()
 {
     int id =
        Convert.ToInt32(dgvTabela.Rows[dgvTabela.CurrentRow.Index].Cells[0].Value.ToString());
      veic = (from p in bd.veiculo
                 where p.Id == id
                 select p).First();
     Dispose();
 }
 private void button4_Click(object sender, EventArgs e)
 {
     BuscarVeiculo bv = new BuscarVeiculo();
     veic = bv.IniciarFrame();
     if (veic != null)
     {
         veic = (from p in bd.veiculo
                 where p.Id == veic.Id
                 select p).First();
         popularCampos();
     }
     else
     {
         limparCampos();
     }
 }
 private void limparCampos()
 {
     tbAno.Clear();
     tbKM.Clear();
     tbMarca.Clear();
     tbModelo.Clear();
     tbPlaca.Clear();
     lId.Text = "";
     veic = new veiculo();
 }