Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                VendaInformation venda = new VendaInformation();
                venda.Quantidade = int.Parse(quantidadeTextBox.Text);
                venda.CodigoCliente = (int)clienteComboBox.SelectedValue;
                venda.CodigoProduto = (int)produtoComboBox.SelectedValue;
                venda.Data = DateTime.Now;
                venda.Faturado = false;

                VendasBLL obj = new VendasBLL();
                obj.Incluir(venda);

                MessageBox.Show("A venda foi realizada com sucesso!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
 private void VendasForm_Load(object sender, EventArgs e)
 {
     VendasBLL obj = new VendasBLL();
     clienteComboBox.DataSource = obj.ListaDeClientes;
     produtoComboBox.DataSource = obj.ListaDeProdutos;
 }