From 6566fb1d094ce1978512b4bd96ff873fcb0f1eff Mon Sep 17 00:00:00 2001 From: jmoya Date: Fri, 10 Aug 2018 15:31:33 +0000 Subject: [PATCH] Mis solicitudes compra autorizadas git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C421 --- AYA.SlnSynor/AYA.SlnSinort.sln | 2 +- AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs | 4 + AYA.SlnSynor/AYA.SlnSynor.WCF/Sinort.svc.cs | 17 ++ .../AYA.SlnSynor/AYA.SlnSinort.csproj | 2 + ...ormativaReglamentacionTecnicaController.cs | 6 + .../AYA.SlnSynor/Scripts/_references.js | Bin 579752 -> 579768 bytes .../MisSolicitudesCompra.js | 111 +++++++++++ .../Solicitud.js | 3 +- .../Sinort-Scripts/TareasPendientes.js | 6 +- .../MisSolicitudesCompra.cshtml | 173 ++++++++++++++++++ .../AYA.SlnSynor/Views/Shared/_Layout.cshtml | 1 + .../Sinort/SolicitudDAL.cs | 31 +++- .../AYA.SlnSynorModel/Entidades/Json.cs | 2 + 13 files changed, 353 insertions(+), 5 deletions(-) create mode 100644 AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/MisSolicitudesCompra.js create mode 100644 AYA.SlnSynor/AYA.SlnSynor/Views/NormativaReglamentacionTecnica/MisSolicitudesCompra.cshtml diff --git a/AYA.SlnSynor/AYA.SlnSinort.sln b/AYA.SlnSynor/AYA.SlnSinort.sln index a347f2694..d64331f10 100644 --- a/AYA.SlnSynor/AYA.SlnSinort.sln +++ b/AYA.SlnSynor/AYA.SlnSinort.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AYA.SlnSinort", "AYA.SlnSynor\AYA.SlnSinort.csproj", "{D672EAD6-E8C6-4374-B149-DED461546905}" EndProject diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs index 3c7bc99b5..d6ddf5307 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/ISinort.cs @@ -134,6 +134,10 @@ namespace AYA.SlnSinort.WCF [OperationContract] SolicitudJSON ObtenerSolicitudUsuario(SolicitudJSON model); + + [OperationContract] + SolicitudJSON ObtenerSolicitudCompraAutorizadas(SolicitudJSON model); + [OperationContract] SolicitudJSON ObtenerPorTipo(SolicitudJSON model); diff --git a/AYA.SlnSynor/AYA.SlnSynor.WCF/Sinort.svc.cs b/AYA.SlnSynor/AYA.SlnSynor.WCF/Sinort.svc.cs index 4aec27787..9bb94212d 100644 --- a/AYA.SlnSynor/AYA.SlnSynor.WCF/Sinort.svc.cs +++ b/AYA.SlnSynor/AYA.SlnSynor.WCF/Sinort.svc.cs @@ -1139,6 +1139,23 @@ namespace AYA.SlnSinort.WCF return registros; } + public SolicitudJSON ObtenerSolicitudCompraAutorizadas(SolicitudJSON model) + { + + SolicitudJSON registros = new SolicitudJSON(); + try + { + registros = new SolicitudDAL().ObtenerSolicitudCompraAutorizadas(model); + } + catch (Exception ex) + { + registros.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR; + log.Error(ex); + } + return registros; + } + + public SolicitudJSON ObtenerPorTipo(SolicitudJSON model) { diff --git a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj index dbe6fc5ad..62cacf8c2 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj +++ b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj @@ -7448,6 +7448,7 @@ + @@ -7576,6 +7577,7 @@ + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Controllers/NormativaReglamentacionTecnicaController.cs b/AYA.SlnSynor/AYA.SlnSynor/Controllers/NormativaReglamentacionTecnicaController.cs index 02492529c..6aca05d5c 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Controllers/NormativaReglamentacionTecnicaController.cs +++ b/AYA.SlnSynor/AYA.SlnSynor/Controllers/NormativaReglamentacionTecnicaController.cs @@ -44,6 +44,12 @@ namespace AYA.SlnSinort.Controllers.NormativaReglamentacionTecnica return View(); } + public ActionResult MisSolicitudesCompra() + { + InitControllers(); + return View(); + } + public ActionResult VerSolicitudesCompra() { InitControllers(); diff --git a/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js b/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js index e7520c7bf374bb0e600777f7dc3d2dc166f6716c..e7797fc684b9f05f632d75f3a3e6baeaca210f4b 100644 GIT binary patch delta 63 zcmV-F0KosKu_L&#BY=bfgaU*Egam{Iga(8Mv + +

  Mis Solicitudes de Compra Autorizadas

+
+
+
+
+ + + + + + + + + + + + + +
+ +
+ +
+
+ +
+ + + + + +@section Modals{ + + + @*---------------------Ver Solicitud---------------------------------------------------------*@ + +} + +@section scripts{ + + @Scripts.Render("~/Sinort-Scripts/NormativaReglamentacionTecnica/MisSolicitudesCompra.js") + +} + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml index b8eb2dfe3..1b44873d2 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml @@ -160,6 +160,7 @@
  • Compra de documento técnica
  • Modificación de documento
    técnico
  • Ver mis solicitudes
  • +
  • Ver mis solicitudes
    de compra autorizadas
  • Sitios
  • Crear encuesta
  • diff --git a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/SolicitudDAL.cs b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/SolicitudDAL.cs index e82ccc851..3d8f6debf 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/SolicitudDAL.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel.DAL/Sinort/SolicitudDAL.cs @@ -55,7 +55,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort { registros.Solicitudes = db.Solicitud - .Where(x => x.Estado == true || x.UsuarioSistema.ToString() == model.UsuarioSistema || + .Where(x => x.Estado == true && x.UsuarioSistema.ToString() == model.UsuarioSistema || x.IdTipoSolicitud == model.IdTipoSolicitud).AsNoTracking() .OrderBy(x => x.IdTipoSolicitud) .ToList(); @@ -73,6 +73,35 @@ namespace AYA.SlnSinortModel.DAL.Sinort return registros; } + public SolicitudJSON ObtenerSolicitudCompraAutorizadas(SolicitudJSON model) + { + + SolicitudJSON registros = new SolicitudJSON(); + + try + { + using (SinortContex db = new SinortContex()) + { + + registros.Solicitudes = db.Solicitud + .Where(x => x.Estado == true && x.UsuarioSistema.ToString() == model.UsuarioSistema && + x.IdEstadoSolicitud == model.IdEstadoSolicitud).AsNoTracking() + .OrderBy(x => x.IdTipoSolicitud) + .ToList(); + + + registros.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO; + } + } + catch (Exception ex) + { + registros.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR; + log.Error(ex); + } + + return registros; + } + public SolicitudJSON ObtenerPorTipo(SolicitudJSON model) { diff --git a/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs b/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs index 3a037b6c5..b3d5f1d18 100644 --- a/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs +++ b/AYA.SlnSynor/AYA.SlnSynorModel/Entidades/Json.cs @@ -96,6 +96,8 @@ namespace AYA.SlnSinortModel.Entidades public string UsuarioSistema { get; set; } public string Mensaje { get; set; } + + public int? IdEstadoSolicitud { get; set; } } public class EncuestaJSON : BaseJson