Gotitas normativas
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C316
This commit is contained in:
parent
b01cf77a94
commit
99025af4e6
13 changed files with 587 additions and 6 deletions
|
|
@ -80,6 +80,16 @@ namespace AYA.SlnSinort.WCF
|
|||
NotificacionesJSON ObtenerCantidadTareasPendientes(NotificacionesJSON model);
|
||||
#endregion
|
||||
|
||||
#region Gotitas Normativas
|
||||
[OperationContract]
|
||||
List<GotitasNormativas> ObtenerGotitasPendientes(CatalogosPostJSON model);
|
||||
|
||||
[OperationContract]
|
||||
BaseJson InsertarGotitasNormativas(GotitasNormativas model);
|
||||
|
||||
[OperationContract]
|
||||
NotificacionesJSON ObtenerCantidadGotitasPendientes(NotificacionesJSON model);
|
||||
#endregion
|
||||
#region Login
|
||||
|
||||
[OperationContract]
|
||||
|
|
|
|||
|
|
@ -572,6 +572,55 @@ namespace AYA.SlnSinort.WCF
|
|||
|
||||
#endregion
|
||||
|
||||
#region Gotitas Normativas
|
||||
public List<GotitasNormativas> ObtenerGotitasPendientes(CatalogosPostJSON model)
|
||||
{
|
||||
List<GotitasNormativas> respuesta = null;
|
||||
try
|
||||
{
|
||||
respuesta = new GotitasNormativasDAL().ObtenerGotitasPendientes(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
return respuesta;
|
||||
}
|
||||
|
||||
public BaseJson InsertarGotitasNormativas(GotitasNormativas model)
|
||||
{
|
||||
BaseJson respuesta = new BaseJson();
|
||||
try
|
||||
{
|
||||
respuesta = new GotitasNormativasDAL().InsertarGotitasNormativas(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
log.Error(ex);
|
||||
}
|
||||
return respuesta;
|
||||
}
|
||||
|
||||
|
||||
public NotificacionesJSON ObtenerCantidadGotitasPendientes(NotificacionesJSON model)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
model = new GotitasNormativasDAL().ObtenerCantidadGotitasPendientes(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Login
|
||||
|
||||
public LoginJSON ObtenerUsuarioAD(LoginJSON model)
|
||||
|
|
|
|||
|
|
@ -7335,6 +7335,8 @@
|
|||
<Content Include="Sinort-Scripts\Contenido.js" />
|
||||
<Content Include="Sinort-Scripts\DocumentoTecnico.js" />
|
||||
<Content Include="Sinort-Scripts\EmisorPN.js" />
|
||||
<Content Include="Sinort-Scripts\GotitasNormativas.js" />
|
||||
<Content Include="Sinort-Scripts\GotitasPendientes.js" />
|
||||
<Content Include="Sinort-Scripts\NormativaReglamentacionTecnica.js" />
|
||||
<Content Include="Sinort-Scripts\NormativaReglamentacionTecnica\BusquedaFichaTecnica.js" />
|
||||
<Content Include="Sinort-Scripts\NormativaReglamentacionTecnica\FichaTecnica.js" />
|
||||
|
|
@ -7436,6 +7438,8 @@
|
|||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<Content Include="Views\NormativaReglamentacionTecnica\BusquedaFichaTecnica.cshtml" />
|
||||
<Content Include="Views\Home\GotitasPendientes.cshtml" />
|
||||
<Content Include="Views\Home\GotitasNormativas.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
|
|
|||
|
|
@ -32,7 +32,17 @@ namespace AYA.SlnSinort.Controllers
|
|||
InitControllers();
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ActionResult GotitasPendientes()
|
||||
{
|
||||
InitControllers();
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult GotitasNormativas()
|
||||
{
|
||||
InitControllers();
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1687,6 +1687,18 @@ this.ObtenerCantidadTareasPendientes = function () {
|
|||
AjaxPostData(uri, model, true, null, DibujarTareasPendientes, null, true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.ObtenerCantidadGotitasPendientes = function () {
|
||||
|
||||
var uri = SinortWCF + '/api/ObtenerCantidadGotitasPendientes';
|
||||
|
||||
var model = {
|
||||
codigo: UsuarioSistema
|
||||
}
|
||||
AjaxPostData(uri, model, true, null, DibujarGotitasPendientes, null, true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.DibujarTareasPendientes = function (data) {
|
||||
|
|
@ -1704,6 +1716,21 @@ this.DibujarTareasPendientes = function (data) {
|
|||
ENDREQUEST();
|
||||
}
|
||||
|
||||
this.DibujarGotitasPendientes = function (data) {
|
||||
var gotitas;
|
||||
gotitas = $("#ucGotitasPendientes").html();
|
||||
gotitas = replaceAll('[$0]', data.GotitasNormativas, gotitas);
|
||||
$('#numGotitasPendientes').empty();
|
||||
$('#numGotitasPendientes').append(gotitas);
|
||||
|
||||
gotitas = $("#ucGotitasPendientesHeader").html();
|
||||
gotitas = replaceAll('[$0]', data.GotitasNormativas, gotitas);
|
||||
$('#numGotitasPendientesHeader').empty();
|
||||
$('#numGotitasPendientesHeader').append("Tienes " + gotitas + " gotita(s) pendiente(s)");
|
||||
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
this.ValidarPermisos = function (opcion) {
|
||||
var validar;
|
||||
validar = $.grep(localStorage['ListaOpciones'].split(","), function (data) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
|
||||
var model = {};
|
||||
var InfoIdGotitaNormativa;
|
||||
var InfoINombre;
|
||||
var InfoIDescripcion;
|
||||
var InfoIFechaCaducidad;
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
$('#tableGotitasPendientes').TableInit(0, false, true, true, false, null, null);
|
||||
$('#tableGotitasPendientes').DataTable().column(0).visible(false);
|
||||
$('#tableGotitasPendientes').DataTable().column(3).visible(false);
|
||||
getDataModel();
|
||||
|
||||
});
|
||||
this.getDataModel = function () {
|
||||
CargarGotitasPendientes();
|
||||
$("#btnAgregarNuevaGotita").unbind("click");
|
||||
$("#btnAgregarNuevaGotita").click(function () {
|
||||
RedireccionarGotita();
|
||||
});
|
||||
}
|
||||
|
||||
this.CargarGotitasPendientes = function () {
|
||||
|
||||
var uri = SinortWCF + '/api/ObtenerGotitasPendientes';
|
||||
|
||||
var model = {
|
||||
codigo: 'josnunez'
|
||||
}
|
||||
|
||||
|
||||
AjaxPostData(uri, model, true, false, CargarTablaGotitasPendientes, null, null);
|
||||
}
|
||||
|
||||
this.CargarTablaGotitasPendientes = function (data) {
|
||||
|
||||
var tableGotitasPendientes = $('#tableGotitasPendientes').DataTable();
|
||||
tableGotitasPendientes.clear().draw();
|
||||
var lista = data;
|
||||
|
||||
$.each(lista, function (key, item) {
|
||||
|
||||
|
||||
var option2 = $("#ucbtnVer").html();
|
||||
|
||||
tableGotitasPendientes.row.add([item.IdGotitaNormativa,
|
||||
item.Nombre,
|
||||
DateFormatNoTime(item.FechaCaducidad),
|
||||
item.Descripcion,
|
||||
option2]).draw();
|
||||
|
||||
});
|
||||
|
||||
ENDREQUEST();
|
||||
|
||||
}
|
||||
this.RedireccionarGotita = function ()
|
||||
{
|
||||
url = $("#hiddenHref").val();
|
||||
url = url.replace("View", "GotitasNormativas");
|
||||
url = url.replace("Controller", "Home");
|
||||
document.location.href = url;
|
||||
}
|
||||
$('#tableGotitasPendientes').on('click', 'button', function () {
|
||||
|
||||
var data = $('#tableGotitasPendientes').DataTable().row($(this).parents('tr')).data();
|
||||
|
||||
InfoIdGotitaNormativa = data[0];
|
||||
InfoINombre = data[1];
|
||||
InfoIDescripcion = data[3];
|
||||
InfoIFechaCaducidad = data[2];
|
||||
|
||||
if (this.id == 'btnver') {
|
||||
|
||||
var gotitas = $("#ucGotita").html();
|
||||
gotitas = replaceAll('[$Gotita]', InfoINombre, gotitas);
|
||||
$('#gotitaVer').empty();
|
||||
$('#gotitaVer').append(gotitas);
|
||||
|
||||
$('#modalVer').modal('show');
|
||||
|
||||
$('#txtTitulo').val(InfoINombre);
|
||||
$('#txtAreaDescripcion').val(InfoIDescripcion);
|
||||
$('#txtFechaCaducidad').val(InfoIFechaCaducidad);
|
||||
}
|
||||
|
||||
});
|
||||
158
AYA.SlnSynor/AYA.SlnSynor/Views/Home/GotitasNormativas.cshtml
Normal file
158
AYA.SlnSynor/AYA.SlnSynor/Views/Home/GotitasNormativas.cshtml
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
|
||||
@{
|
||||
ViewBag.Title = "Gotitas Normativas";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
|
||||
<form id="formFichaTecnica" class="form-horizontal" role="form">
|
||||
<div class="panel-body"> <h3> <i class="glyphicon glyphicon-tint"></i> Gotita Normativa</h3> </div>
|
||||
<div style="background-color: #fff">
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
|
||||
@*---------------------Titulo---------------------------------------------------------*@
|
||||
<div class="form-group " id="divNombre">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblNombre">Título</label>
|
||||
<div class="input-group input-group-sm col-lg-4 col-md-6 col-sm-6 col-xs-6">
|
||||
<input name="txtNombre" class="form-control imput-xs" id="txtNombre" type="text" required/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*---------------------Cuerpo---------------------------------------------------------*@
|
||||
<div class="form-group " id="divDescripcion">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblDescripcion">Cuerpo</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<textarea name="txtDescripcion" rows="8" cols="61" id="txtDescripcion" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*---------------------Fecha caducidad---------------------------------------------*@
|
||||
<div class="form-group" id="divFechaCaducidad">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblFechaCaducidad">Caduca</label>
|
||||
|
||||
<div class="input-group input-group-sm col-lg-4 col-md-6 col-sm-6 col-xs-6">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar" id="iconFechaCaducidad"></i></span>
|
||||
<input name="txtFechaCaducidad" class="form-control imput-xs" id="txtFechaCaducidad" type="text" readonly="readonly" dateformat="DD-MMMM-YYYY">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*---------------------Documento Adjunto---------------------------------------------------------*@
|
||||
<div class="form-group " id="divNombreDocumento">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblNombreDocumento">Documento adjunto</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<button type="button" id="btnVerAdjuntos" class="btn btn-success btn-medium btn-margin-catalogo" onclick="javascript: AbrirAdjuntos()">
|
||||
<i class=" fa fa-paperclip"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="btnGuardar" class="btn btn-success btn-medium" data-dismiss="modal">
|
||||
<i class="fa fa-floppy-o"></i> Guardar
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div id="ucBtnSeleccionarCatalogo" style="display:none;">
|
||||
<button type="button" id="btnSeleccionarCatalogo" class="btn btn-default btn-xs">
|
||||
<i id="ibtnSeleccionarCatalogo" class="fa fa-check"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="ucAbrirDocumento" style="display:none;">
|
||||
<span>
|
||||
<button type="button" id="btnAbrirAdjuntos" class="btn btn-default btn-xs">
|
||||
<i class="fa [$icon]"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@section Modals{
|
||||
|
||||
@*---------------------Adjuntar documentos ---------------------------------------------------------*@
|
||||
<div class="modal fade" id="modalDocumentosAuxiliares" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;z-index:1600;">
|
||||
<div class="modal-dialog modal-lg" style="width:40%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Documentos</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
@*---------------------Descripción ---------------------------------------------------------*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblDescDocAux">Descripción</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input type="text" id="txtDescripcionDocAux" name="txtDescripcionDocAux" class="form-control imput-xs" required="required" />
|
||||
</div>
|
||||
</div>
|
||||
@*---------------------Comentario ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divComentarioDocAux">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblComentarioDocAux">Comentario</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtComentarioDocAux" rows="5" cols="39" id="txtComentarioDocAux" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@*---------------------Adjuntar ---------------------------------------------------------*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ControlsForms">Adjuntar Documento</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<span class="btn btn-success fileinput-button" title="Adjuntar Documento">
|
||||
<i class="fa fa-paperclip"></i>
|
||||
<input type="file" id="fileupload" name="file" />
|
||||
</span>
|
||||
|
||||
<button type="button" id="btnEliminarAdjuntos" class="btn btn-danger btn-medium btn-margin-catalogo" onclick="javascript: EliminarAdjunto()">
|
||||
<i class=" fa fa-close"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="col-sm-12">
|
||||
<div id="progress" class="progress">
|
||||
<div class="progress-bar progress-bar-success"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@*---------------------Documento ---------------------------------------------------------*@
|
||||
<table id="tableDocFichaTecnica" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="col-sm-1"></th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
<th class="col-sm-4">Creado por</th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
@Scripts.Render("~/Sinort-Scripts/GotitasNormativas.js")
|
||||
|
||||
105
AYA.SlnSynor/AYA.SlnSynor/Views/Home/GotitasPendientes.cshtml
Normal file
105
AYA.SlnSynor/AYA.SlnSynor/Views/Home/GotitasPendientes.cshtml
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
|
||||
@{
|
||||
ViewBag.Title = "Gotitas Pendientes";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
<input type="hidden" id="hiddenHref" value="@string.Concat(Url.Action("View", "Controller", null), ViewBag.QueryEncripted)">
|
||||
<form id="formGotitasPendientes" class="form-horizontal" role="form">
|
||||
|
||||
<div class="panel-body"> <h3> <i class="fa fa-list-ul"></i> Mis gotitas pendientes </h3> </div>
|
||||
<div style="background-color:white">
|
||||
<div class="panel-body">
|
||||
<br />
|
||||
<div id="ucbtnAgregar">
|
||||
<button type="button" id="btnAgregarNuevaGotita" class="btn btn-success" data-dismiss="modal">
|
||||
<i class="fa fa-plus"></i> Agregar Gotita
|
||||
</button>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div>
|
||||
|
||||
<table id="tableGotitasPendientes" class="table table-condensed dataTable no-footer">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="col-sm-6">Título</th>
|
||||
<th class="col-sm-6">Fecha de vencimiento</th>
|
||||
<th></th>
|
||||
<th class="col-sm-5"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="ucbtnVer" style=" display:none;">
|
||||
|
||||
<button type="button" id="btnver" class="btn btn-default btn-xs">
|
||||
<i class="fa fa-search"></i> Ver
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="ucGotita" style="display:none;">
|
||||
<span>
|
||||
[$Gotita]
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@section Modals{
|
||||
|
||||
@*---------------------Ver Gotita---------------------------------------------------------*@
|
||||
<div class="modal fade" id="modalVer" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;z-index:1600;">
|
||||
<div class="modal-dialog modal-lg" style="width:35%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="gotitaVer">[$Gotita]</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
@*---------------------Titulo---------------------------------------------------------*@
|
||||
<div class="form-group " id="divTitulo">
|
||||
<label class="col-sm-2 control-label ControlsForms" id="lblTitulo">Título</label>
|
||||
<div class="input-group col-lg-8 col-md-6 col-sm-6 col-xs-6">
|
||||
<input name="txtTitulo" class="form-control imput-xs" id="txtTitulo" readonly style="cursor: not-allowed;" />
|
||||
</div>
|
||||
</div>
|
||||
@*---------------------Descripcion---------------------------------------------------------*@
|
||||
<div class="form-group " id="divDescripcion">
|
||||
<label class="col-sm-2 control-label ControlsForms" id="lblDescripcion">Cuerpo</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<textarea name="txtAreaDescripcion" rows="6" cols="49" id="txtAreaDescripcion" style="resize: none; cursor: not-allowed;" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*---------------------Fecha Caducidad---------------------------------------------*@
|
||||
|
||||
<div class="form-group" id="divFechaCaducidad">
|
||||
<label class="col-sm-2 control-label ControlsForms" id="lblFechaCaducidad">Caduca</label>
|
||||
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-6 col-sm-6 col-xs-6">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar" id="iconFechaCaducidad"></i></span>
|
||||
<input name="txtFechaCaducidad" class="form-control imput-xs" id="txtFechaCaducidad" type="text" readonly="readonly" dateformat="DD-MMMM-YYYY">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@Scripts.Render("~/Sinort-Scripts/GotitasPendientes.js")
|
||||
|
|
@ -79,12 +79,12 @@
|
|||
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="glyphicon glyphicon-tint"></i>
|
||||
<span class="label label-success">0</span>
|
||||
<span class="label label-warning" id="numGotitasPendientes">[$0]</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header">Tienes 0 notificaciones </li>
|
||||
<li class="header" id="numGotitasPendientesHeader">[$0]</li>
|
||||
|
||||
<li class="footer"><a href="#">Ver todas las notificaciones </a></li>
|
||||
<li class="footer"><a href="@Url.Action("GotitasPendientes", "Home")">Ver gotitas normativas </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
|
@ -238,6 +238,18 @@
|
|||
<input type="hidden" id="hiddenRutaLogoSINORT" value="@ViewBag.RutaLogoSINORT" />
|
||||
<input type="hidden" id="hiddenRutaImagenes" value="@ViewBag.RutaImagenes" />
|
||||
|
||||
|
||||
<div id="ucGotitasPendientes" style="display:none;">
|
||||
<span>
|
||||
[$0]
|
||||
</span>
|
||||
</div>
|
||||
<div id="ucGotitasPendientesHeader" style="display:none;">
|
||||
<span>
|
||||
[$0]
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="ucTareasPendientes" style="display:none;">
|
||||
<span>
|
||||
[$0]
|
||||
|
|
@ -276,6 +288,7 @@
|
|||
$(document).ready(function () {
|
||||
ObtenerDatosUsuario();
|
||||
ObtenerCantidadTareasPendientes();
|
||||
ObtenerCantidadGotitasPendientes();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@
|
|||
<Compile Include="Sinort\FichaTecnicaDAL.cs" />
|
||||
<Compile Include="Sinort\FichaTecnicaPalabraClaveDAL.cs" />
|
||||
<Compile Include="Sinort\ForoDAL.cs" />
|
||||
<Compile Include="Sinort\GotitasNormativasDAL.cs" />
|
||||
<Compile Include="Sinort\GrupoTematicoDAL.cs" />
|
||||
<Compile Include="Sinort\MantenimientoDAL.cs" />
|
||||
<Compile Include="Sinort\MatrizDAL.cs" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,115 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AYA.SlnSinortModel;
|
||||
using AYA.SlnSinortModel.Entidades;
|
||||
using AYA.SlnSinortModel.Sinort;
|
||||
using System.Data.Entity.Validation;
|
||||
using Atesa.Utilitarios;
|
||||
using AYA.SlnSinortModel.Constantes;
|
||||
|
||||
namespace AYA.SlnSinortModel.DAL.Sinort
|
||||
{
|
||||
public class GotitasNormativasDAL
|
||||
{
|
||||
Log log = new Log("GotitasNormativasDAL");
|
||||
|
||||
public List<GotitasNormativas> ObtenerGotitasPendientes(CatalogosPostJSON model)
|
||||
{
|
||||
List<GotitasNormativas> registros = null;
|
||||
string filtro = model != null ? model.filtro : null;
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
registros = db.GotitasNormativas.Where(r => r.FechaCaducidad >= System.DateTime.Now).OrderBy(r => r.IdGotitaNormativa).ToList();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
|
||||
return registros;
|
||||
}
|
||||
|
||||
|
||||
public BaseJson InsertarGotitasNormativas(GotitasNormativas model)
|
||||
{
|
||||
GotitasNormativas Actual = new GotitasNormativas();
|
||||
BaseJson Respuesta = new BaseJson();
|
||||
try
|
||||
{
|
||||
model.ClearProperties();
|
||||
|
||||
using (SinortContex Conn = new SinortContex())
|
||||
{
|
||||
Actual = Conn.GotitasNormativas.Where(x => x.IdGotitaNormativa == model.IdGotitaNormativa).FirstOrDefault();
|
||||
if (Actual == null)
|
||||
{
|
||||
int? Next_id = Conn.Emisor.Max(t => (int?)t.IdEmisor);
|
||||
model.IdGotitaNormativa = (Next_id == null) ? 1 : Next_id.Value + 1;
|
||||
model.FechaCreacion = DateTime.Now;
|
||||
Conn.GotitasNormativas.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.FechaModificacion = DateTime.Now;
|
||||
model.FechaCreacion = Actual.FechaCreacion;
|
||||
model.UsuarioCreacion = Actual.UsuarioCreacion;
|
||||
model.Descripcion = string.IsNullOrEmpty(model.Descripcion) ? Actual.Descripcion : model.Descripcion;
|
||||
Conn.Entry(Actual).State = System.Data.Entity.EntityState.Detached;
|
||||
Conn.GotitasNormativas.Attach(model);
|
||||
Conn.Entry(model).State = System.Data.Entity.EntityState.Modified;
|
||||
}
|
||||
Conn.SaveChanges();
|
||||
Conn.Commit();
|
||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO.ToString();
|
||||
}
|
||||
}
|
||||
catch (DbEntityValidationException ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Actual = null;
|
||||
}
|
||||
return Respuesta;
|
||||
}
|
||||
|
||||
|
||||
public NotificacionesJSON ObtenerCantidadGotitasPendientes(NotificacionesJSON model)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
model.GotitasNormativas = db.GotitasNormativas.Where(r => r.FechaCaducidad >= System.DateTime.Now).OrderBy(r => r.IdGotitaNormativa).Count();
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ namespace AYA.SlnSinortModel.Entidades
|
|||
public class NotificacionesJSON : BaseJson
|
||||
{
|
||||
public int TareasPendientes { get; set; }
|
||||
public int GotitasInformativas { get; set; }
|
||||
public int GotitasNormativas { get; set; }
|
||||
public string codigo { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue