コード例 #1
0
        private void CarregarDadosTelefones(int id_pes)
        {
            int ordem = 0;

            TelefonesBL telBL = new TelefonesBL();
            List<Telefones> telefones = telBL.PesquisarBL(id_pes);

            foreach (Telefones tel in telefones)
            {
                ordem++;
                DataRow linha = dtFone.NewRow();

                linha["IDORDEM"] = ordem;
                linha["ID"] = tel.Id;
                linha["DESCRICAO"] = tel.Descricao;
                linha["NUMERO"] = tel.Numero;

                dtFone.Rows.Add(linha);
            }

            Session["tbfone"] = dtFone;
            dtgTelefones.DataSource = dtFone;
            dtgTelefones.DataBind();
            ordem++;
            hfOrdemFone.Value = ordem.ToString(); //proxima ordem
        }