using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using Ultimus.Utilitarios; using Ultimus.Interfaces.UltimusForm; using Ultimus.Interfaces; using ULA.Cathay.GeneracionCorreos.Json; using ULA.Cathay.CreditoModel.BL.Credito; using ULA.Cathay.GeneracionCorreos.Commons; namespace ULA.Cathay.GeneracionCorreos { [WebService(Namespace = "http://ultimus.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Generacion : System.Web.Services.WebService { UltimusLogs log = new UltimusLogs("Generacion"); [WebMethod] public BaseJson EnviarNotificacion(ConfiguracionNotificacionReq req) { BaseJson Respuesta = new BaseJson(); try { ConfiguracionNotificacionResp resp = new NotificacionBL().ObtenerNotificacion(req); EmailManager em = new EmailManager(); em.Send2(new Email() { Attach = resp.EmailToSend.Attach, Body = resp.EmailToSend.Body, IsBodyHtml = resp.EmailToSend.IsBodyHtml, MailTo = resp.EmailToSend.MailTo, Subject = resp.EmailToSend.Subject, }, resp.EmailToSend.AttachFile); Respuesta.CodigoRespuesta = TipoCodigoRespuesta.EXITOSO.ToString(); } catch (Exception ex) { Respuesta.CodigoRespuesta = TipoCodigoRespuesta.EXITOSO.ToString(); Respuesta.DescripcionRespuesta = ex.Message; log.Error(ex); } return Respuesta; } } }