Esempio n. 1
0
 //-------------------------------------------------------------------------------------------------------------------
 private void btLocalizar_Click(object sender, EventArgs e)
 {
     try
     {
         frmConsultaProduto fcproduto = new frmConsultaProduto();
         fcproduto.ShowDialog();
         if (fcproduto.codigo != -1)
         {
             BLLProduto    bll    = new BLLProduto();
             ModeloProduto modelo = bll.carregaModelo(fcproduto.codigo);
             txtCodigo.Text    = modelo.pro_cod.ToString();
             txtNome.Text      = modelo.pro_nome.ToString();
             rtbDescricao.Text = modelo.pro_descricao.ToString();
             //pbFoto.Image = (Image) modelo.pro_foto;
             try
             {
                 MemoryStream ms = new MemoryStream(modelo.pro_foto);
                 pbFoto.Image = Image.FromStream(ms);
             }
             catch (Exception erro)
             {
             }
             //txtfoto.Text = modelo.pro_foto.ToString();
             txtValorPago.Text            = modelo.pro_valorvenda.ToString();
             txtValorVenda.Text           = modelo.pro_valorvenda.ToString();
             NUDQuantidade.Text           = modelo.pro_qtde.ToString();
             cbUmed.SelectedValue         = modelo.umed_cod.ToString();
             cbCategoria.SelectedValue    = modelo.cat_cod.ToString();
             cbSubCategoria.SelectedValue = modelo.scat_cod.ToString();
             BLLCategoria bllcat = new BLLCategoria();
             cbCategoria.DataSource    = bllcat.Listagem();
             cbCategoria.DisplayMember = "cat_nome";
             cbCategoria.ValueMember   = "cat_cod";
             try
             {
                 BLLSubCategoria bllsub = new BLLSubCategoria();
                 cbSubCategoria.DataSource    = bllsub.ListagemComCodigo((int)cbCategoria.SelectedValue);
                 cbSubCategoria.DisplayMember = "scat_nome";
                 cbSubCategoria.ValueMember   = "scat_cod";
             }
             catch { }
             BLLUndMedida bllumed = new BLLUndMedida();
             cbUmed.DataSource    = bllumed.Listagem();
             cbUmed.DisplayMember = "umed_nome";
             cbUmed.ValueMember   = "umed_cod";
             txtTamanho.Text      = modelo.pro_tamanho.ToString();
             txtCodigoBarras.Text = modelo.pro_codigobarras.ToString();
             this.alteraBotoes(3);
         }
         fcproduto.Dispose();
     }catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
Esempio n. 2
0
        //-------------------------------------------------------------------------------------------------------------------
        private void btProLoc_Click(object sender, EventArgs e)
        {
            frmConsultaProduto fc = new frmConsultaProduto();

            fc.ShowDialog();
            if (fc.codigo != -1)
            {
                txtProCod.Text = fc.codigo.ToString();
                this.txtProCod_Leave(sender, e);
            }
            fc.Dispose();
        }
Esempio n. 3
0
        //-------------------------------------------------------------------------------------------------------------------
        private void produtoToolStripMenuItem4_Click(object sender, EventArgs e)
        {
            // Cria um novo formulário
            Form frm = new frmConsultaProduto();

            // Atribui um titulo ao formulário
            frm.Text = "Consulta de Produto";
            // Altera a cor de fundo do formulário
            //frmClientes.BackColor = System.Drawing.Color.LightGray;
            // Maximiza o formulário filho
            frm.WindowState = System.Windows.Forms.FormWindowState.Normal;
            // Define quem o pai desta janela
            frm.MdiParent = this;
            // exibe o formulário
            frm.Show();
            //frmConsultaProduto frm = new frmConsultaProduto();
            //frm.ShowDialog();
            //frm.Dispose();
        }