예제 #1
0
        public void Edicao(Control.ControlCollection controles)
        {
            if (Popup.id.Length == 10)
            {
                Popup.id = "0" + Popup.id;
            }
            int    i = 4;
            String a = "Select CPF,email,nome,tel1,senha,genero,caminho_imagem from tblFuncionario where CPF='" + Popup.id + "'";

            String[] ed = conexao.Retorna_Array(a);
            foreach (Control ctrl in controles)
            {
                if (ctrl is Bunifu.Framework.UI.BunifuMetroTextbox)
                {
                    ctrl.Text = ed[i].ToString();
                    i--;
                }
                else if (ctrl is Bunifu.Framework.UI.BunifuDropdown)
                {
                    try
                    {
                        cxc_Sexo.selectedIndex = Convert.ToInt32(ed[5]);
                    }
                    catch { cxc_Sexo.selectedIndex = 3; }
                }
                else if (ctrl is PictureBox)
                {
                    pictureBox4.Load(ed[6].ToString());
                }
            }
        }
예제 #2
0
 //pega todos os produtos do banco
 public void Recuperar()
 {
     a              = conexao.Retorna_Array("Select * from tblProduto");
     label8.Text    = a[3];
     txt_Preco.Text = a[4];
     String[] x = txt_Preco.Text.Split(',');
     x[1]           = x[1].Remove(x[1].Length - 2);
     txt_Preco.Text = x[0] + "," + x[1];
 }
        public void Edicao(Control.ControlCollection controles)
        {
            int    i = 0;
            String a = "Select preco_unitario,nome,descricao,ID_Categoria,ID_Fornecedor,caminho_imagem from tblProduto where IDProduto='" + Popup.id + "'";

            String[] ed = conexao.Retorna_Array(a);
            txt_Produto.Text = ed[1];
            txt_Preco.Text   = ed[0];
            String[] x = txt_Preco.Text.Split(',');
            x[1]               = x[1].Remove(x[1].Length - 2);
            txt_Preco.Text     = x[0] + "," + x[1];
            txt_Descricao.Text = ed[2];
            Caminho_Antigo     = ed[5];
            pictureBox4.Load(ed[5]);
            cxc_Forn.selectedIndex  = Convert.ToInt32(ed[4]) - 1;
            cxc_Trans.selectedIndex = Convert.ToInt32(ed[3]) - 1;
        }
예제 #4
0
 public void Edicao(Control.ControlCollection controles)
 {
     if (Popup.x == "Transportadora")
     {
         a = "Select nome,email,CNPJ,tel1,endereco,cidade,CEP,estado,caminho_imagem from tblTransportadora where CNPJ='" + Popup.id + "'";
         Caminho_Antigo = conexao.executeQueryComStringRetorno("select caminho_imagem from tblTransportadora where CNPJ='" + Popup.id + "'");
     }
     else if (Popup.x == "Fornecedor")
     {
         a = "Select nome,email,CNPJ,tel1,endereco,cidade,CEP,estado,caminho_imagem from tblFornecedor where CNPJ='" + Popup.id + "'";
         Caminho_Antigo = conexao.executeQueryComStringRetorno("select caminho_imagem from tblFornecedor where CNPJ='" + Popup.id + "'");
     }
     ed                   = conexao.Retorna_Array(a);
     txt_Nome.Text        = ed[0];
     txt_Email.Text       = ed[1];
     txt_CNPJ.Text        = ed[2];
     txt_Tel.Text         = ed[3];
     txt_Endereco.Text    = ed[4];
     txt_Cidade.Text      = ed[5];
     txt_CEP.Text         = ed[6];
     cxc_UF.selectedIndex = Convert.ToInt32(ed[7]);
     pictureBox4.Load(ed[8]);
 }
        public void Edicao(Control.ControlCollection controles)
        {
            if (Popup.id.Length < 11)
            {
                Popup.id = "0" + Popup.id;
            }
            int    i = 6;
            String a = "Select CPF,email,nome,tel1,endereco,cidade,CEP,estado,genero from tblCliente where CPF='" + Popup.id + "'";

            String[] ed = conexao.Retorna_Array(a);
            foreach (Control ctrl in controles)
            {
                if (ctrl is Bunifu.Framework.UI.BunifuMetroTextbox)
                {
                    ctrl.Text = ed[i].ToString();
                    i--;
                }
                else if (ctrl is Bunifu.Framework.UI.BunifuDropdown)
                {
                    if (ctrl.Name == "cxc_UF")
                    {
                        cxc_UF.selectedIndex = Convert.ToInt32(ed[7]);
                    }
                    else if (ctrl.Name == "cxc_Sexo")
                    {
                        try
                        {
                            cxc_Sexo.selectedIndex = Convert.ToInt32(ed[8]);
                        }
                        catch
                        {
                            cxc_Sexo.selectedIndex = 3;
                        }
                    }
                }
            }
        }