Пример #1
0
        public Boolean inserir_venda_promissoria(decimal valor)
        {
            try
            {
                //this.cliente = 23 Consumidor Final -- Cliente PDV
                objDAL      = new VendasDAL();
                this.codigo = objDAL.inserir_venda_promissoria(this.codigo, this.cliente, this.vendedor, this.parcelas, this.juros, this.desconto, this.percentual);

                decimal x = (valor / parcelas);

                DateTime dt = this.data;
                for (int i = 1; i <= this.parcelas; i++)
                {
                    objDAL.inserir_venda_promissoria_meses(codigo, parcelas, dt.ToShortDateString(), juros, x);
                    dt = dt.AddMonths(+1);
                }

                VendasBLL objVen    = new VendasBLL();
                VendasDAL cmd_venda = new VendasDAL();

                cmd_venda.inserir(this.cliente, DateTime.Now, vendedor, vendedor, 0,
                                  this.parcelas, valor, "Promissória", 0,
                                  0, valor, "Promissoria", "Promissoria", 0, 0, "");



                objDAL = null;
                return(true);
            }
            catch (Exception e)
            {
                throw;
                return(false);
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            VendasDAL ven = new VendasDAL();

            try
            {
                if (cboProduto.SelectedIndex > -1)
                {
                    codigo = cboProduto.SelectedValue.ToString();
                }
                else
                {
                    codigo = "0";
                }

                DataTable tab = null;
                dataInicial = txtDtInicial.Value;
                dataFinal   = txtDtFinal.Value;

                tab = ven.EstoqueHistoricoProduto(int.Parse(codigo), dataInicial, dataFinal);
                dataGridView1.DataSource = tab;
                //if (tab.Rows.Count > 0)
                //{
                //    pictureBox1.Visible = true;
                //    btnver.Visible = true;
                //}
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #3
0
 public void alterarTipoVenda()
 {
     try
     {
         objDAL = new VendasDAL();
         objDAL.alterarTipoVenda(this.codigo, this.forma_pagamento, this.parcelas, this.ven_tipo);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #4
0
 public void cancelarVenda()
 {
     try
     {
         objDAL = new VendasDAL();
         objDAL.cancelarVenda(codigo, this.ven_status);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #5
0
 public void localizar()
 {
     try
     {
         objDAL      = new VendasDAL();
         this.codigo = objDAL.localizar(this.codigo);
         objDAL      = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #6
0
 public void retorna_xml()
 {
     try
     {
         objDAL   = new VendasDAL();
         this.xml = objDAL.localizar_xml(this.codigo);
         objDAL   = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #7
0
 public void excluir()
 {
     try
     {
         objDAL = new VendasDAL();
         objDAL.excluir(this.codigo);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #8
0
 public String vincula_xml_venda(int id_venda, int sessao, String xmlpuro, String data_hora, String nsat)
 {
     try
     {
         objDAL = new VendasDAL();
         objDAL.alterar_xml(id_venda, sessao, xmlpuro, data_hora, nsat);
         objDAL = null;
         return("");
     }
     catch (Exception e)
     {
         return(e.Message);
     }
 }
Пример #9
0
 public DataTable seleciona_promissorias(String search)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.seleciona_promissorias(search);
         objDAL = null;
         return(tab);
     }
     catch (Exception) {
         throw;
     }
 }
Пример #10
0
 public void fecha_promissoria(Int32 id)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         objDAL.fecha_promissoria(id);
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #11
0
 public DataTable FormarCupom(int venda)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.FormarCupom(venda);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #12
0
 public DataTable seleciona_itens_venda_troca(String codigo_venda)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.localizar_itens_troca(codigo_venda);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #13
0
 public DataTable LocalizarRelatorioVenda(String data_inicial, String data_final)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.LocalizarRelatorioVendas(data_inicial, data_final);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #14
0
 public DataTable LocalizarSegundaVia(Int32 usuario)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.LocalizarSegundaVia(usuario);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #15
0
 public DataTable Localiza_Cupom()
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.localizar_vendas_troca(this.Data_inicial, this.Data_final);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #16
0
 public DataTable verificaLimiteClienteTotal(int cli_codigo)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.verificaLimiteClienteTotal(cli_codigo);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #17
0
 public String Localiza_Nome_Cliente_promissoria(Int32 id)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.localizar_cliente_promissoria(id);
         objDAL = null;
         return(tab.Rows[0].ItemArray[0].ToString());
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #18
0
 public DataTable seleciona_promissorias_meses(Int32 id)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.seleciona_promissorias_meses(id);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #19
0
 // Fim *******************************************
 public DataTable localizarComRetorno(String descricao, String atributo)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.localizar(descricao, atributo);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #20
0
 public DataTable localizarEmTudo(String descricao)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.localizarEmTudo(descricao);
         objDAL = null;
         return(tab);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #21
0
 public void localizar(String descricao, String atributo)
 {
     // Alteração 02/01/2015
     // Foi retirado a pesquisa datatable ven_cliente, ven_valortotal e ven_valorfinal para atualizar os valores originais do valor da venda.
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.localizar(descricao, atributo);
         if (tab.Rows.Count > 0)
         {
             this.codigo   = int.Parse(tab.Rows[0]["ven_codigo"].ToString());
             this.cliente  = int.Parse(tab.Rows[0]["ven_cliente"].ToString());
             this.data     = DateTime.Parse(tab.Rows[0]["ven_dataVenda"].ToString());
             this.usuario  = int.Parse(tab.Rows[0]["ven_usuario"].ToString());
             this.vendedor = int.Parse(tab.Rows[0]["ven_vendedor"].ToString());
             if (tab.Rows[0]["ven_formaPagamento"] != DBNull.Value)
             {
                 this.forma_pagamento = int.Parse(tab.Rows[0]["ven_formaPagamento"].ToString());
             }
             else
             {
                 this.forma_pagamento = 0;
             }
             if (tab.Rows[0]["ven_qtdParcelas"] != DBNull.Value)
             {
                 this.parcelas = int.Parse(tab.Rows[0]["ven_qtdParcelas"].ToString());
             }
             else
             {
                 this.parcelas = 0;
             }
             this.valor      = decimal.Parse(tab.Rows[0]["ven_valorTotal"].ToString());
             this.observacao = tab.Rows[0]["ven_observacao"].ToString();
             this.desconto   = decimal.Parse(tab.Rows[0]["ven_desconto"].ToString());
             this.percentual = decimal.Parse(tab.Rows[0]["ven_percentualDesconto"].ToString());
             this.valorFinal = decimal.Parse(tab.Rows[0]["ven_valorFinal"].ToString());
             this.ven_status = tab.Rows[0]["ven_status"].ToString();
             this.ven_tipo   = tab.Rows[0]["ven_tipo"].ToString();
             this.ven_ticket = int.Parse(tab.Rows[0]["ven_ticket"].ToString());
         }
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #22
0
 //Novo localizar Ticket FastFood 02/01/2016
 public void localizarLeave_Ticket(String descricao, String atributo)
 {
     try
     {
         DataTable tab;
         objDAL = new VendasDAL();
         tab    = objDAL.localizarLeave_Ticket(descricao, atributo);
         if (tab.Rows.Count > 0)
         {
             this.codigo   = int.Parse(tab.Rows[0]["ven_codigo"].ToString());
             this.cliente  = int.Parse(tab.Rows[0]["ven_cliente"].ToString());
             this.data     = DateTime.Parse(tab.Rows[0]["ven_dataVenda"].ToString());
             this.usuario  = int.Parse(tab.Rows[0]["ven_usuario"].ToString());
             this.vendedor = int.Parse(tab.Rows[0]["ven_vendedor"].ToString());
             if (tab.Rows[0]["ven_formaPagamento"] != DBNull.Value)
             {
                 this.forma_pagamento = int.Parse(tab.Rows[0]["ven_formaPagamento"].ToString());
             }
             else
             {
                 this.forma_pagamento = 0;
             }
             if (tab.Rows[0]["ven_qtdParcelas"] != DBNull.Value)
             {
                 this.parcelas = int.Parse(tab.Rows[0]["ven_qtdParcelas"].ToString());
             }
             else
             {
                 this.parcelas = 0;
             }
             this.valor      = decimal.Parse(tab.Rows[0]["ven_valorTotal"].ToString());
             this.observacao = tab.Rows[0]["ven_observacao"].ToString();
             this.desconto   = decimal.Parse(tab.Rows[0]["ven_desconto"].ToString());
             this.percentual = decimal.Parse(tab.Rows[0]["ven_percentualDesconto"].ToString());
             this.valorFinal = decimal.Parse(tab.Rows[0]["ven_valorFinal"].ToString());
             this.ven_status = tab.Rows[0]["ven_status"].ToString();
             this.ven_tipo   = tab.Rows[0]["ven_tipo"].ToString();
             this.ven_ticket = int.Parse(tab.Rows[0]["ven_ticket"].ToString());
         }
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #23
0
 public void localizarProxAnterior(String descricao, int codigo)
 {
     try
     {
         DataTable tab = null;
         objDAL = new VendasDAL();
         tab    = objDAL.localizarProxAnterior(descricao, codigo);
         if (tab.Rows.Count > 0)
         {
             this.codigo = int.Parse(tab.Rows[0][0].ToString());
         }
         objDAL = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #24
0
 public void localizarPrimeiroUltimo(String descricao)
 {
     try
     {
         DataTable tab    = null;
         int       codigo = 0;
         objDAL = new VendasDAL();
         tab    = objDAL.localizarPrimeiroUltimo(descricao);
         if (tab.Rows.Count > 0)
         {
             int.TryParse(tab.Rows[0][0].ToString(), out codigo);
         }
         this.codigo = codigo;
         objDAL      = null;
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #25
0
 public void alterar(bool consumidorFinal)
 {
     try
     {
         if (consumidorFinal == true)
         {
             objDAL = new VendasDAL();
             objDAL.alterar(this.codigo, this.cliente, this.data, this.usuario, this.vendedor, this.forma_pagamento, this.parcelas, this.valor, this.observacao, this.percentual, this.desconto, this.valorFinal, this.ven_status, this.ven_tipo, this.ven_ticket);
             objDAL = null;
         }
         else
         {
             objDAL = new VendasDAL();
             objDAL.alterar(this.codigo, this.cliente, this.data, this.usuario, this.vendedor, this.forma_pagamento, this.parcelas, this.valor, this.observacao, this.percentual, this.desconto, this.valorFinal, this.ven_status, this.ven_tipo, this.ven_ticket);
             objDAL = null;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #26
0
 public void inserir(bool consumidorFinal)
 {
     try
     {
         if (consumidorFinal == true)
         {
             //this.cliente = 23 Consumidor Final -- Cliente PDV
             objDAL      = new VendasDAL();
             this.codigo = objDAL.inserir(this.cliente, this.data, this.usuario, this.vendedor, this.forma_pagamento, this.parcelas, this.valor, this.observacao, this.percentual, this.desconto, this.valorFinal, "Ativo", this.ven_tipo, this.ven_ticket, this.IDAber, this.CpfCnpj);
             objDAL      = null;
         }
         else
         {
             //this.cliente = 23 Consumidor Final -- Cliente PDV
             objDAL      = new VendasDAL();
             this.codigo = objDAL.inserir(this.cliente, this.data, this.usuario, this.vendedor, this.forma_pagamento, this.parcelas, this.valor, this.observacao, this.percentual, this.desconto, this.valorFinal, "Ativo", this.ven_tipo, this.ven_ticket, this.IDAber, this.CpfCnpj);
             objDAL      = null;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #27
0
        public DataTable gestao_vendas()
        {
            VendasDAL cmd = new VendasDAL();

            return(cmd.gestao_seleciona(this.Data_inicial, this.Data_final, this.vendedor));
        }
Пример #28
0
 //Esse é o construtor da classe VendasBLL
 public VendasBLL()
 {
     objDAL = new VendasDAL();
 }