git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C453
This commit is contained in:
parent
4588165cb6
commit
cf93170ce0
7 changed files with 148 additions and 25 deletions
|
|
@ -52,7 +52,7 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
FichaTecnicaJSON GuardarFichaTecnicaHistoricoPalabraClave(FichaTecnicaJSON model);
|
FichaTecnicaJSON GuardarFichaTecnicaHistoricoPalabraClave(FichaTecnicaJSON model);
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
FichaTecnicaJSON GuardarFichaTecnicaPalabraClave(FichaTecnicaJSON model);
|
FichaTecnicaJSON GuardarFichaTecnicaPalabraClave(FichaTecnicaJSON model);
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
FichaTecnicaJSON EliminarFichaTecnica(FichaTecnicaJSON model);
|
FichaTecnicaJSON EliminarFichaTecnica(FichaTecnicaJSON model);
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
FichaTecnicaJSON ObtenerFichaTecnicaHistorico(FichaTecnicaJSON model);
|
FichaTecnicaJSON ObtenerFichaTecnicaHistorico(FichaTecnicaJSON model);
|
||||||
|
|
||||||
|
|
@ -88,9 +88,9 @@ namespace AYA.SlnSinort.WCF
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
AdjuntosJSON RemoverAdjunto(AdjuntosJSON model);
|
AdjuntosJSON RemoverAdjunto(AdjuntosJSON model);
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
AdjuntosJSON CopiarAdjunto(AdjuntosJSON model);
|
AdjuntosJSON CopiarAdjunto(AdjuntosJSON model);
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
AdjuntosJSON EliminarbaseAdjunto(AdjuntosJSON model);
|
AdjuntosJSON EliminarbaseAdjunto(AdjuntosJSON model);
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Tareas Pendientes
|
#region Tareas Pendientes
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
List<TareasPendientes> ObtenerTareasPendientes(CatalogosPostJSON model);
|
List<TareasPendientes> ObtenerTareasPendientes(CatalogosPostJSON model);
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
NotificacionesJSON ObtenerCantidadTareasPendientes(NotificacionesJSON model);
|
NotificacionesJSON ObtenerCantidadTareasPendientes(NotificacionesJSON model);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Gotitas Normativas
|
#region Gotitas Normativas
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
|
|
@ -126,8 +126,8 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
NotificacionesJSON ObtenerCantidadGotitasPendientes(NotificacionesJSON model);
|
NotificacionesJSON ObtenerCantidadGotitasPendientes(NotificacionesJSON model);
|
||||||
#endregion
|
#endregion
|
||||||
#region Login
|
#region Login
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
LoginJSON ObtenerUsuarioAD(LoginJSON model);
|
LoginJSON ObtenerUsuarioAD(LoginJSON model);
|
||||||
|
|
@ -137,7 +137,7 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
List<Pantallas> ObtenerPermisos(CatalogosPostJSON model);
|
List<Pantallas> ObtenerPermisos(CatalogosPostJSON model);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Solicitud
|
#region Solicitud
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
|
|
@ -145,17 +145,17 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
SolicitudJSON ObtenerSolicitud(SolicitudJSON model);
|
SolicitudJSON ObtenerSolicitud(SolicitudJSON model);
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
SolicitudJSON ObtenerSolicitudUsuario(SolicitudJSON model);
|
SolicitudJSON ObtenerSolicitudUsuario(SolicitudJSON model);
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
SolicitudJSON ObtenerSolicitudCompraAutorizadas(SolicitudJSON model);
|
SolicitudJSON ObtenerSolicitudCompraAutorizadas(SolicitudJSON model);
|
||||||
|
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
SolicitudJSON ObtenerPorTipo(SolicitudJSON model);
|
SolicitudJSON ObtenerPorTipo(SolicitudJSON model);
|
||||||
|
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
SolicitudJSON EnviarCorreoSolicitud(SolicitudJSON model);
|
SolicitudJSON EnviarCorreoSolicitud(SolicitudJSON model);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -189,7 +189,7 @@ namespace AYA.SlnSinort.WCF
|
||||||
EncuestaJSON ObtenerUsuariosEncuestas(EncuestaJSON model);
|
EncuestaJSON ObtenerUsuariosEncuestas(EncuestaJSON model);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
[OperationContract]
|
||||||
|
UExternoJSON EnviarCorreoAExterno(UExternoJSON model);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -85,6 +85,8 @@ namespace AYA.SlnSinort.WCF
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
string VerificarUsuario(CatalogosPostJSON model);
|
string VerificarUsuario(CatalogosPostJSON model);
|
||||||
|
|
||||||
|
[OperationContract]
|
||||||
|
UsuarioExterno BuscarEmail(CatalogosPostJSON model);
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
BaseJson InsertarUsuarioExterno(UsuarioExterno model);
|
BaseJson InsertarUsuarioExterno(UsuarioExterno model);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
|
|
@ -927,6 +927,59 @@ namespace AYA.SlnSinort.WCF
|
||||||
model.CodigoRespuesta = (respuesta == 1) ? EnumTipoCodigoRespuesta.EXITOSO : EnumTipoCodigoRespuesta.ERROR; ;
|
model.CodigoRespuesta = (respuesta == 1) ? EnumTipoCodigoRespuesta.EXITOSO : EnumTipoCodigoRespuesta.ERROR; ;
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
public UExternoJSON EnviarCorreoAExterno(UExternoJSON model) {
|
||||||
|
|
||||||
|
PlantillaEmailDAL PlantillalDAL = new PlantillaEmailDAL();
|
||||||
|
PlantillaEmail plantilla = new PlantillaEmail();
|
||||||
|
List<PlantillaEmail> Listaplantillas = new List<PlantillaEmail>();
|
||||||
|
|
||||||
|
int respuesta = 0;
|
||||||
|
|
||||||
|
string email;
|
||||||
|
string body;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
//Obtener parametros
|
||||||
|
|
||||||
|
ServiciosUsuariosWCF.ServicioUsuariosClient respuestaAyA = new ServiciosUsuariosWCF.ServicioUsuariosClient();
|
||||||
|
ServiciosUsuariosWCF.correoEL correo = new ServiciosUsuariosWCF.correoEL();
|
||||||
|
Listaplantillas = PlantillalDAL.ObtenerPlantillasEmail();
|
||||||
|
|
||||||
|
|
||||||
|
switch (model.PlantillaEmail.NombrePlatilla)
|
||||||
|
{
|
||||||
|
case "Correo Registro Externo":
|
||||||
|
plantilla = Listaplantillas.Where(p => p.NombrePlatilla == model.PlantillaEmail.NombrePlatilla).FirstOrDefault();
|
||||||
|
correo = new ServiciosUsuariosWCF.correoEL();
|
||||||
|
correo.FORMATO = "html";
|
||||||
|
correo.ASUNTO = plantilla.Subject;
|
||||||
|
|
||||||
|
|
||||||
|
body = plantilla.Body.Replace("$Nombre", model.UsuarioExterno.Nombre).Replace("$Apellido", model.UsuarioExterno.Apellido1)
|
||||||
|
.Replace("$Usuario", model.UsuarioExterno.Usuario).Replace("$Password", model.UsuarioExterno.Password).Replace("|", "</br>");
|
||||||
|
correo.CUERPO = body;
|
||||||
|
email = model.UsuarioExterno.Email;
|
||||||
|
correo.DESTINATARIOS = email;
|
||||||
|
|
||||||
|
respuesta = respuestaAyA.enviarCorreo(correo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
model.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
model.CodigoRespuesta = (respuesta == 1) ? EnumTipoCodigoRespuesta.EXITOSO : EnumTipoCodigoRespuesta.ERROR; ;
|
||||||
|
return model;
|
||||||
|
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Adjuntos
|
#region Adjuntos
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,19 @@ namespace AYA.SlnSinort.WCF
|
||||||
}
|
}
|
||||||
return model.codigo;
|
return model.codigo;
|
||||||
}
|
}
|
||||||
|
public UsuarioExterno BuscarEmail(CatalogosPostJSON model) {
|
||||||
|
UsuarioExterno respuesta = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
respuesta = new UsuarioExternoDAL().BuscarEmail(model);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error(ex);
|
||||||
|
}
|
||||||
|
return respuesta;
|
||||||
|
}
|
||||||
public BaseJson InsertarUsuarioExterno(UsuarioExterno model)
|
public BaseJson InsertarUsuarioExterno(UsuarioExterno model)
|
||||||
{
|
{
|
||||||
BaseJson respuesta = new BaseJson();
|
BaseJson respuesta = new BaseJson();
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,6 @@ this.BuscarUsuario = function (model) {
|
||||||
this.NombreUsuario = function (data) {
|
this.NombreUsuario = function (data) {
|
||||||
usuario = data;
|
usuario = data;
|
||||||
LeerFormulario();
|
LeerFormulario();
|
||||||
RegistrarUsuario();
|
|
||||||
}
|
}
|
||||||
this.LeerFormulario = function () {
|
this.LeerFormulario = function () {
|
||||||
|
|
||||||
|
|
@ -136,16 +135,46 @@ this.LeerFormulario = function () {
|
||||||
Apellido2: $('#txtApellido2').val(),
|
Apellido2: $('#txtApellido2').val(),
|
||||||
Email: $('#txtEmail').val()
|
Email: $('#txtEmail').val()
|
||||||
}
|
}
|
||||||
|
model = {
|
||||||
|
codigo: UsuarioExterno.Email
|
||||||
|
}
|
||||||
|
|
||||||
|
var uri = SinorSignupWCF + '/api/BuscarEmail';
|
||||||
|
AjaxPostData(uri, model, false, false, RegistrarUsuario, null, null);
|
||||||
}
|
}
|
||||||
this.RegistrarUsuario = function () {
|
this.RegistrarUsuario = function (data) {
|
||||||
|
|
||||||
var uri = SinorSignupWCF + '/api/InsertarUsuarioExterno';
|
if (data == null) {
|
||||||
AjaxPostData(uri, UsuarioExterno, true, false, null, null, null);
|
var uri = SinorSignupWCF + '/api/InsertarUsuarioExterno';
|
||||||
|
AjaxPostData(uri, UsuarioExterno, false, false, null, null, null);
|
||||||
|
|
||||||
url = $("#hiddenHref").val();
|
|
||||||
url = url.replace("View", "LoginExterno");
|
|
||||||
url = url.replace("Controller", "Login");
|
|
||||||
|
|
||||||
document.location.href = url;
|
EnviarCorreo();
|
||||||
|
|
||||||
|
url = $("#hiddenHref").val();
|
||||||
|
url = url.replace("View", "LoginExterno");
|
||||||
|
url = url.replace("Controller", "Login");
|
||||||
|
|
||||||
|
document.location.href = url;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
toastr.error('El email digitado ya se encuentra registrado', Message_Warning);
|
||||||
|
ENDREQUEST();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
this.EnviarCorreo = function()
|
||||||
|
{
|
||||||
|
var Plantilla
|
||||||
|
= {
|
||||||
|
NombrePlatilla: 'Correo Registro Externo',
|
||||||
|
}
|
||||||
|
|
||||||
|
correo = { }
|
||||||
|
correo.PlantillaEmail = Plantilla;
|
||||||
|
correo.UsuarioExterno = UsuarioExterno;
|
||||||
|
var uri = SinorLoginWCF + '/api/EnviarCorreoAExterno';
|
||||||
|
AjaxPostData(uri, correo, false, false, null, null, null);
|
||||||
|
|
||||||
|
ENDREQUEST();
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +46,30 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
public UsuarioExterno BuscarEmail(CatalogosPostJSON model)
|
||||||
|
{
|
||||||
|
UsuarioExterno usuario = new UsuarioExterno();
|
||||||
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SinortContex db = new SinortContex())
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
usuario = db.UsuarioExterno.Where(r => r.Email.ToString() == model.codigo).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error(ex);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return usuario;
|
||||||
|
}
|
||||||
public BaseJson InsertarUsuarioExterno(UsuarioExterno model)
|
public BaseJson InsertarUsuarioExterno(UsuarioExterno model)
|
||||||
{
|
{
|
||||||
BaseJson Respuesta = new BaseJson();
|
BaseJson Respuesta = new BaseJson();
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,9 @@ namespace AYA.SlnSinortModel.Entidades
|
||||||
public bool Estado { get; set; }
|
public bool Estado { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public class UExternoJSON : BaseJson {
|
||||||
|
public UsuarioExterno UsuarioExterno { get; set; }
|
||||||
|
public PlantillaEmail PlantillaEmail { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue