示例#1
0
        protected void button_editar(object sender, EventArgs e)
        {
            Button btnClicado = (Button)sender;
            int    cdContato  = Int32.Parse(btnClicado.CommandArgument);

            using (ContatoBLL contatoBll = new ContatoBLL())
            {
                ContatoInfo lstContato = contatoBll.Get(cdContato);

                String nome     = lstContato.DsNome.Value;
                String email    = lstContato.DsEmail.Value;
                String nasci    = lstContato.DtNasci.Value.ToString();
                String cpf      = lstContato.DsCpf.Value;
                String sexo     = lstContato.DsSexo.Value;
                int    estado   = lstContato.CdEstado.Value;
                String cidade   = lstContato.DsCidade.Value;
                String endereco = lstContato.DsEndereco.Value;

                nomeid.Text     = nome;
                emailid.Text    = email;
                nasciid.Text    = nasci;
                cpfid.Text      = cpf;
                sexoid.Text     = sexo;
                estadoid.Text   = estado.ToString();
                cidadeid.Text   = cidade;
                enderecoid.Text = endereco;

                codigo.Value = cdContato.ToString();
            }

            UpdatePanel2.Update();
            btsalvar.Text = "salvar alteração";
        }