Exemple #1
0
        public bool NotificarSolucionConsultaAcademica(Notificacion notificacion)
        {
            var resultado = false;

            try
            {
                string emailAddressTo = string.Empty;
                string subject        = string.Empty;

                /*Enviar correo*/

                subject = string.Format("Notificación - Consulta Académica {0} {1}", notificacion.NumeroConsulta, notificacion.FechaSolucion);

                var sbBody = new StringBuilder();
                //sbBody.AppendLine("<br/>");
                sbBody.AppendLine("<br/>");
                //sbBody.AppendLine("Estimado(a) " + notificacion.NombreApellidoAlumno + " (" + notificacion.CodigoAlumno + ")<br/>");
                sbBody.AppendLine("Estimado Alumno:" + "<br/>");
                sbBody.AppendLine("<br/>");
                sbBody.AppendLine(GetSaludoHora(ConvertidorUtil.GmtToPacific(DateTime.Now)) + "a continuación, se remite la respuesta a su consulta:" + "<b>" + notificacion.ConsultaAcademica + "</b>" + "</br>");
                sbBody.AppendLine("<br/>");
                //sbBody.AppendLine("Consulta: " + notificacion.ConsultaAcademica + "<br/>");
                //sbBody.AppendLine("Fecha Consulta: " + notificacion.FechaConsulta + "<br/>");
                sbBody.AppendLine("<br/>");
                sbBody.AppendLine("<u><b>Respuesta:</b></u>" + notificacion.Solucion + "<br/>");
                //sbBody.AppendLine("Fecha Solución: " + notificacion.FechaSolucion + "<br/>");
                sbBody.AppendLine("<br/>");
                //sbBody.AppendLine("Si usted tiene alguna duda o consulta puede responder al presente correo y lo atenderemos lo mas pronto posible." + "<br/>");
                sbBody.AppendLine("<br/>");
                sbBody.AppendLine("Saludos Cordiales," + "<br/>");
                sbBody.AppendLine("<table><tr><td> <img src=cid:myImageID> </td>");
                sbBody.AppendLine("<td><table><tr><td>" + notificacion.NombreApellidoDocente + "</td></tr><tr><td>Docente</td></tr><tr><td>" + notificacion.NombreCurso + "</td></tr></table></td></tr></table>");
                sbBody.AppendLine("" + "<br/>");
                //sbBody.AppendLine("Universidad Peruana de Ciencias Aplicadas (UPC)" + "<br/>");

                EnviarCorreo(notificacion.Email, subject, sbBody.ToString(), null, string.Empty, string.Empty);
                resultado = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(resultado);
        }
Exemple #2
0
        public static string ObtenerPeriodoActual()
        {
            var resultado = string.Empty;

            var fecha = ConvertidorUtil.GmtToPacific(DateTime.Now);

            var mes = string.Empty;

            switch (fecha.Month)
            {
            case 1:
                mes = "Enero";
                break;

            case 2:
                mes = "Febrero";
                break;

            case 3:
                mes = "Marzo";
                break;

            case 4:
                mes = "Abril";
                break;

            case 5:
                mes = "Mayo";
                break;

            case 6:
                mes = "Junio";
                break;

            case 7:
                mes = "Julio";
                break;

            case 8:
                mes = "Agosto";
                break;

            case 9:
                mes = "Septiembre";
                break;

            case 10:
                mes = "Octubre";
                break;

            case 11:
                mes = "Noviembre";
                break;

            case 12:
                mes = "Diciembre";
                break;
            }
            ;

            resultado = string.Format("{0}-{1}", mes, fecha.Year);

            return(resultado);
        }