Esempio n. 1
0
        public void ChecarId(string objeto)
        {
            ProdutoPst produto = new ProdutoPst();

            DisplayData(produto.checar(objeto));

            if (table.Rows.Count > 0)
            {
                txt_id_produto.Text = table.Rows[0]["id_produto"].ToString();
                txt_valor_u.Text    = table.Rows[0]["valor"].ToString();
                calcularPreco();

                EstoquePst estoque = new EstoquePst();
                DisplayData(estoque.checar(objeto));

                if (table.Rows.Count > 0)
                {
                    txt_quant_estoque.Text = table.Rows[0]["quantidade_produto"].ToString();

                    ClientePst cliente = new ClientePst();
                    DisplayData(cliente.checar(cbb_cliente.Text));

                    if (table.Rows.Count > 0)
                    {
                        txt_id_cliente.Text = table.Rows[0]["id_cliente"].ToString();
                    }
                }

                PesquisarObjeto();
            }
        }
Esempio n. 2
0
 public void Checar(string objeto)
 {
     try
     {
         ClientePst cliente = new ClientePst();
         DisplayData(cliente.checar(objeto));
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }
Esempio n. 3
0
        public void PesquisarObjeto(string coluna, string objeto)
        {
            try
            {
                PagamentoPst pagamento = new PagamentoPst();
                if (aux == "cliente" || string.IsNullOrEmpty(aux))
                {
                    aux = "procurar";
                    ClientePst cliente = new ClientePst();
                    DisplayData(cliente.checar(objeto));
                    if (table.Rows.Count > 0)
                    {
                        if (!string.IsNullOrEmpty(table.Rows[0]["debito"].ToString()))
                        {
                            cbb_cliente.Text    = table.Rows[0]["nome"].ToString();
                            txt_debito.Text     = table.Rows[0]["debito"].ToString();
                            cbb_id_cliente.Text = table.Rows[0]["id_cliente"].ToString();
                        }
                        else
                        {
                            txt_debito.Text = "0";
                        }
                    }
                    aux = "";
                }
                else if (aux == "id")
                {
                    aux = "";
                    DisplayData(pagamento.Pesquisar(coluna, int.Parse(objeto)));

                    if (table.Rows.Count > 0)
                    {
                        if (!string.IsNullOrEmpty(table.Rows[0]["id_movimento"].ToString()))
                        {
                            cbb_cliente.Text    = table.Rows[0]["nome_cliente"].ToString();
                            cbb_id_cliente.Text = table.Rows[0]["id_cliente"].ToString();
                        }
                        else
                        {
                            txt_debito.Text = "0";
                        }
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Esempio n. 4
0
        public void ChecarId(string objeto)
        {
            try {
                ProdutoPst produto = new ProdutoPst();
                DisplayData(produto.checar(objeto));

                if (table.Rows.Count > 0)
                {
                    txt_id_produto.Text = table.Rows[0]["id_produto"].ToString();
                    txt_valor_u.Text    = table.Rows[0]["valor"].ToString();
                    calcularPreco();

                    EstoquePst estoque = new EstoquePst();
                    DisplayData(estoque.checar(objeto));

                    if (table.Rows.Count > 0)
                    {
                        txt_quant_estoque.Text = table.Rows[0]["quantidade_produto"].ToString();

                        ClientePst cliente = new ClientePst();
                        DisplayData(cliente.checar(cbb_cliente.Text));

                        if (table.Rows.Count > 0)
                        {
                            txt_id_cliente.Text = table.Rows[0]["id_cliente"].ToString();
                        }
                    }

                    PesquisarObjeto();
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message + " A tentativa de busca falhou!");
            }
        }
Esempio n. 5
0
        public void Checar(string objeto)
        {
            ClientePst cliente = new ClientePst();

            DisplayData(cliente.checar(objeto));
        }