Esempio n. 1
0
        public CadAbastecimento()
        {
            InitializeComponent();
            ClassAbastecimentoDAO abastecimentoDAO = new ClassAbastecimentoDAO();

            cbPlaca.ItemsSource = abastecimentoDAO.Listarbox();
        }
Esempio n. 2
0
        private void BtnSalvar_Click(object sender, RoutedEventArgs e)
        {
            ClassAbastecimentos abastecimentos = new ClassAbastecimentos
            {
                Combustivel = txtCombustivel.Text,
                KM          = Convert.ToDouble(txtKM.Text),
                Quant       = Convert.ToDouble(txtQtd.Text),
                Valor_Total = Convert.ToDouble(txtValor.Text.Replace('$', ' ').Replace('.', ','))
            };

            abastecimentos.Codigo_Veiculo = abastecimentos.RetornoID(cbPlaca.Text);
            ClassAbastecimentoDAO abastecimentoDAO = new ClassAbastecimentoDAO();

            abastecimentoDAO.Cadastrar(abastecimentos);
            MessageBox.Show("Cadastrado!");
        }