git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C432
This commit is contained in:
parent
643884c50f
commit
dc44913c3a
4 changed files with 75 additions and 20 deletions
|
|
@ -9,7 +9,6 @@ var NombreUsuario = $("#hiddenNombreUsuario").val();
|
|||
var server = window.location.protocol + "//" + "localhost" + "/" + (window.location.pathname.split('/')[1]) + "/";
|
||||
var SinorLoginWCF = "http://localhost/AYA.SlnSinort.WCF/Sinort.svc";
|
||||
var string_empty = "";
|
||||
var ultima_ruta = "http://localhost/AYA.SlnSinort/Catalogos/Mantenimiento#no-back-button";
|
||||
var Atesa = {};
|
||||
var StarterTemplateVisible = true;
|
||||
var LoadMessageThreadCounter = 0;
|
||||
|
|
@ -2010,8 +2009,8 @@ this.ExportarAMsWord = function (html, filename) {
|
|||
}
|
||||
|
||||
this.VolverRuta = function () {
|
||||
var a = document.referrer;
|
||||
window.history.back();
|
||||
var rutaanterior = document.referrer;
|
||||
document.location.href = rutaanterior;
|
||||
}
|
||||
this.EntrarPantallaSolicitud = function (codigo) {
|
||||
url = $("#hiddenHrefS").val();
|
||||
|
|
|
|||
|
|
@ -345,7 +345,6 @@ this.CargarTablaPantallas = function (data) {
|
|||
|
||||
|
||||
GridRolesOpciones.column(1).visible(false);
|
||||
GridRolesOpciones.column(2).visible(false);
|
||||
GridRolesOpciones.row.add([stateIcon,
|
||||
item.IdRolesPantallas,
|
||||
item.Pantallas.IdPantalla,
|
||||
|
|
@ -394,6 +393,7 @@ this.GuardarRolesPantallas = function () {
|
|||
|
||||
AjaxPostData(uri, model, false, true, null, null, null);
|
||||
CargarPantallas(IdRoles);
|
||||
|
||||
ENDREQUEST();
|
||||
|
||||
}
|
||||
|
|
@ -434,6 +434,36 @@ this.HabilitarOpcion = function (id, value) {
|
|||
|
||||
}
|
||||
|
||||
this.AgregarPantallas = function () {
|
||||
|
||||
if (!confirm("Va agregar las opciones seleccionadas.\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
||||
tableOpciones = $('#tableOpciones').DataTable();
|
||||
var GridRolesOpciones = $('#GridRolesOpciones').DataTable();
|
||||
var option = $("#ucbtnRemoverOpcion").html();
|
||||
var stateIcon = $("#ucItemsIconOpcion").html();
|
||||
stateIcon = replaceAll("[$icon]", "fa-check-circle", stateIcon);
|
||||
stateIcon = replaceAll("[$state_color]", "muted", stateIcon);
|
||||
|
||||
var rowcollection = tableOpciones.$(".editor-active:checked", { "page": "all" });
|
||||
rowcollection.each(function (index, elem) {
|
||||
var id = elem.id;
|
||||
var subid = id.substring(6, id.length);
|
||||
GridRolesOpciones.row.add(
|
||||
[stateIcon,
|
||||
0,
|
||||
subid,
|
||||
elem.name,
|
||||
option])
|
||||
.draw();
|
||||
});
|
||||
|
||||
toastr.success("Se han agregado las opciones correctamente", Message_Success);
|
||||
$('#modalOpciones').modal('hide');
|
||||
|
||||
}
|
||||
|
||||
this.CargarPantallasSistema = function () {
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerPantallas';
|
||||
|
|
@ -448,21 +478,41 @@ this.CargarPantallasSistema = function () {
|
|||
|
||||
this.CargarGridPantallas = function (data) {
|
||||
|
||||
if (data != null) {
|
||||
|
||||
var tableOpciones = $('#tableOpciones').DataTable();
|
||||
var lista = data;
|
||||
|
||||
$.each(lista, function (key, item) {
|
||||
|
||||
var Seleccionar = $("#ucBtnSeleccionarOpcion").html();
|
||||
var columnDefinition = [
|
||||
{ "data": "Descripcion", className: "center" },
|
||||
{ "data": null, className: "center", defaultContent: Seleccionar }
|
||||
];
|
||||
Seleccionar = replaceAll("[$idcheck]", item.IdPantalla, Seleccionar);
|
||||
Seleccionar = replaceAll("[$checknombre]", item.Descripcion, Seleccionar);
|
||||
|
||||
tableOpciones.row.add([item.IdPantalla,
|
||||
item.Descripcion,
|
||||
Seleccionar]).draw();
|
||||
|
||||
$('#tableOpciones').TableInit(0, false, true, true, false, columnDefinition, data, false);
|
||||
}
|
||||
});
|
||||
|
||||
else {
|
||||
|
||||
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
||||
}
|
||||
|
||||
//if (data != null) {
|
||||
|
||||
// var Seleccionar = $("#ucBtnSeleccionarOpcion").html();
|
||||
// Seleccionar = replaceAll("[$idcheck]", data.IdPantalla, Seleccionar);
|
||||
// var columnDefinition = [
|
||||
// { "data": "IdPantalla", className: "left" },
|
||||
// { "data": "Descripcion", className: "left" },
|
||||
// { "data": null, className: "center", defaultContent: Seleccionar }
|
||||
// ];
|
||||
|
||||
// $('#tableOpciones').TableInit(0, false, true, true, false, columnDefinition, data, false);
|
||||
//}
|
||||
|
||||
//else {
|
||||
|
||||
// toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
||||
//}
|
||||
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,9 +111,10 @@
|
|||
</button>
|
||||
</div>
|
||||
<div id="ucBtnSeleccionarOpcion" style="display:none;">
|
||||
<button type="button" id="btnSeleccionarOpcion" class="btn btn-default btn-xs">
|
||||
<input type="checkbox" class="editor-active" name="[$checknombre]" id="check_[$idcheck]">
|
||||
@*<button type="button" id="btnSeleccionarOpcion" class="btn btn-default btn-xs">
|
||||
<i id="ibtnSeleccionarOpcion" class="fa fa-check"></i>
|
||||
</button>
|
||||
</button>*@
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -195,9 +196,10 @@
|
|||
<table id="tableOpciones" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-2">ID</th>
|
||||
<th class="col-sm-2">Descripción</th>
|
||||
<th class="col-sm-2">Seleccionar</th>
|
||||
<th></th>
|
||||
@*<th></th>*@
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
|
@ -206,6 +208,10 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success btn-sm" onclick="javascript: AgregarPantallas()">Agregar</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
rolespantallas = db.RolesPantallas.Where(r => r.IdRol.ToString() == model.codigo).Include(u => u.Pantallas).OrderBy(u => u.Pantallas.Descripcion).AsNoTracking().ToList();
|
||||
rolespantallas = db.RolesPantallas.Where(r => r.IdRol.ToString() == model.codigo).Include(u => u.Pantallas).OrderBy(u => u.Pantallas.IdPantalla).AsNoTracking().ToList();
|
||||
|
||||
foreach (var roles in rolespantallas)
|
||||
{
|
||||
listIdPantalla.Add(Convert.ToInt32(roles.IdPantalla));
|
||||
}
|
||||
|
||||
registros = db.Pantallas.Where(p => p.Estado == true && !listIdPantalla.Contains(p.IdPantalla)).OrderByDescending(p => p.IdPantalla).ToList();
|
||||
registros = db.Pantallas.Where(p => p.Estado == true && !listIdPantalla.Contains(p.IdPantalla)).OrderBy(p => p.IdPantalla).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
if (model != null && !string.IsNullOrWhiteSpace(model.codigo))
|
||||
{
|
||||
|
||||
registros = db.RolesPantallas.Where(r => r.IdRol.ToString() == model.codigo).Include(u => u.Pantallas).OrderBy(u => u.Pantallas.Descripcion).AsNoTracking().ToList();
|
||||
registros = db.RolesPantallas.Where(r => r.IdRol.ToString() == model.codigo).Include(u => u.Pantallas).OrderBy(u => u.Pantallas.IdPantalla).AsNoTracking().ToList();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue