Ejemplo n.º 1
0
        public void ImportarTeleMarketing()
        {
            string ok   = "";
            string erro = "";

            List <ELogin> Logins = new NLogin().Listar(NLogin.eTipo.Telemarketing);
            SalvarObjetoRequest <LoginInfo> lLogin;

            foreach (ELogin item in Logins)
            {
                try
                {
                    lLogin                               = new SalvarObjetoRequest <LoginInfo>();
                    lLogin.Objeto                        = new LoginInfo();
                    lLogin.Objeto.CdAssessor             = null;
                    lLogin.Objeto.CdAssinaturaEletronica = item.Assinatura;
                    lLogin.Objeto.CdSenha                = item.Senha;
                    lLogin.Objeto.DsEmail                = item.Email;
                    lLogin.Objeto.DsRespostaFrase        = "";
                    lLogin.Objeto.DtUltimaExpiracao      = DateTime.Now;
                    lLogin.Objeto.IdFrase                = null;
                    lLogin.Objeto.NrTentativasErradas    = 0;
                    lLogin.Objeto.DsNome                 = item.Nome;
                    lLogin.Objeto.TpAcesso               = Intranet.Contratos.Dados.Enumeradores.eTipoAcesso.TeleMarketing;

                    ClienteDbLib.Salvar(lLogin, false);
                    ok += item.Email + " - " + Environment.NewLine;
                }
                catch (Exception ex)
                {
                    erro += item.Email + " - " + ex.Message + " - " + Environment.NewLine;
                }
            }

            string xerro = erro;
            string xok   = ok;
        }