git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C49
This commit is contained in:
parent
c27c342d8b
commit
e6cac49bed
22 changed files with 314 additions and 160 deletions
|
|
@ -48,7 +48,16 @@ namespace AYA.SlnSinort.WCF
|
||||||
|
|
||||||
#region Pantallas
|
#region Pantallas
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
List<Pantallas> ObtenerPantallas(Usuario model);
|
List<Pantallas> ObtenerPantallas(CatalogosPostJSON model);
|
||||||
|
|
||||||
|
[OperationContract]
|
||||||
|
List<RolesPantallas> ObtenerPantallasRol(CatalogosPostJSON model);
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region RolesPantallas
|
||||||
|
[OperationContract]
|
||||||
|
RolesPantallasJSON InsertarActualizarRolesPantallas(RolesPantallasJSON model);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ namespace AYA.SlnSinort.WCF
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Pantallas
|
#region Pantallas
|
||||||
public List<Pantallas> ObtenerPantallas(Usuario model)
|
public List<Pantallas> ObtenerPantallas(CatalogosPostJSON model)
|
||||||
{
|
{
|
||||||
List<Pantallas> respuesta = new List<Pantallas>();
|
List<Pantallas> respuesta = new List<Pantallas>();
|
||||||
try
|
try
|
||||||
|
|
@ -146,6 +146,33 @@ namespace AYA.SlnSinort.WCF
|
||||||
}
|
}
|
||||||
return respuesta;
|
return respuesta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<RolesPantallas> ObtenerPantallasRol(CatalogosPostJSON model)
|
||||||
|
{
|
||||||
|
return new PantallasDAL().ObtenerPantallasRol(model);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region RolesPantallas
|
||||||
|
|
||||||
|
public RolesPantallasJSON InsertarActualizarRolesPantallas(RolesPantallasJSON model)
|
||||||
|
{
|
||||||
|
var rolesDAL = new RolesDAL();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach(var rolPantalla in model.ListaRolesPantallas)
|
||||||
|
rolesDAL.InsertarActualizarRolesPantallas(rolPantalla);
|
||||||
|
|
||||||
|
model.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
model.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
return model;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7680,7 +7680,6 @@
|
||||||
<Content Include="Sinort-Scripts\Mantenimientos.js" />
|
<Content Include="Sinort-Scripts\Mantenimientos.js" />
|
||||||
<Content Include="Sinort-Scripts\ProyectoNormativo.js" />
|
<Content Include="Sinort-Scripts\ProyectoNormativo.js" />
|
||||||
<Content Include="Sinort-Scripts\Rol.js" />
|
<Content Include="Sinort-Scripts\Rol.js" />
|
||||||
<Content Include="Sinort-Scripts\RolesPantallas.js" />
|
|
||||||
<Content Include="Web.config" />
|
<Content Include="Web.config" />
|
||||||
<Content Include="Web.Debug.config">
|
<Content Include="Web.Debug.config">
|
||||||
<DependentUpon>Web.config</DependentUpon>
|
<DependentUpon>Web.config</DependentUpon>
|
||||||
|
|
@ -7712,7 +7711,6 @@
|
||||||
<Content Include="Views\Catalogos\Aplicacion.cshtml" />
|
<Content Include="Views\Catalogos\Aplicacion.cshtml" />
|
||||||
<Content Include="Views\Home\Proyecto_Normativo.cshtml" />
|
<Content Include="Views\Home\Proyecto_Normativo.cshtml" />
|
||||||
<Content Include="Views\Catalogos\Rol.cshtml" />
|
<Content Include="Views\Catalogos\Rol.cshtml" />
|
||||||
<Content Include="Views\Catalogos\RolesPantallas.cshtml" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="App_Data\" />
|
<Folder Include="App_Data\" />
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
|
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
|
||||||
filter: alpha(opacity=80);
|
filter: alpha(opacity=80);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-close-button:hover,
|
.toast-close-button:hover,
|
||||||
.toast-close-button:focus {
|
.toast-close-button:focus {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
//$("#formCatalogo").EnableValidationToolTip();
|
//$("#formCatalogo").EnableValidationToolTip();
|
||||||
var DataCatalogo;
|
var DataCatalogo;
|
||||||
var id_column = 1;
|
var id_column = 1;
|
||||||
var Item = {};
|
var model = {};
|
||||||
|
|
||||||
|
|
||||||
//#region READY
|
//#region READY
|
||||||
|
|
@ -40,6 +40,7 @@ this.getDataModel = function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#TableItems').TableInit(0, false, true, true, false, null, null);
|
$('#TableItems').TableInit(0, false, true, true, false, null, null);
|
||||||
|
$('#GridRolesPantallas').TableInit(0, false, true, true, false, null, null);
|
||||||
ObtenerRoles();
|
ObtenerRoles();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -56,6 +57,7 @@ this.CargarGridRoles = function (data) {
|
||||||
var pantallas = $("#ucbtnVistaPantallas").html();
|
var pantallas = $("#ucbtnVistaPantallas").html();
|
||||||
var usuarios = $("#ucbtnVistaUsuarios").html();
|
var usuarios = $("#ucbtnVistaUsuarios").html();
|
||||||
option = replaceAll("[$CodItem]", item.IdRol, option);
|
option = replaceAll("[$CodItem]", item.IdRol, option);
|
||||||
|
pantallas = replaceAll("[$CodItem]", item.IdRol, pantallas);
|
||||||
|
|
||||||
var stateIcon = $("#ucItemsIcon").html();
|
var stateIcon = $("#ucItemsIcon").html();
|
||||||
|
|
||||||
|
|
@ -216,33 +218,82 @@ this.LimpiarControles = function () {
|
||||||
$('#lbTituloAccion').append('Ingresar Nuevo Rol');
|
$('#lbTituloAccion').append('Ingresar Nuevo Rol');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.AbrirRolesPantallas = function () {
|
this.AbrirRolesPantallas = function (id) {
|
||||||
$("#modalRolesPantallas").modal('show');
|
$("#modalRolesPantallas").modal('show');
|
||||||
CargarPantallas();
|
CargarPantallas(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.CargarPantallas = function () {
|
this.CargarPantallas = function (id) {
|
||||||
|
|
||||||
|
$('#hiddenIdRol').val(id)
|
||||||
|
var uri = CatalogosWCF + '/api/ObtenerPantallasRol';
|
||||||
|
model = {
|
||||||
|
codigo: id
|
||||||
|
};
|
||||||
|
|
||||||
|
AjaxPostData(uri, model, true, false, CargarTablaPantallas, null, null);
|
||||||
|
|
||||||
var uri = CatalogosWCF + '/api/ObtenerPantallas';
|
|
||||||
AjaxPostData(uri, Item, true, false, CargarTablaPantallas, null, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.CargarTablaPantallas = function (data) {
|
this.CargarTablaPantallas = function (data) {
|
||||||
|
|
||||||
if (data != null) {
|
var TableItems = $('#GridRolesPantallas').DataTable();
|
||||||
lista = data;
|
TableItems.clear().draw();
|
||||||
var Seleccionar = $("#ucbtnCheck").html();
|
var lista = data;
|
||||||
var columnDefinition = [
|
|
||||||
{ "data": "Descripcion" },
|
|
||||||
{ "data": null, className: "center", defaultContent: Seleccionar }
|
|
||||||
];
|
|
||||||
|
|
||||||
$('#GridRolesPantallas').TableInit(1, true, true, true, true, columnDefinition, lista);
|
$.each(lista, function (key, item) {
|
||||||
|
|
||||||
if ($.fn.DataTable.isDataTable('#GridRolesPantallas')) {
|
var pantallas = $("#ucbtnCheck").html();
|
||||||
|
var id = item.IdPantalla;
|
||||||
|
|
||||||
|
TableItems.row.add([id,
|
||||||
|
item.Descripcion,
|
||||||
|
'<input type="checkbox" id="chkSeleccionar_' + id + '" >']).draw();
|
||||||
|
});
|
||||||
|
|
||||||
$('#GridRolesPantallas').DataTable().search('').draw();
|
|
||||||
ENDREQUEST();
|
ENDREQUEST();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.GuardarRolesPantallas = function () {
|
||||||
|
|
||||||
|
if (!confirm("Va registrar las pantallas.\n ¿Desea continuar?"))
|
||||||
|
{ return; }
|
||||||
|
|
||||||
|
TablePantallas = $('#GridRolesPantallas').DataTable();
|
||||||
|
var IdRoles = $('#hiddenIdRol').val();
|
||||||
|
var ArrayRolesPantallas = [];
|
||||||
|
var data = TablePantallas
|
||||||
|
.rows()
|
||||||
|
.data();
|
||||||
|
|
||||||
|
$.each(data, function (key, item) {
|
||||||
|
|
||||||
|
|
||||||
|
var cheched = $("#chkSeleccionar_" + item[0]).prop("checked") ? true : false
|
||||||
|
|
||||||
|
|
||||||
|
RolesPantallas = {
|
||||||
|
IdRol: IdRoles,
|
||||||
|
IdPantalla: item[0],
|
||||||
|
Estado: cheched
|
||||||
|
|
||||||
|
}
|
||||||
|
ArrayRolesPantallas.push(RolesPantallas);
|
||||||
|
});
|
||||||
|
|
||||||
|
var uri = CatalogosWCF + '/api/InsertarActualizarRolesPantallas';
|
||||||
|
var model = {
|
||||||
|
ListaRolesPantallas: ArrayRolesPantallas
|
||||||
|
};
|
||||||
|
|
||||||
|
AjaxPostData(uri, model, true, true, null, null, null);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ENDREQUEST();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
|
|
||||||
var Item = {};
|
|
||||||
jQuery(document).ready(function () {
|
|
||||||
CargarPantallas();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
this.CargarPantallas = function () {
|
|
||||||
|
|
||||||
var uri = CatalogosWCF + '/api/ObtenerPantallas';
|
|
||||||
AjaxPostData(uri, Item, true, false, CargarTablaPantallas, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.CargarTablaPantallas = function (data) {
|
|
||||||
|
|
||||||
if (data != null) {
|
|
||||||
lista = data;
|
|
||||||
var Seleccionar = $("#ucbtnVista").html();
|
|
||||||
var columnDefinition = [
|
|
||||||
{ "data": "Descripcion" },
|
|
||||||
{ "data": null, className: "center", defaultContent: Seleccionar }
|
|
||||||
];
|
|
||||||
|
|
||||||
$('#tablePantallas').TableInit(1, true, true, true, true, columnDefinition, lista);
|
|
||||||
|
|
||||||
if ($.fn.DataTable.isDataTable('#tablePantallas')) {
|
|
||||||
|
|
||||||
$('#tablePantallas').DataTable().search('').draw();
|
|
||||||
ENDREQUEST();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#tablePantallas').on('click', 'button', function () {
|
|
||||||
|
|
||||||
var data = $('#tablePantallas').DataTable().row($(this).parents('tr')).data();
|
|
||||||
|
|
||||||
var mtzView = data.Vista.split('/')
|
|
||||||
|
|
||||||
url = $("#hiddenHref").val();
|
|
||||||
url = url.replace("View", mtzView[1]);
|
|
||||||
url = url.replace("Controller", mtzView[0]);
|
|
||||||
|
|
||||||
document.location.href = url;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
@ -7,9 +7,11 @@
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<input type="hidden" id="hiddenId" value="true">
|
<input type="hidden" id="hiddenId" value="true">
|
||||||
|
<input type="hidden" id="hiddenIdRol" value="true">
|
||||||
<form id="formCatalogo" class="form-horizontal" role="form">
|
<form id="formCatalogo" class="form-horizontal" role="form">
|
||||||
<h3> <i class="fa fa-briefcase"></i> Roles</h3>
|
<h3> <i class="fa fa-briefcase"></i> Roles</h3>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div class="panel panel-success">
|
<div class="panel panel-success">
|
||||||
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
@ -50,7 +52,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="ucbtnVistaPantallas" style=" display:none;">
|
<div id="ucbtnVistaPantallas" style=" display:none;">
|
||||||
<button type="button" id="btnseleccionar" class="btn btn-default btn-xs" onclick="AbrirRolesPantallas()">
|
<button type="button" id="btnseleccionar" class="btn btn-default btn-xs" onclick="AbrirRolesPantallas([$CodItem])">
|
||||||
<i class="fa fa-check"></i> Seleccionar
|
<i class="fa fa-check"></i> Seleccionar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -109,7 +111,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div class="modal fade" id="modalRolesPantallas" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;">
|
<div class="modal fade" id="modalRolesPantallas" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;">
|
||||||
<div class="modal-dialog modal-lg" style="width:80%;">
|
<div class="modal-dialog modal-lg" style="width:40%;">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4><i class="fa fa-bars"></i> Pantallas</h4>
|
<h4><i class="fa fa-bars"></i> Pantallas</h4>
|
||||||
|
|
@ -119,21 +121,24 @@
|
||||||
<table id="GridRolesPantallas" class="table table-condensed dataTable no-footer">
|
<table id="GridRolesPantallas" class="table table-condensed dataTable no-footer">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th class="col-sm-1">ID</th>
|
||||||
<th class="col-sm-4">Descripción</th>
|
<th class="col-sm-4">Descripción</th>
|
||||||
<th>Seleccionar</th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div id="ucbtnCheck" style=" display:none;">
|
@*<div id="ucbtnCheck" style="display:none;" class="checkbox">
|
||||||
<input type="radio">
|
<input type="checkbox" id="chkSeleccionar" value="true">
|
||||||
|
|
||||||
</div>
|
</div>*@
|
||||||
|
|
||||||
<div class="modal-footer">
|
<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>
|
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
|
|
||||||
@{
|
|
||||||
ViewBag.Title = "RolesPantallas";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" id="hiddenHref" value="@string.Concat(Url.Action("View", "Controller", null), ViewBag.QueryEncripted)">
|
|
||||||
<form id="formCatalogo" class="form-horizontal" role="form">
|
|
||||||
<div class="panel-body">
|
|
||||||
<h3> <i class="fa fa-list-ul"></i> Selección de Pantallas </h3>
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<div>
|
|
||||||
<table id="tablePantallas" class="table table-condensed dataTable no-footer">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="col-sm-4">Descripción</th>
|
|
||||||
<th>Acción</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="ucbtnVista" style=" display:none;">
|
|
||||||
|
|
||||||
<input type="checkbox" checked="checked">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
@Scripts.Render("~/Sinort-Scripts/RolesPantallas.js")
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<!-- Google Font -->
|
<!-- Google Font -->
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||||
<link rel="stylesheet" href="~/Content/Principal.css">
|
|
||||||
@*@Styles.Render("~/Content/dashboard")*@
|
@*@Styles.Render("~/Content/dashboard")*@
|
||||||
@Scripts.Render("~/bundles/modernizr")
|
@Scripts.Render("~/bundles/modernizr")
|
||||||
@Scripts.Render("~/bundles/jquery")
|
@Scripts.Render("~/bundles/jquery")
|
||||||
|
|
@ -34,6 +34,12 @@
|
||||||
@Styles.Render("~/Content/sinort-css")
|
@Styles.Render("~/Content/sinort-css")
|
||||||
|
|
||||||
@* Seccion futuros scripts *@
|
@* Seccion futuros scripts *@
|
||||||
|
<style>
|
||||||
|
input[type=checkbox]
|
||||||
|
{
|
||||||
|
-webkit-appearance:checkbox;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="hold-transition skin-blue sidebar-mini">
|
<body class="hold-transition skin-blue sidebar-mini">
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@
|
||||||
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.5.6\lib\net45\NLog.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
|
@ -99,7 +103,9 @@
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,16 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
Log log = new Log("AplicacionDAL");
|
Log log = new Log("AplicacionDAL");
|
||||||
#region ObtenerAplicacion
|
#region ObtenerAplicacion
|
||||||
|
|
||||||
public List<CatalogosJSON> ObtenerAplicacion(string filtro = null)
|
public List<CatalogosJSON> ObtenerAplicacion(CatalogosPostJSON model)
|
||||||
{
|
{
|
||||||
List<CatalogosJSON> registros = null;
|
List<CatalogosJSON> registros = null;
|
||||||
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SinortContex db = new SinortContex())
|
using (SinortContex db = new SinortContex())
|
||||||
{
|
{
|
||||||
registros = (string.IsNullOrWhiteSpace(filtro) ? db.Aplicacion.Where(t => t.Estado == true) : db.Aplicacion.Where(t => t.Estado == true && t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower()) == true))
|
registros = db.Aplicacion.Where(t => t.Estado == true && (string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower())))
|
||||||
.Select(t => new CatalogosJSON()
|
.Select(t => new CatalogosJSON()
|
||||||
{
|
{
|
||||||
codigo = t.IdAplicacion.ToString(),
|
codigo = t.IdAplicacion.ToString(),
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,16 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
Log log = new Log("EmisorDAL");
|
Log log = new Log("EmisorDAL");
|
||||||
#region ObtenerEmisor
|
#region ObtenerEmisor
|
||||||
|
|
||||||
public List<CatalogosJSON> ObtenerEmisor(string filtro = null)
|
public List<CatalogosJSON> ObtenerEmisor(CatalogosPostJSON model)
|
||||||
{
|
{
|
||||||
List<CatalogosJSON> registros = null;
|
List<CatalogosJSON> registros = null;
|
||||||
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SinortContex db = new SinortContex())
|
using (SinortContex db = new SinortContex())
|
||||||
{
|
{
|
||||||
registros = (string.IsNullOrWhiteSpace(filtro) ? db.Emisor.Where(t => t.Estado == true) : db.Emisor.Where(t => t.Estado == true && t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower()) == true))
|
registros = db.Emisor.Where(t => t.Estado == true && (string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower())))
|
||||||
.Select(t => new CatalogosJSON()
|
.Select(t => new CatalogosJSON()
|
||||||
{
|
{
|
||||||
codigo = t.IdEmisor.ToString(),
|
codigo = t.IdEmisor.ToString(),
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,49 @@
|
||||||
using Atesa.Utilitarios;
|
using AYA.SlnSinortModel.Sinort;
|
||||||
using AYA.SlnSinortModel.Sinort;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Data.Entity.Validation;
|
||||||
|
using AYA.SlnSinortModel.Entidades;
|
||||||
|
|
||||||
namespace AYA.SlnSinortModel.DAL.Sinort
|
namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
{
|
{
|
||||||
public class PantallasDAL
|
public class PantallasDAL
|
||||||
{
|
{
|
||||||
Log log = new Log("MatrizDAL");
|
public List<Pantallas> ObtenerPantallas(CatalogosPostJSON model)
|
||||||
public List<Pantallas> ObtenerPantallas(Usuario model)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
List<Pantallas> registros = null;
|
List<Pantallas> registros = null;
|
||||||
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SinortContex db = new SinortContex())
|
using (SinortContex db = new SinortContex())
|
||||||
{
|
{
|
||||||
registros = db.Pantallas.Where(t => t.Estado == true).OrderBy(q => q.IdPantalla).ToList();
|
registros = db.Pantallas.Where(t => t.Estado == true && (string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower() == filtro.Trim().ToLower())).OrderBy(q => q.IdPantalla).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//log.Error(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return registros;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RolesPantallas> ObtenerPantallasRol(CatalogosPostJSON model)
|
||||||
|
{
|
||||||
|
List<RolesPantallas> registros = null;
|
||||||
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SinortContex db = new SinortContex())
|
||||||
|
{
|
||||||
|
registros = db.RolesPantallas.Where(r => r.IdRol.ToString() == model.codigo).Include(p => p.Pantallas).AsNoTracking().ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,16 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
|
|
||||||
#region ObtenerRol
|
#region ObtenerRol
|
||||||
|
|
||||||
public List<CatalogosJSON> ObtenerRol(string filtro = null)
|
public List<CatalogosJSON> ObtenerRol(CatalogosPostJSON model)
|
||||||
{
|
{
|
||||||
List<CatalogosJSON> registros = null;
|
List<CatalogosJSON> registros = null;
|
||||||
|
string filtro = model != null ? model.filtro : null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (SinortContex db = new SinortContex())
|
using (SinortContex db = new SinortContex())
|
||||||
{
|
{
|
||||||
registros = (string.IsNullOrWhiteSpace(filtro) ? db.Roles.Where(t => t.Estado == true) : db.Roles.Where(t => t.Estado == true && t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower()) == true))
|
registros = db.Roles.Where(t => t.Estado == true && (string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower())))
|
||||||
.Select(t => new CatalogosJSON()
|
.Select(t => new CatalogosJSON()
|
||||||
{
|
{
|
||||||
codigo = t.IdRol.ToString(),
|
codigo = t.IdRol.ToString(),
|
||||||
|
|
@ -117,6 +119,63 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region InsertarActualizarRolesPantallas
|
||||||
|
|
||||||
|
public BaseJson InsertarActualizarRolesPantallas(RolesPantallas model)
|
||||||
|
{
|
||||||
|
RolesPantallas Actual = new RolesPantallas();
|
||||||
|
BaseJson Respuesta = new BaseJson();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
model.ClearProperties();
|
||||||
|
|
||||||
|
using (SinortContex Conn = new SinortContex())
|
||||||
|
{
|
||||||
|
Actual = Conn.RolesPantallas.Where(x => x.IdRol == model.IdRol && x.IdPantalla == model.IdPantalla ).FirstOrDefault();
|
||||||
|
if (Actual == null)
|
||||||
|
{
|
||||||
|
int? Next_id = Conn.RolesPantallas.Max(t => (int?)t.IdRolesPantallas);
|
||||||
|
model.IdRolesPantallas = (Next_id == null) ? 1 : Next_id.Value + 1;
|
||||||
|
model.FechaCreacion = DateTime.Now;
|
||||||
|
Conn.RolesPantallas.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.Roles.Attach(model);
|
||||||
|
//Conn.Entry(model).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
}
|
||||||
|
Conn.SaveChanges();
|
||||||
|
Conn.Commit();
|
||||||
|
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (DbEntityValidationException ex)
|
||||||
|
{
|
||||||
|
//logger.Error(exs);
|
||||||
|
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//logger.Error(ex);
|
||||||
|
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Actual = null;
|
||||||
|
}
|
||||||
|
return Respuesta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="EntityFramework" version="6.2.0" targetFramework="net45" />
|
<package id="EntityFramework" version="6.2.0" targetFramework="net45" />
|
||||||
|
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
|
||||||
<package id="NLog" version="4.5.6" targetFramework="net45" />
|
<package id="NLog" version="4.5.6" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
@ -87,6 +87,7 @@
|
||||||
<Compile Include="Sinort\RolesPantallas.cs" />
|
<Compile Include="Sinort\RolesPantallas.cs" />
|
||||||
<Compile Include="Sinort\RolesUsuario.cs" />
|
<Compile Include="Sinort\RolesUsuario.cs" />
|
||||||
<Compile Include="Sinort\SinortContex.cs" />
|
<Compile Include="Sinort\SinortContex.cs" />
|
||||||
|
<Compile Include="Sinort\sysdiagrams.cs" />
|
||||||
<Compile Include="Sinort\TipoAplicacion.cs" />
|
<Compile Include="Sinort\TipoAplicacion.cs" />
|
||||||
<Compile Include="Sinort\TipoDocumento.cs" />
|
<Compile Include="Sinort\TipoDocumento.cs" />
|
||||||
<Compile Include="Sinort\TipoEmisor.cs" />
|
<Compile Include="Sinort\TipoEmisor.cs" />
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
using AYA.SlnSinortModel.Sinort;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -12,4 +13,16 @@ namespace AYA.SlnSinortModel.Entidades
|
||||||
public string codigo { get; set; }
|
public string codigo { get; set; }
|
||||||
public string descripcion { get; set; }
|
public string descripcion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CatalogosPostJSON
|
||||||
|
{
|
||||||
|
public object dataModel { get; set; }
|
||||||
|
public string codigo { get; set; }
|
||||||
|
public string filtro { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RolesPantallasJSON : BaseJson
|
||||||
|
{
|
||||||
|
public List<RolesPantallas> ListaRolesPantallas { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,12 @@ namespace AYA.SlnSinortModel.Sinort
|
||||||
[Table("Catalogos.Pantallas")]
|
[Table("Catalogos.Pantallas")]
|
||||||
public partial class Pantallas
|
public partial class Pantallas
|
||||||
{
|
{
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
|
||||||
|
public Pantallas()
|
||||||
|
{
|
||||||
|
RolesPantallas = new HashSet<RolesPantallas>();
|
||||||
|
}
|
||||||
|
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||||
public int IdPantalla { get; set; }
|
public int IdPantalla { get; set; }
|
||||||
|
|
@ -32,5 +38,8 @@ namespace AYA.SlnSinortModel.Sinort
|
||||||
|
|
||||||
[StringLength(200)]
|
[StringLength(200)]
|
||||||
public string UsuarioModificacion { get; set; }
|
public string UsuarioModificacion { get; set; }
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||||
|
public virtual ICollection<RolesPantallas> RolesPantallas { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
|
namespace AYA.SlnSinortModel.Sinort
|
||||||
|
{
|
||||||
using System;
|
using System;
|
||||||
using System.Data.Entity;
|
using System.Data.Entity;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using AYA.SlnSinortModel.Sinort.Partial;
|
using AYA.SlnSinortModel.Sinort.Partial;
|
||||||
|
|
||||||
namespace AYA.SlnSinortModel.Sinort
|
|
||||||
{
|
|
||||||
|
|
||||||
public partial class SinortContex : Contex
|
public partial class SinortContex : Contex
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public virtual DbSet<Aplicacion> Aplicacion { get; set; }
|
public virtual DbSet<Aplicacion> Aplicacion { get; set; }
|
||||||
public virtual DbSet<Categoria> Categoria { get; set; }
|
public virtual DbSet<Categoria> Categoria { get; set; }
|
||||||
public virtual DbSet<Emisor> Emisor { get; set; }
|
public virtual DbSet<Emisor> Emisor { get; set; }
|
||||||
|
|
@ -26,6 +27,7 @@ namespace AYA.SlnSinortModel.Sinort
|
||||||
public virtual DbSet<TipoForo> TipoForo { get; set; }
|
public virtual DbSet<TipoForo> TipoForo { get; set; }
|
||||||
public virtual DbSet<TipoMatriz> TipoMatriz { get; set; }
|
public virtual DbSet<TipoMatriz> TipoMatriz { get; set; }
|
||||||
public virtual DbSet<Usuario> Usuario { get; set; }
|
public virtual DbSet<Usuario> Usuario { get; set; }
|
||||||
|
public virtual DbSet<sysdiagrams> sysdiagrams { get; set; }
|
||||||
public virtual DbSet<BitacoraDocumentos> BitacoraDocumentos { get; set; }
|
public virtual DbSet<BitacoraDocumentos> BitacoraDocumentos { get; set; }
|
||||||
public virtual DbSet<Documentos> Documentos { get; set; }
|
public virtual DbSet<Documentos> Documentos { get; set; }
|
||||||
public virtual DbSet<DocumentosAdjuntos> DocumentosAdjuntos { get; set; }
|
public virtual DbSet<DocumentosAdjuntos> DocumentosAdjuntos { get; set; }
|
||||||
|
|
@ -117,14 +119,6 @@ namespace AYA.SlnSinortModel.Sinort
|
||||||
.Property(e => e.UsuarioModificacion)
|
.Property(e => e.UsuarioModificacion)
|
||||||
.IsUnicode(false);
|
.IsUnicode(false);
|
||||||
|
|
||||||
modelBuilder.Entity<PermisosUsuario>()
|
|
||||||
.Property(e => e.UsuarioCreacion)
|
|
||||||
.IsUnicode(false);
|
|
||||||
|
|
||||||
modelBuilder.Entity<Pantallas>()
|
|
||||||
.Property(e => e.UsuarioModificacion)
|
|
||||||
.IsUnicode(false);
|
|
||||||
|
|
||||||
modelBuilder.Entity<PlantillaEmail>()
|
modelBuilder.Entity<PlantillaEmail>()
|
||||||
.Property(e => e.NombrePlatilla)
|
.Property(e => e.NombrePlatilla)
|
||||||
.IsUnicode(false);
|
.IsUnicode(false);
|
||||||
|
|
|
||||||
24
AYA.SlnSynor/AYA.SlnSynorModel/Sinort/sysdiagrams.cs
Normal file
24
AYA.SlnSynor/AYA.SlnSynorModel/Sinort/sysdiagrams.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
namespace AYA.SlnSinortModel.Sinort
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Data.Entity.Spatial;
|
||||||
|
|
||||||
|
public partial class sysdiagrams
|
||||||
|
{
|
||||||
|
[Required]
|
||||||
|
[StringLength(128)]
|
||||||
|
public string name { get; set; }
|
||||||
|
|
||||||
|
public int principal_id { get; set; }
|
||||||
|
|
||||||
|
[Key]
|
||||||
|
public int diagram_id { get; set; }
|
||||||
|
|
||||||
|
public int? version { get; set; }
|
||||||
|
|
||||||
|
public byte[] definition { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -109,7 +109,9 @@ namespace Atesa.Utilitarios
|
||||||
byte[] body;
|
byte[] body;
|
||||||
var serializer = new JsonSerializer();
|
var serializer = new JsonSerializer();
|
||||||
serializer.Converters.Add(new StringEnumConverter { AllowIntegerValues = false, CamelCaseText = false });
|
serializer.Converters.Add(new StringEnumConverter { AllowIntegerValues = false, CamelCaseText = false });
|
||||||
|
Message replyMessage = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
using (var ms = new MemoryStream())
|
using (var ms = new MemoryStream())
|
||||||
{
|
{
|
||||||
using (var sw = new StreamWriter(ms, Encoding.UTF8))
|
using (var sw = new StreamWriter(ms, Encoding.UTF8))
|
||||||
|
|
@ -124,12 +126,20 @@ namespace Atesa.Utilitarios
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Message replyMessage = Message.CreateMessage(messageVersion, action, new RawBodyWriter(body));
|
replyMessage = Message.CreateMessage(messageVersion, action, new RawBodyWriter(body));
|
||||||
replyMessage.Properties.Add(WebBodyFormatMessageProperty.Name, new WebBodyFormatMessageProperty(WebContentFormat.Raw));
|
replyMessage.Properties.Add(WebBodyFormatMessageProperty.Name, new WebBodyFormatMessageProperty(WebContentFormat.Raw));
|
||||||
var respProp = new HttpResponseMessageProperty();
|
var respProp = new HttpResponseMessageProperty();
|
||||||
respProp.Headers[HttpResponseHeader.ContentType] = "application/json";
|
respProp.Headers[HttpResponseHeader.ContentType] = "application/json";
|
||||||
respProp.StatusCode = statusCode;
|
respProp.StatusCode = statusCode;
|
||||||
replyMessage.Properties.Add(HttpResponseMessageProperty.Name, respProp);
|
replyMessage.Properties.Add(HttpResponseMessageProperty.Name, respProp);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return replyMessage;
|
return replyMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue