private void BtnBuscar_Click(object sender, EventArgs e)
        {
            IdCompra = "";
            Buscar BuscaCompra = new Buscar("comprasmercadorias");

            BuscaCompra.ShowDialog();
            GridProdutosEditar.Rows.Clear();
            var IdCompraRecuperado = Cadastro.GetIdGenerico();

            try
            {
                IdCompra = IdCompraRecuperado;
                DataTable Tabela        = Cadastro.RetornaCompraMercadoria(IdCompra);
                DataTable TabelaProduto = Cadastro.RetornaProdutoCompra(IdCompra);
                TextNomeLojaEditar.Text        = Tabela.Rows[0]["loja"].ToString();
                TextDataCompraEditar.Text      = Convert.ToDateTime(Tabela.Rows[0]["data"].ToString()).ToString("dd/MM/yyyy");
                TextValorCompraEditar.Text     = Tabela.Rows[0]["valortotal"].ToString();
                TextQuantidadePecasEditar.Text = Tabela.Rows[0]["quantidadepeca"].ToString();
                for (int i = 0; i < TabelaProduto.Rows.Count; i++)
                {
                    GridProdutosEditar.Rows.Add(TabelaProduto.Rows[i]["ID PRODUTO"].ToString(),
                                                TabelaProduto.Rows[i]["CÓDIGO"].ToString(), TabelaProduto.Rows[i]["NOME PRODUTO"].ToString(),
                                                TabelaProduto.Rows[i]["PREÇO CUSTO"].ToString(), TabelaProduto.Rows[i]["QUANTIDADE"].ToString());
                }
            }
            catch
            {
            }
        }
Example #2
0
        private void BtnSelecionarCliente_Click(object sender, EventArgs e)
        {
            var BuscarCliente = new Buscar("clientes");

            BuscarCliente.ShowDialog();
            var IdCliente = Venda.GetIdGenerico();

            try
            {
                IdClienteVenda = IdCliente;
                DataTable TabelaCliente = Venda.RetornaCliente(IdCliente);
                TextNomeCliente.Text = TabelaCliente.Rows[0]["nome"].ToString();
            }
            catch
            {
            }
        }
Example #3
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            Buscar BuscaCliente = new Buscar("formasdepagamentos");

            BuscaCliente.ShowDialog();
            var IdFormaRecuperado = Cadastro.GetIdGenerico();

            try
            {
                IdFormadePagamento = IdFormaRecuperado;
                DataTable TabelaForma = Cadastro.RetornaFormaPagamento(IdFormadePagamento);
                TextNomeEditar.Text = TabelaForma.Rows[0]["nome"].ToString();
            }
            catch
            {
            }
        }
Example #4
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            Buscar BuscaCliente = new Buscar("categorias");

            BuscaCliente.ShowDialog();
            var IdCategoriaRecuperado = Cadastro.GetIdGenerico();

            try
            {
                IdCategoria = IdCategoriaRecuperado;
                DataTable TabelaCategoria = Cadastro.RetornaCategoria(IdCategoria);
                TextNomeEditar.Text = TabelaCategoria.Rows[0]["nome"].ToString();
            }
            catch
            {
            }
        }
Example #5
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            Buscar BuscaUsuario = new Buscar("usuarios");

            BuscaUsuario.ShowDialog();
            var IdUsuarioRecuperado = Cadastro.GetIdGenerico();

            try
            {
                IdUsuario = IdUsuarioRecuperado;
                DataTable TabelaForma = Cadastro.RetornaUsuario(IdUsuario);
                TextLoginEditar.Text = TabelaForma.Rows[0]["login"].ToString();
                TextSenhaEditar.Text = TabelaForma.Rows[0]["senha"].ToString();
            }
            catch
            {
            }
        }
Example #6
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            Buscar BuscaCliente = new Buscar("despesas");

            BuscaCliente.ShowDialog();
            var IdDespesaRecuperado = Cadastro.GetIdGenerico();

            try
            {
                IdDespesa = IdDespesaRecuperado;
                DataTable TabelaDespesa = Cadastro.RetornaDespesa(IdDespesa);
                TextNomeEditar.Text  = TabelaDespesa.Rows[0]["nome"].ToString();
                TextDataEditar.Text  = Convert.ToDateTime(TabelaDespesa.Rows[0]["data"].ToString()).ToString("dd/MM/yyyy");
                TextValorEditar.Text = TabelaDespesa.Rows[0]["valor"].ToString();
            }
            catch
            {
            }
        }
Example #7
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            Buscar BuscaCliente = new Buscar("clientes");

            BuscaCliente.ShowDialog();
            var IdCliente = Cliente.GetIdGenerico();

            try
            {
                IdClienteEditar = IdCliente;
                DataTable TabelaCliente = Cliente.RetornaCliente(IdCliente);
                TextNomeEditar.Text           = TabelaCliente.Rows[0]["nome"].ToString();
                TextCpfEditar.Text            = TabelaCliente.Rows[0]["cpf"].ToString();
                TextEndrecoEditar.Text        = TabelaCliente.Rows[0]["endereco"].ToString();
                TextDataNascimentoEditar.Text = TabelaCliente.Rows[0]["datanascimento"].ToString();
                TextTelefoneEditar.Text       = TabelaCliente.Rows[0]["telefone"].ToString();
            }
            catch
            {
            }
        }
Example #8
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            Buscar BuscaCliente = new Buscar("produtos");

            BuscaCliente.ShowDialog();
            var IdProduto = Cadastro.GetIdGenerico();

            try
            {
                IdProdutoEditar = IdProduto;
                DataTable TabelaProduto = Cadastro.RetornaProduto(IdProduto);
                TextNomeEditar.Text                = TabelaProduto.Rows[0]["nome"].ToString();
                TextCorEditar.Text                 = TabelaProduto.Rows[0]["cor"].ToString();
                TextPrecoCustoEditar.Text          = TabelaProduto.Rows[0]["precocusto"].ToString();
                TextPrecoVendaEditar.Text          = TabelaProduto.Rows[0]["precovenda"].ToString();
                ComboCategoriaEditar.SelectedValue = TabelaProduto.Rows[0]["idcategoria"].ToString();
                ComboTamanhoEditar.SelectedValue   = TabelaProduto.Rows[0]["IdTamanho"].ToString();
            }
            catch
            {
            }
        }