private void button2_Click(object sender, EventArgs e) { DtoCarro carro = new DtoCarro(); carro.Placa = textBox1.Text; try { var valor = Operacoes.Checkout(carro); MessageBox.Show(String.Format("Placa '{0}' valor de R${1}.", carro.Placa, valor)); textBox1.Text = string.Empty; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { DtoCarro carro = new DtoCarro(); carro.Placa = textBox1.Text; carro.Horario = DateTime.Now; try { Operacoes.Checkin(carro); MessageBox.Show(String.Format("Placa '{0}' adicionada.", carro.Placa)); textBox1.Text = string.Empty; } catch (Exception ex) { MessageBox.Show(ex.Message); } }