git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C60
This commit is contained in:
parent
322a552cab
commit
cbb397e139
12 changed files with 242 additions and 53 deletions
|
|
@ -55,10 +55,15 @@ namespace AYA.SlnSinort.WCF
|
|||
|
||||
#endregion
|
||||
|
||||
#region RolesPantallas
|
||||
#region RolesPantallas
|
||||
[OperationContract]
|
||||
RolesPantallasJSON InsertarActualizarRolesPantallas(RolesPantallasJSON model);
|
||||
#endregion
|
||||
|
||||
#region Usuario
|
||||
[OperationContract]
|
||||
List<Usuario> ObtenerUsuario();
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,23 @@ namespace AYA.SlnSinort.WCF
|
|||
return model;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Usuario
|
||||
public List<Usuario> ObtenerUsuario()
|
||||
{
|
||||
List<Usuario> respuesta = null;
|
||||
try
|
||||
{
|
||||
respuesta = new UsuarioDAL().ObtenerUsuario();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
return respuesta;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7683,6 +7683,7 @@
|
|||
<Content Include="Sinort-Scripts\PropuestaNormativa\PropuestaNormativa.js" />
|
||||
<Content Include="Sinort-Scripts\ProyectoNormativo.js" />
|
||||
<Content Include="Sinort-Scripts\Rol.js" />
|
||||
<Content Include="Sinort-Scripts\Usuario.js" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
|
|
@ -7716,6 +7717,7 @@
|
|||
<Content Include="Views\PropuestaNormativa\Foro.cshtml" />
|
||||
<Content Include="Views\PropuestaNormativa\DetallePropuesta.cshtml" />
|
||||
<Content Include="Views\Shared\_Catalogo.cshtml" />
|
||||
<Content Include="Views\Catalogos\Usuario.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ namespace AYA.SlnSinort.Controllers.Catalogos
|
|||
InitControllers();
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult RolesPantallas()
|
||||
public ActionResult Usuario()
|
||||
{
|
||||
InitControllers();
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -74,11 +74,12 @@ this.CargarGridAplicaciones = function (data) {
|
|||
option = replaceAll("[$icon]", "fa-times", option);
|
||||
option = replaceAll("[$value]", "0", option);
|
||||
}
|
||||
|
||||
TableItems.column(1).visible(false);
|
||||
TableItems.row.add([stateIcon,
|
||||
item.IdAplicacion,
|
||||
item.Descripcion,
|
||||
option]).draw();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -67,12 +67,12 @@ this.CargarGridEmisores = function (data) {
|
|||
option = replaceAll("[$icon]", "fa-times", option);
|
||||
option = replaceAll("[$value]", "0", option);
|
||||
}
|
||||
|
||||
TableItems.column(1).visible(false);
|
||||
TableItems.row.add([stateIcon,
|
||||
item.IdEmisor,
|
||||
item.Descripcion,
|
||||
option]).draw();
|
||||
|
||||
|
||||
});
|
||||
|
||||
ENDREQUEST();
|
||||
|
|
|
|||
|
|
@ -77,14 +77,14 @@ this.CargarGridRoles = function (data) {
|
|||
option = replaceAll("[$icon]", "fa-times", option);
|
||||
option = replaceAll("[$value]", "0", option);
|
||||
}
|
||||
|
||||
TableItems.column(1).visible(false);
|
||||
TableItems.row.add([stateIcon,
|
||||
item.IdRol,
|
||||
item.Descripcion,
|
||||
pantallas,
|
||||
usuarios,
|
||||
option]).draw();
|
||||
|
||||
|
||||
});
|
||||
|
||||
ENDREQUEST();
|
||||
|
|
@ -247,11 +247,14 @@ this.CargarTablaPantallas = function (data) {
|
|||
checkbox = replaceAll("[$id]", item.IdPantalla, checkbox);
|
||||
checkbox = replaceAll("[$check]", item.Estado != true ? "" : "checked", checkbox);
|
||||
|
||||
|
||||
TableItems.column(0).visible(false);
|
||||
TableItems.column(1).visible(false);
|
||||
TableItems.row.add([item.IdRolesPantallas,
|
||||
item.IdPantalla,
|
||||
item.Pantallas.Descripcion,
|
||||
checkbox]).draw();
|
||||
TableItems.column(0).visible(false);
|
||||
|
||||
});
|
||||
|
||||
ENDREQUEST();
|
||||
|
|
@ -300,7 +303,6 @@ this.GuardarRolesPantallas = function () {
|
|||
|
||||
}
|
||||
|
||||
//this.AbrirRolesUsuario = function (id) {
|
||||
// $("#modalRolesUsuario").modal('show');
|
||||
|
||||
//}
|
||||
this.AbrirRolesUsuario = function (id) {
|
||||
$("#modalRolesUsuario").modal('show');
|
||||
}
|
||||
51
AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Usuario.js
Normal file
51
AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Usuario.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
|
||||
var Item = {};
|
||||
jQuery(document).ready(function () {
|
||||
CargarUsuario();
|
||||
});
|
||||
|
||||
|
||||
this.CargarUsuario = function () {
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerUsuario';
|
||||
AjaxPostData(uri, Item, true, false, CargarTablaUsuario, null, null);
|
||||
}
|
||||
|
||||
this.CargarTablaUsuario = function (data) {
|
||||
$('#tableUsuario').TableInit(0, false, true, true, false, null, null);
|
||||
var TableItems = $('#tableUsuario').DataTable();
|
||||
var lista = data;
|
||||
|
||||
$.each(lista, function (key, item) {
|
||||
|
||||
TableItems.row.add([item.IdUsuario,
|
||||
item.UsuarioSistema,
|
||||
item.NombreUsuario,
|
||||
item.EmailUsuario]).draw();
|
||||
TableItems.column(0).visible(false);
|
||||
});
|
||||
|
||||
ENDREQUEST();
|
||||
|
||||
//if (data != null) {
|
||||
// lista = data;
|
||||
|
||||
// var columnDefinition = [
|
||||
// { "data": "IdUsuario" },
|
||||
// { "data": "UsuarioSistema" },
|
||||
// { "data": "NombreUsuario" },
|
||||
// { "data": "EmailUsuario" }
|
||||
|
||||
// ];
|
||||
|
||||
// $('#tableUsuario').TableInit(1, true, true, true, true, columnDefinition, lista);
|
||||
|
||||
// if ($.fn.DataTable.isDataTable('#tableUsuario')) {
|
||||
|
||||
// $('#tableUsuario').DataTable().search('').draw();
|
||||
|
||||
// ENDREQUEST();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<input type="hidden" id="hiddenId" value="true">
|
||||
<input type="hidden" id="hiddenIdRol" value="true">
|
||||
<form id="formCatalogo" class="form-horizontal" role="form">
|
||||
<div class="panel-body"> <h3> <i class="fa fa-briefcase"></i> Roles </h3> </div>
|
||||
<div class="panel-body"> <h3> <i class="fa fa-briefcase"></i> Emisor </h3> </div>
|
||||
<div class="panel panel-success">
|
||||
|
||||
<div class="panel-body">
|
||||
|
|
@ -140,60 +140,42 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="modalRolesUsuario" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-lg" style="width:60%;">
|
||||
<div class="modal-dialog modal-lg" style="width:50%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4><i class="fa fa-bars"></i> Usuarios</h4>
|
||||
|
||||
</div>
|
||||
<div class="form-group" id="divUsuario">
|
||||
<label class="col-lg-2 col-md-2 col-sm-2 col-xs-2 control-label ControlsForms" id="lblUsuario" for="txtBuscar">Buscar</label>
|
||||
<div class="input-group input-group-sm col-md-4">
|
||||
<input id="hiddenUsuario" type="hidden">
|
||||
<input name="txtUsuario" title="" class="form-control TextBoxCatalogo inputWarning error" id="txtConvocados" required="required" type="text" data-original-title="">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="col-md-10">
|
||||
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ControlsForms">Buscar</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" id="txtDescripcion" name="txtDescripcion" class="form-control imput-xs" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<button type="button" class="btn btn-default btn-sm pull-right" id="btnInsertar">
|
||||
<span class="fa fa-upload" aria-hidden="true"></span> Agregar
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default btn-medium" id="btn_eliminarUsuario" type="button">
|
||||
<i class="fa fa-close"></i>
|
||||
</button>
|
||||
<button class="btn btn-success btn-medium btn-margin-catalogo" id="btnUsuario" type="button" usehttppost="0" webapplication="">
|
||||
<i class="fa fa-plus"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table id="GridRolesUsuario" class="table table-condensed dataTable no-footer">
|
||||
</div>
|
||||
<br />
|
||||
<div class="modal-body">
|
||||
<table id="GridRolesUsuarios" class="table table-condensed dataTable no-footer">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1">ID</th>
|
||||
<th class="col-sm-4">Descripción</th>
|
||||
<th></th>
|
||||
<th class="col-sm-4">Usuario</th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@*<div id="ucbtnCheck" style="display:none;" class="checkbox">
|
||||
<input type="checkbox" id="chkSeleccionar" value="true">
|
||||
|
||||
</div>*@
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success btn-sm" onclick="javascript: GuardarRolesPantallas()">Guardar</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||
|
|
@ -205,6 +187,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Scripts.Render("~/Sinort-Scripts/Rol.js")
|
||||
|
||||
|
||||
|
|
|
|||
52
AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Usuario.cshtml
Normal file
52
AYA.SlnSynor/AYA.SlnSynor/Views/Catalogos/Usuario.cshtml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
@{
|
||||
ViewBag.Title = "Usuario";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
|
||||
<input type="hidden" id="hiddenId" value="true">
|
||||
<form id="formCatalogo" class="form-horizontal" role="form">
|
||||
<div class="panel-body"> <h3> <i class="fa fa-briefcase"></i> Usuario </h3> </div>
|
||||
<div class="panel panel-success">
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="col-md-4 ">
|
||||
|
||||
<button class="btn btn-success btn-medium btn-margin-catalogo" id="btnConvocados" type="button" usehttppost="0" webapplication="">
|
||||
<i class="fa fa-refresh"></i> Actualizar
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<table id="tableUsuario" class="table table-condensed dataTable no-footer">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1">Id</th>
|
||||
<th class="col-sm-4">Usuario</th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
<th class="col-sm-4">Email</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@Scripts.Render("~/Sinort-Scripts/Usuario.js")
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,14 +1,88 @@
|
|||
using Atesa.Utilitarios;
|
||||
using AYA.SlnSinortModel.Entidades;
|
||||
using AYA.SlnSinortModel.Sinort;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Validation;
|
||||
|
||||
namespace AYA.SlnSinortModel.DAL.Sinort
|
||||
{
|
||||
public class UsuarioDAL
|
||||
{
|
||||
Log log = new Log("UsuarioDAL");
|
||||
|
||||
public List<Usuario> ObtenerUsuario()
|
||||
{
|
||||
List<Usuario> registros = null;
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
registros = db.Usuario.Where(t => t.Estado == true).OrderBy(q => q.NombreUsuario).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
|
||||
return registros;
|
||||
}
|
||||
|
||||
public List<RolesUsuario> ObtenerUsuariosRol(CatalogosPostJSON model)
|
||||
{
|
||||
List<RolesUsuario> registros = null;
|
||||
string filtro = model != null ? model.filtro : null;
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
if (model != null && !string.IsNullOrWhiteSpace(model.codigo))
|
||||
{
|
||||
|
||||
registros = db.RolesUsuario.Where(r => r.IdRol.ToString() == model.codigo).Include(u => u.Usuario).OrderBy(r => r.IdUsuario).AsNoTracking().ToList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
|
||||
return registros;
|
||||
}
|
||||
public Usuario BuscarUsuario(CatalogosPostJSON model)
|
||||
{
|
||||
Usuario usuario = new Usuario();
|
||||
string filtro = model != null ? model.filtro : null;
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
if (model != null && !string.IsNullOrWhiteSpace(model.codigo))
|
||||
{
|
||||
|
||||
usuario = db.Usuario.Where(r => r.UsuarioSistema.ToString() == model.codigo).FirstOrDefault();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
|
||||
return usuario;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue