git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C185
This commit is contained in:
parent
b2f2712fef
commit
83a878a2a0
5 changed files with 27 additions and 28 deletions
|
|
@ -32,7 +32,9 @@ namespace AYA.SlnSinort.Controllers
|
|||
ViewBag.RepositorioLocal = RepositorioLocal;
|
||||
ViewBag.UsuarioSistema = Usuario;
|
||||
ViewBag.NombreUsuario = FullName;
|
||||
ViewBag.ListaOpciones = (List<string>)Session["PermisosUsuario"];
|
||||
var Permisos = (List<string>)Session["PermisosUsuario"];
|
||||
ViewBag.ListaOpciones = Permisos;
|
||||
ViewBag.Number = 10;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1663,7 +1663,7 @@ this.ObtenerDatosUsuario = function () {
|
|||
$('#nombreusuario').append(usuario);
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.ObtenerCantidadTareasPendientes = function () {
|
||||
|
||||
var uri = SinortWCF + '/api/ObtenerCantidadTareasPendientes';
|
||||
|
|
@ -1691,7 +1691,15 @@ this.DibujarTareasPendientes = function (data) {
|
|||
ENDREQUEST();
|
||||
}
|
||||
|
||||
this.ObtenerPantallas = function () {
|
||||
this.ValidarPermisos = function (opcion) {
|
||||
|
||||
var validar = $.grep(localStorage['ListaOpciones'].split(","), function (data) {
|
||||
return data == opcion;
|
||||
});
|
||||
|
||||
return validar;
|
||||
}
|
||||
ObtenerPantallas = function () {
|
||||
|
||||
if ($("#hiddenMenuCreado").val() !== 1) {
|
||||
var uri = CatalogosWCF + '/api/ObtenerPantallas';
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ this.IniciarSesion = function (data) {
|
|||
UserFullName: fullname,
|
||||
PermisosUsuario: ArrayPermisos
|
||||
};
|
||||
localStorage['ListaOpciones'] = ArrayPermisos;
|
||||
url = $("#hiddenHref").val();
|
||||
url = url.replace("View", "Index");
|
||||
url = url.replace("Controller", "Home");
|
||||
|
|
@ -109,6 +110,7 @@ this.IniciarSesion = function (data) {
|
|||
document.location.href = url;
|
||||
},
|
||||
error: function () {
|
||||
|
||||
document.location.href = url;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,30 +2,20 @@
|
|||
var Item = {};
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
//var opcion = $.grep(, function (data) {
|
||||
// return data.Descripcion == "Ingreso y actualización de mantenimientos";
|
||||
//});
|
||||
|
||||
//if (opcion != null) {
|
||||
CargarMantenimiento();
|
||||
//} else {
|
||||
// toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning);
|
||||
//}
|
||||
|
||||
CargarMantenimiento();
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.CargarMantenimiento = function () {
|
||||
//var variable1 = ListaOpciones;
|
||||
//var ArrayPermisos = [];
|
||||
//$.each(ListaOpciones, function (key, item) {
|
||||
|
||||
// ArrayPermisos.push(item.Descripcion);
|
||||
//});
|
||||
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerMantenimientoCatalogos';
|
||||
AjaxPostData(uri, Item, true, false, CargarTablaMantenimiento, null, null);
|
||||
if (ValidarPermisos('Ver catálogos1').length > 0) {
|
||||
var uri = CatalogosWCF + '/api/ObtenerMantenimientoCatalogos';
|
||||
AjaxPostData(uri, Item, true, false, CargarTablaMantenimiento, null, null);
|
||||
}
|
||||
else {
|
||||
toastr.success('The process has been saved.', 'Success');
|
||||
}
|
||||
}
|
||||
|
||||
this.CargarTablaMantenimiento = function (data) {
|
||||
|
|
|
|||
|
|
@ -14,12 +14,7 @@
|
|||
<div class="panel-body">
|
||||
|
||||
<br />
|
||||
<ul>
|
||||
@foreach (var person in ViewBag.data)
|
||||
{
|
||||
<li>@person.FirstName</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<table id="tableMantenimiento" class="table table-condensed dataTable no-footer">
|
||||
<thead>
|
||||
|
|
@ -44,6 +39,8 @@
|
|||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
@Scripts.Render("~/Sinort-Scripts/Mantenimientos.js")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue