From 21bf9a1cfcc7a00793c79a3fa1badfb3e7250a8a Mon Sep 17 00:00:00 2001 From: jmoya Date: Tue, 24 Jul 2018 21:16:09 +0000 Subject: [PATCH] Solicitudes documentos adjuntos git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C328 --- .../AYA.SlnSynor.WCF/ISinortCatalogos.cs | 3 ++ .../AYA.SlnSynor.WCF/SinortCatalogos.svc.cs | 19 +++++++++++ .../MisSolicitudes.js | 1 + .../Solicitud.js | 8 +++++ .../VerSolicitudes.js | 1 + .../Sinort-Scripts/TareasPendientes.js | 1 + .../Views/Home/TareasPendientes.cshtml | 8 +++++ .../MisSolicitudes.cshtml | 8 +++++ .../Solicitud.cshtml | 4 +-- .../VerSolicitudes.cshtml | 8 +++++ .../AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs | 33 +++++++++++++++++++ 11 files changed, 92 insertions(+), 2 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs index 9deda7618..21a3afe08 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinortCatalogos.cs @@ -51,6 +51,9 @@ namespace AYA.SlnSinort.WCF [OperationContract] List ObtenerRol(); + //[OperationContract] + //List ObtenerUsuarioExperto(); + [OperationContract] BaseJson InsertarActualizarRol(Roles model); #endregion diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs index b9323c273..5349ea752 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/SinortCatalogos.svc.cs @@ -156,6 +156,25 @@ namespace AYA.SlnSinort.WCF return respuesta; } + //public List ObtenerUsuarioExperto(CatalogosPostJSON model) + //{ + + // List respuesta = null; + // CatalogosPostJSON CatalogosPostJSON = new CatalogosPostJSON(); + // CatalogosPostJSON.filtro = model.filtro; + // CatalogosPostJSON.IdTipo = model.IdTipo; + // try + // { + // respuesta = new RolesDAL().ObtenerUsuarioExperto(CatalogosPostJSON); + + // } + // catch (Exception ex) + // { + // log.Error(ex); + // } + // return respuesta; + //} + public BaseJson InsertarActualizarRol(Roles model) { BaseJson respuesta = new BaseJson(); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/MisSolicitudes.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/MisSolicitudes.js index d57c6bfd1..db63d524b 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/MisSolicitudes.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/MisSolicitudes.js @@ -101,6 +101,7 @@ this.CargarFormulario = function (data) { var model = data; + $("#txtDocumentoAdjunto").val(model.Solicitud.DescripcionDocumento); $("#txtUsuarioSistema").val(model.Solicitud.UsuarioSistema); $("#txtCargoActual").val(model.Solicitud.CargoActual); $("#txtNombreAreaFuncional").val(model.Solicitud.NombreAreaFuncional); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/Solicitud.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/Solicitud.js index a567a067e..3a2f5aa55 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/Solicitud.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/Solicitud.js @@ -4,6 +4,7 @@ var IdTipoSolicitud; var DescTipoSolicitud; var IdSolicitud; var DescTipoproyecto; +var modelDocumentoAdjunto; jQuery(document).ready(function () { @@ -268,6 +269,11 @@ this.GuardarSolicitud = function () { return false; } + if (IsNullOrEmpty(modelDocumentoAdjunto)) { + toastr.warning("Antes de continuar; debe de ingresar un Documento Técnico."); + return false; + } + if (!confirm("Va a ingresar una nueva solicitud de "+ DescTipoSolicitud +".\n ¿Desea continuar?")) { return; } @@ -336,6 +342,8 @@ this.LeerFormulario = function () { var Solicitud = { IdTipoSolicitud: IdTipoSolicitud, + IdDocumento: IsNullOrEmpty(modelDocumentoAdjunto) ? 0 : modelDocumentoAdjunto.Adjuntos.IdDocumentoAdjunto, + DescripcionDocumento: IsNullOrEmpty(modelDocumentoAdjunto) ? 0 : modelDocumentoAdjunto.Adjuntos.Nombre, DescripcionTipoSolicitud: DescTipoSolicitud, UsuarioSistema: $("#txtUsuarioSistema").val(), CargoActual: $("#txtCargoActual").val(), diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerSolicitudes.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerSolicitudes.js index 9263f33da..5579b6460 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerSolicitudes.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerSolicitudes.js @@ -130,6 +130,7 @@ this.CargarFormulario = function (data) { var model = data; + $("#txtDocumentoAdjunto").val(model.Solicitud.DescripcionDocumento); $("#txtUsuarioSistema").val(model.Solicitud.UsuarioSistema); $("#txtCargoActual").val(model.Solicitud.CargoActual); $("#txtNombreAreaFuncional").val(model.Solicitud.NombreAreaFuncional); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js index d0fa84861..d400ae20a 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js @@ -160,6 +160,7 @@ this.CargarFormulario = function (data) { var model = data; + $("#txtDocumentoAdjunto").val(model.Solicitud.DescripcionDocumento); $("#txtUsuarioSistema").val(model.Solicitud.UsuarioSistema); $("#txtCargoActual").val(model.Solicitud.CargoActual); $("#txtNombreAreaFuncional").val(model.Solicitud.NombreAreaFuncional); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Home/TareasPendientes.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Home/TareasPendientes.cshtml index 50daac7e0..5006206fa 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Home/TareasPendientes.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Home/TareasPendientes.cshtml @@ -173,6 +173,14 @@ + @*---------------------Documento adjunto---------------------------------------------------------*@ +
+ +
+ +
+
+ @*---------------------Usuario Sistema---------------------------------------------------------*@
diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/MisSolicitudes.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/MisSolicitudes.cshtml index dbba0c26f..09de8a607 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/MisSolicitudes.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/MisSolicitudes.cshtml @@ -74,6 +74,14 @@
+ @*---------------------Documento adjunto---------------------------------------------------------*@ +
+ +
+ +
+
+ @*---------------------Usuario Sistema---------------------------------------------------------*@
diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/Solicitud.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/Solicitud.cshtml index 599cfaf36..d9ff8c31a 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/Solicitud.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/Solicitud.cshtml @@ -104,8 +104,8 @@ @*---------------------Justifiacion Solicitud---------------------------------------------------------*@
-
- +
+
diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/VerSolicitudes.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/VerSolicitudes.cshtml index d8354af27..bc4a07583 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/VerSolicitudes.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/VerSolicitudes.cshtml @@ -79,6 +79,14 @@
+ @*---------------------Documento adjunto---------------------------------------------------------*@ +
+ +
+ +
+
+ @*---------------------Usuario Sistema---------------------------------------------------------*@
diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs index 79c0a94a5..92a79d51c 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/RolesDAL.cs @@ -176,5 +176,38 @@ namespace AYA.SlnSinortModel.DAL.Sinort } #endregion + + #region Obtener usuarios funcional experto + + public List ObtenerUsuarioExperto(CatalogosPostJSON model) + { + List registros = null; + string filtro = model != null ? model.filtro : null; + + try + { + using (SinortContex db = new SinortContex()) + { + registros = db.Roles.Where(t => t.Estado == true && t.Descripcion == "Usuario funcional experto".ToString() && (string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower()))) + //.Include(y => y.Usuario) + .Select(t => new CatalogosJSON() + { + codigo = t.IdRol.ToString(), + descripcion = t.Descripcion, + + }) + .ToList(); + } + } + catch (Exception ex) + { + + log.Error(ex); + throw ex; + } + + return registros; + } + #endregion } }