示例#1
0
        private void btnConfirmar_Click(object sender, EventArgs e)
        {
            try
            {
                daoCliente.PagCliente(id, Decimal.Parse(txtValor.Text));

                DividaDetalhada divida = new DividaDetalhada(id, txtValor.Text);
                dividaDetalhada.AlterStausVendaDetalhada(divida);

                MessageBox.Show("Pagamento confirmado!");
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro!!! " + ex);
            }
        }
示例#2
0
        private void btnConfirmar_Click(object sender, EventArgs e)
        {
            decimal  debito = 0, credito = 0, dinheiro = 0;
            DateTime date     = DateTime.Now;
            string   bandeira = cbxBand.Text;

            try
            {
                if (cbxPag.Text == "")
                {
                    MessageBox.Show("O campo de pagamento não pode ser vazio!");
                }
                else
                {
                    daoCliente.PagCliente(id, Decimal.Parse(txtValor.Text));
                    DaoVenda.UpdateCrediario("1", txtValor.Text);

                    if (cbxPag.Text == "Débito")
                    {
                        debito = decimal.Parse(txtValor.Text);
                    }
                    else if (cbxPag.Text == "Crédito")
                    {
                        credito = decimal.Parse(txtValor.Text);
                    }
                    else if (cbxPag.Text == "Dinheiro")
                    {
                        dinheiro = decimal.Parse(txtValor.Text);
                    }

                    Venda     venda     = new Venda(lblId.Text, "0", txtValor.Text, date.ToString(), cbxPag.Text, cbxBand.Text, "0");
                    Pagamento pagamento = new Pagamento(debito, credito, dinheiro, 0);
                    daoPagamento.InsertPagCrediario(venda);
                    daoPagamento.InsertPagamento(pagamento, "pagamento");


                    MessageBox.Show("Pagamento confirmado!");
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro!!! " + ex);
            }
        }