Exemplo n.º 1
0
        private void btnSolicCompra_Click(object sender, EventArgs e)
        {
            try
            {
                var obj = (localhostCmp.Solicitacoes)grdGerenciamento.CurrentRow.DataBoundItem;
                localhostCmp.Compras pedido = new localhostCmp.Compras();

                frmSolicitacaoRelatorio relatorioSolicitacao = new frmSolicitacaoRelatorio();
                relatorioSolicitacao.Pedido = obj.IdPedido;
                if (obj.Status == "GERADO")
                {
                    relatorioSolicitacao.Show();
                    CarregarGrid();
                }
                else if (obj.Status == "APROVADO")
                {
                    DialogResult dialogResult = MessageBox.Show("Você quer aprovar esta Solicitação de Compra?", "Confirmação", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        pedido.AtualizarGerar(obj.IdPedido);
                        relatorioSolicitacao.Show();
                        CarregarGrid();
                    }
                }
                else
                {
                    MessageBox.Show("Pedido não entra nesta área!", "Erro", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void CarregarGrid()
        {
            localhostCmp.Compras buscaFornecedor = new localhostCmp.Compras();

            grdGerenciamento.AutoGenerateColumns = false;
            grdGerenciamento.DataSource          = null;
            grdGerenciamento.DataSource          = buscaFornecedor.RetornaFornecedor();
            grdGerenciamento.Show();
        }
Exemplo n.º 3
0
        void CarregarGrid()
        {
            localhostCmp.Compras buscaSolicitacaoCompras = new localhostCmp.Compras();

            grdGerenciamento.AutoGenerateColumns = false;
            grdGerenciamento.DataSource          = null;
            grdGerenciamento.DataSource          = buscaSolicitacaoCompras.RetornaSolicitacaoDeCompra();
            grdGerenciamento.Show();
        }
Exemplo n.º 4
0
        private void CarregarGrid()
        {
            localhostCmp.Compras buscaSolicitacaoItem = new localhostCmp.Compras();

            int IdPedido = Convert.ToInt32(txtIdPedido.Text);

            grdGerenciamento.AutoGenerateColumns = false;
            grdGerenciamento.DataSource          = null;
            grdGerenciamento.DataSource          = buscaSolicitacaoItem.RetornaSolicitacaoItem(IdPedido);
            grdGerenciamento.Show();
        }
Exemplo n.º 5
0
        private void frmPreencherOrcamento_Load(object sender, EventArgs e)
        {
            txtDataEmissao.Text = DateTime.Now.ToString("dd/MM/yyyy");

            localhostCmp.Compras buscaFornecedor = new localhostCmp.Compras();

            cmbVendedor.DisplayMember = "Nome";
            cmbVendedor.ValueMember   = "Id";
            cmbVendedor.DataSource    = buscaFornecedor.RetornaComboFornecedor();
            CarregarGrid();
        }
Exemplo n.º 6
0
        private void btnGravar_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtCEP.Text == "     -" || txtBairro.Text == "" || txtCidade.Text == "" || txtEmail.Text == "" || txtCidade.Text == "" || txtEndereco.Text == "" || txtEstado.Text == "" || txtNome.Text == "" || txtNumero.Text == "" || txtTelefone1.Text == "+   (  )      -")
                {
                    MessageBox.Show("OOPS! Tem algum dado faltando!", "Usuário", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    localhostCmp.Compras cadastroFornecedor = new localhostCmp.Compras();

                    string Nome         = txtNome.Text;
                    string CPF          = txtCPF.Text;
                    string CEP          = txtCEP.Text;
                    string Endereco     = txtEndereco.Text;
                    string Bairro       = txtBairro.Text;
                    string Cidade       = txtCidade.Text;
                    string Complemento  = txtComplemento.Text;
                    string Estado       = txtEstado.Text;
                    string Complemento2 = txtComplemento2.Text;
                    string Numero       = txtNumero.Text;
                    string Telefone     = txtTelefone1.Text;
                    string Telefone2    = txtTelefone2.Text;
                    string EMAIL        = txtEmail.Text;



                    if (cadastroFornecedor.CadastroFornecedor(Nome, CPF, CEP, Endereco, Bairro, Cidade, Complemento, Estado, Complemento2, Numero, Telefone, Telefone2, EMAIL))
                    {
                        DialogResult dialogResult = MessageBox.Show("Cadastrado com Sucesso!\nDeseja continuar cadastrando?", "Usuário", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        if (dialogResult == DialogResult.Yes)
                        {
                            LimparCampos();
                        }
                        else
                        {
                            this.Close();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Erro ao gravar Fornecedor!!!", "Usuário", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 7
0
        private void btnGerar_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dialogResult = MessageBox.Show("Gerar Orçamento deste Pedido?", "Confirmação", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    int    IdPedido       = Convert.ToInt32(txtIdPedido.Text);
                    string Tipo           = txtTipo.Text;
                    string DataEmissao    = txtDataEmissao.Text;
                    string Observacoes    = txtObservacoes.Text;
                    string Vendedor       = cmbVendedor.SelectedValue.ToString();
                    string PrazoEntrega   = txtPrazo.Text;
                    string CondicaoPag    = txtCondicaoPag.Text;
                    double ValorAdicional = Convert.ToDouble(txtValorAdicional.Text.Replace(",", "").Replace(".", ","));
                    double Valor          = Convert.ToDouble(txtValor.Text.Replace(",", "").Replace(".", ","));
                    int    QtdItens       = Convert.ToInt32(txtQuantidade.Text);

                    localhostCmp.Compras gravarOrcamento = new localhostCmp.Compras();

                    localhostCmp.Compras Atualiza = new localhostCmp.Compras();
                    if (gravarOrcamento.GravarOrcamento(IdPedido, Tipo, DataEmissao, Observacoes, Vendedor, PrazoEntrega, CondicaoPag, ValorAdicional, Valor, QtdItens) == true)
                    {
                        if (Atualiza.Atualizar(IdPedido) == true)
                        {
                            MessageBox.Show("Orçamento Gravado!!", "Confirmação", MessageBoxButtons.OK);

                            frmOrcamentoRelatorio relatorioOrcamento = new frmOrcamentoRelatorio();
                            relatorioOrcamento.Pedido = IdPedido;
                            relatorioOrcamento.Show();

                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show("Erro ao atualizar Orçamento!!", "Confirmação", MessageBoxButtons.OK);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Não foi possível gravar Orçamento!!", "Confirmação", MessageBoxButtons.OK);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " Nenhum Item Selecionado!", "Confirmação", MessageBoxButtons.OK);
            }
        }
Exemplo n.º 8
0
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Você tem certeza que quer excluir esta Solicitação de Compra?", "Confirmação", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                localhostCmp.Compras deletarSolicitacao = new localhostCmp.Compras();

                int IdPedido = Convert.ToInt32(txtIdPedido.Text);

                if (deletarSolicitacao.Arquivar(IdPedido) == true)
                {
                    MessageBox.Show("Solicitação Excluída com Sucesso!", "Confirmação", MessageBoxButtons.OK);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Solicitação não pode ser Excluída!", "Confirmação", MessageBoxButtons.OK);
                }
            }
        }
Exemplo n.º 9
0
        public static DataSet CompraCompleta(int IdPedido)
        {
            localhostCmp.Compras CompraCompleta = new localhostCmp.Compras();

            return(CompraCompleta.CompraCompletaDataSet(IdPedido));
        }
Exemplo n.º 10
0
        public static DataSet Orcamento(int IdPedido)
        {
            localhostCmp.Compras orcamento = new localhostCmp.Compras();

            return(orcamento.OrcamentoDataSet(IdPedido));
        }