Пример #1
0
        private void btLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaProduto f = new frmConsultaProduto();

            f.ShowDialog();
            if (f.codigo != 0)
            {
                DALConexao    cx     = new DALConexao(DadosDaConexao.StringDeConexao);
                BLLProduto    bll    = new BLLProduto(cx);
                ModeloProduto modelo = bll.CarregaModeloProduto(f.codigo);
                txtCodigo.Text = modelo.CatCod.ToString();
                //colocar os dados na tela
                txtCodigo.Text               = modelo.ProCod.ToString();
                txtDescricao.Text            = modelo.ProDescricao;
                txtNome.Text                 = modelo.ProNome;
                txtQtde.Text                 = modelo.ProQtde.ToString();
                txtValorPago.Text            = modelo.ProValorPago.ToString();
                txtValorVenda.Text           = modelo.ProValorVenda.ToString();
                cbCategoria.SelectedValue    = modelo.CatCod;
                cbSubCategoria.SelectedValue = modelo.ScatCod;
                cbUnd.SelectedValue          = modelo.UmedCod;


                txtValorPago_Leave(sender, e);
                txtValorVenda_Leave(sender, e);
                alteraBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alteraBotoes(1);
            }
            f.Dispose();
        }
Пример #2
0
        private void produtoToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaProduto f = new frmConsultaProduto();

            f.ShowDialog();
            f.Dispose();
        }