예제 #1
0
        private void mostrar(FConsultaProduto f)
        {
            int index = f.index;

            id                         = int.Parse(f.dt.Rows[index]["pro_id"].ToString());
            idcategoria                = int.Parse(f.dt.Rows[index]["cat_id"].ToString());
            ttbcategoria.Text          = f.dt.Rows[index]["cat_nome"].ToString();
            ttbnome.Text               = f.dt.Rows[index]["pro_nome"].ToString();
            ttbdescricao.Text          = f.dt.Rows[index]["pro_descricao"].ToString();
            ttbvalor.Text              = decimal.Parse(f.dt.Rows[index]["pro_valor"].ToString()).ToString("00.00");
            ttbquantidade.Text         = decimal.Parse(f.dt.Rows[index]["pro_quantidade"].ToString()).ToString("00");
            ttbcodigo.Text             = f.dt.Rows[index]["pro_codigo"].ToString();
            cbbunidade.SelectedItem    = f.dt.Rows[index]["pro_unidade"].ToString();
            ckbestoque.Checked         = (int.Parse(f.dt.Rows[index]["pro_estoque"].ToString()) == 1);
            ckbdesativar.Checked       = (int.Parse(f.dt.Rows[index]["pro_status"].ToString()) != 1);
            ttbncm.Text                = f.dt.Rows[index]["pro_ncm"].ToString();
            ncm                        = ttbncm.Text;
            ttbaliquota.Text           = f.dt.Rows[index]["pro_aliquota"].ToString();
            aliquota                   = ttbaliquota.Text;
            ttbcfop.Text               = f.dt.Rows[index]["pro_cfop"].ToString();
            cfop                       = ttbcfop.Text;
            cbborigem.SelectedIndex    = int.Parse(f.dt.Rows[index]["pro_origem"].ToString());
            ttbporcentagemtributo.Text = decimal.Parse(f.dt.Rows[index]["pro_porcentagemtributo"].ToString()).ToString("00.00");
            ttbcst.Text                = f.dt.Rows[index]["pro_cst"].ToString();
            ttbcsosn.Text              = f.dt.Rows[index]["pro_csosn"].ToString();
            ttbcest.Text               = f.dt.Rows[index]["pro_cest"].ToString();
            Image Image1 = null;

            Image1 = ConvertByteArrayToImage((f.dt.Rows[index]["pro_imagem"] as byte[]));

            pictureBox1.Image = Image1;
            pictureBox1.Refresh();
            pictureBox1.Update();
            //ttbimagem.Text = f.dt.Rows[index]["pro_imagem"].ToString();
        }
예제 #2
0
        private void btnpesquisar_Click(object sender, EventArgs e)
        {
            FConsultaProduto f = new FConsultaProduto();

            f.ShowDialog();
            if (f.ok)
            {
                mostrar(f);
                btncategoria.Focus();
                gravacao();
                btnstatus = 1;
            }
            else
            {
                id = 0;
            }
        }