Esempio n. 1
0
        private void FmrEditar_Load(object sender, EventArgs e)
        {
            PopularCategoria();
            PopularFornecedor();
            PopularMarca();
            SqlDataReader dt;

            byte[] foto = new Byte[0];

            dt                 = daoProd.SelectProdCompletoId(id);
            txtCodigo.Text     = dt["PROD_COD"].ToString();
            txtNome.Text       = dt["PROD_NOME"].ToString();
            txtPreco.Text      = dt["PROD_VALOR"].ToString();
            txtVenda.Text      = dt["PROD_VALOR_VENDA"].ToString();
            txtQtd.Text        = dt["PROD_QTD"].ToString();
            txtQtdMin.Text     = dt["PROD_QTD_MIN"].ToString();
            cbxCategoria.Text  = dt["SUB_CAT_TIPO"].ToString();
            cbxMarca.Text      = dt["PROD_MARCA"].ToString();
            cbxFornecedor.Text = dt["FOR_NOME_FANT"].ToString();
            catId              = dt["SUB_CAT_ID"].ToString();
            fornId             = dt["FOR_ID"].ToString();

            foto = fotos.RetornaImg(id);

            if (foto == null)
            {
                pictureBox1.Image = null;
            }
            else
            {
                MemoryStream stream = new MemoryStream(foto);
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                pictureBox1.Image    = Image.FromStream(stream);
            }
        }