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

            if (Session["tbexcluidos"] != null)
            {
                dtExcluidos = (DataTable)Session["tbexcluidos"];
                foreach (DataRow row in dtExcluidos.Rows)
                {
                    switch (row["TIPO"].ToString().ToUpper())
                    {
                        case "T": //telefones
                            {
                                telefones.Id = utils.ComparaIntComZero(row["IDCODIGO"].ToString());
                                telBL.ExcluirBL(telefones);
                                break;
                            }
                    }
                }
            }
        }
コード例 #2
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);
            }
        }
コード例 #3
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
        }