コード例 #1
0
        /// <summary>
        /// Regresa los datos del Servidor SMPT
        /// </summary>
        public SMTPClienteDatos TraerServidorSMPT()
        {
            SMTPClienteDatos smtpRegreso = new SMTPClienteDatos(0, "");

                   using (SqlCommand cm = new SqlCommand("sp_Smehl_TraeSMPTinfo", RegresaConnexionstring()))
                   {

                       cm.CommandType = CommandType.StoredProcedure;

                       //cm.Parameters.Add("@IP", SqlDbType.NVarChar).Value = "pIP";
                       //cm.Parameters.Add("@Puerto", SqlDbType.NVarChar).Value = "pPuerto";

                       cm.Connection.Open();
                       SqlDataReader rd = cm.ExecuteReader();

                       while (rd.Read())
                       {
                           smtpRegreso = new SMTPClienteDatos(Convert.ToInt32(rd["Puerto"].ToString()), rd["IP"].ToString());

                       }
                   }

               return smtpRegreso;
        }
コード例 #2
0
        /// <summary>
        /// Trae datos de Servidor SMPT
        /// </summary>
        /// <returns></returns>
        protected SMTPClienteDatos TraerServidorSMPT()
        {
            SMTPClienteDatos smtpRegreso = new SMTPClienteDatos();
               try
               {
               //NotificacionEmailDA NDA = new NotificacionEmailDA(TipoApp);
               //smtpRegreso = NDA.TraerServidorSMPT();

               //ParametrosDA parametros = new ParametrosDA(TipoApp);
               //List<ParametrosDelSistemaDetalle> listaParametros = parametros.SeleccionarGrupoDeParametros(eGruposDeParametros.FormatosDeNotificaciones, eSubGruposDeParametros.SMTP);

               //smtpRegreso.Nombre = (from c in listaParametros
               //                      where c.Clave.Equals("IP")
               //                      select c.Valor).FirstOrDefault().ToString();

               //smtpRegreso.Puerto = Convert.ToInt32((from c in listaParametros
               //                                      where c.Clave.Equals("Puerto")
               //                                      select c.Valor).FirstOrDefault());

               smtpRegreso.Nombre = "relaysmtp.ndc.nna";
               smtpRegreso.Puerto = Convert.ToInt32("25");

               }
               catch (Exception ex)
               {
               ExceptionNotificacionEmail NotificacionException = new ExceptionNotificacionEmail("El Metodo TraerServidorSMPT fallo" + " || " + ex);
               NotificacionEmail notificacion = new NotificacionEmail("Error en SMEHL", NotificacionException);
               NotificacionEmailService NS = new NotificacionEmailService(ConGenral);
               NS.EnviarNotificacion(notificacion);

               throw NotificacionException;
               }

               return smtpRegreso;
        }