コード例 #1
0
        private void GravarTelefones(int idPes)
        {
            TelefonesBL telBL = new TelefonesBL();
            Telefones telefones = new Telefones();

            if (Session["tbfone"] != null)
                dtFone = (DataTable)Session["tbfone"];

            foreach (DataRow linha in dtFone.Rows)
            {
                telefones.Id = utils.ComparaIntComZero(linha["ID"].ToString());
                telefones.Numero = linha["NUMERO"].ToString();
                telefones.Descricao = linha["DESCRICAO"].ToString();
                telefones.PessoaId = idPes;

                if (telefones.Id > 0)
                    telBL.EditarBL(telefones);
                else
                    telBL.InserirBL(telefones);
            }
        }