private void frmRelatorioItensVenda_Load(object sender, EventArgs e)
        {
            BllVenda    bllVenda    = new BllVenda(conexao);
            ModeloVenda modeloVenda = new ModeloVenda();

            if (codVenda > 0)
            {
                modeloVenda = bllVenda.CarregaModeloVenda(codVenda);

                BllCliente bllCliente = new BllCliente(conexao);

                BllItensVenda bllItensVenda = new BllItensVenda(conexao);

                BllEmpresa bllEmpresa = new BllEmpresa(conexao);

                //crItensVenda crItensVenda = new crItensVenda();



                //crItensVenda.Database.Tables["dsOs"].SetDataSource(bllVenda.Localizar(modeloVenda.VenCod.ToString()));
                //crItensVenda.Database.Tables["dsCliente"].SetDataSource(bllCliente.LocalizarPorCodigo(modeloVenda.CliCod.ToString()));
                //crItensVenda.Database.Tables["dsItensVenda"].SetDataSource(bllItensVenda.Localizar(modeloVenda.VenCod));
                //crItensVenda.Database.Tables["dsEmpresa"].SetDataSource(bllEmpresa.LocalizarPorCodigo(1.ToString()));



                crvItensVenda.ReportSource = null;

                //crvItensVenda.ReportSource = crItensVenda;
            }
        }
Esempio n. 2
0
        //Método para Cadastrar Pedido
        public void CadastrarPedido()
        {
            try
            {
                Pedido   dto = new Pedido();
                BllVenda bll = new BllVenda();
                dto.Operacao = "Pedido";
                int id;
                foreach (DataGridViewRow item in dgv.Rows)
                {
                    dto.EstoqueId  = Convert.ToInt32(item.Cells[0].Value);
                    dto.PrecoVenda = Convert.ToDecimal(item.Cells[3].Value);;
                    dto.Quantidade = Convert.ToInt32(item.Cells[4].Value);

                    string retorno = bll.CadastrarPedido(dto);

                    id = Convert.ToInt32(retorno);
                    dgv.Rows.Clear();
                    SomarItens();
                    SomarTotal();
                    dgv.Refresh();
                    NrVenda();
                    LimparCampos();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro: " + ex.Message);
            }
        }
Esempio n. 3
0
        private void CadastrarVenda()
        {
            Venda    dto = new Venda();
            BllVenda bll = new BllVenda();

            dto.Operacao      = "Venda";
            dto.CaixaFunc     = Convert.ToInt32(lblCaixaFunc.Text);
            dto.ClienteId     = 1;
            dto.TipoPagamento = 2;
            dto.ValorTotal    = Convert.ToDecimal(lblValor.Text);

            string retorno = bll.Cadastrar(dto);

            try
            {
                int id = Convert.ToInt32(retorno);

                if (id > 0)
                {
                    CadastrarPedido();
                }
            }
            catch
            {
                FNotificao.AlerForm("Erro Ao Registrar a Venda " + retorno.ToString(), TipoNotificacao.erro);
            }
        }
Esempio n. 4
0
        //Método para Cadastrar Venda
        private void CadastrarVenda()
        {
            Venda    dto = new Venda();
            BllVenda bll = new BllVenda();

            dto.Operacao   = "Venda";
            dto.CaixaFunc  = Convert.ToInt32(_CaixaId);
            dto.ClienteId  = Convert.ToInt32(txtCodigo.Text);
            dto.ValorTotal = Convert.ToDecimal(ValorTotal);
            if (cbTipoPagam.SelectedIndex == 1)
            {
                dto.TipoPagamento = 1;
            }
            else if (cbTipoPagam.SelectedIndex == 2)
            {
                dto.TipoPagamento = 2;
            }
            else if (cbTipoPagam.SelectedIndex == 3)
            {
                dto.TipoPagamento = 3;
                dataPagam.Enabled = true;
            }
            else
            {
                FNotificao.AlerForm("Tipo de Pagamento Inválido", TipoNotificacao.aviso);
            }


            string retorno = bll.Cadastrar(dto);

            try
            {
                int id = Convert.ToInt32(retorno);
                FNotificao.AlerForm("Venda Efetuada Com Sucesso!!!", TipoNotificacao.sucesso);
                FVenda f = FVenda.getInstancia(null);
                f.CadastrarPedido();
                LimparCampos();
                this.Close();
            }
            catch
            {
                FNotificao.AlerForm("Erro Ao Registrar a Venda " + retorno.ToString(), TipoNotificacao.erro);
            }
        }
Esempio n. 5
0
        // Método para Contar o Nr de Venda feita po Caixa
        private void NrVenda()
        {
            Venda    dto = new Venda();
            BllVenda bll = new BllVenda();

            dto.Operacao  = "IdVenda";
            dto.CaixaFunc = Convert.ToInt32(lblCaixaFunc.Text);
            string NrVenda = bll.GerarNrVenda(dto);

            try
            {
                int NrV = Convert.ToInt32(NrVenda);

                lblVenda.Text = NrV.ToString();
            }
            catch
            {
                FNotificao.AlerForm("Erro Ao Gerar Nr de Venda", TipoNotificacao.erro);
            }
        }