git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C331
This commit is contained in:
parent
f6ed04e480
commit
5c14d697ea
8 changed files with 98 additions and 72 deletions
|
|
@ -51,9 +51,6 @@ namespace AYA.SlnSinort.WCF
|
|||
[OperationContract]
|
||||
List<Roles> ObtenerRol();
|
||||
|
||||
//[OperationContract]
|
||||
//List<CatalogosJSON> ObtenerUsuarioExperto();
|
||||
|
||||
[OperationContract]
|
||||
BaseJson InsertarActualizarRol(Roles model);
|
||||
#endregion
|
||||
|
|
@ -68,6 +65,9 @@ namespace AYA.SlnSinort.WCF
|
|||
#endregion
|
||||
|
||||
#region RolesPantallas
|
||||
[OperationContract]
|
||||
List<RolesPantallas> ObtenerRolesPantalla(CatalogosPostJSON model);
|
||||
|
||||
[OperationContract]
|
||||
RolesPantallasJSON InsertarActualizarRolesPantallas(RolesPantallasJSON model);
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -242,6 +242,21 @@ namespace AYA.SlnSinort.WCF
|
|||
|
||||
return model;
|
||||
}
|
||||
|
||||
public List<RolesPantallas> ObtenerRolesPantalla(CatalogosPostJSON model) {
|
||||
|
||||
List<RolesPantallas> respuesta = null;
|
||||
try
|
||||
{
|
||||
respuesta = new RolesDAL().ObtenerRolesPantalla(model);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
return respuesta;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Usuario
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ var IdSolicitud;
|
|||
var DescTipoproyecto;
|
||||
var modelDocumentoAdjunto;
|
||||
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
CargarTipoSolicitud();
|
||||
|
|
@ -280,32 +281,61 @@ this.GuardarSolicitud = function () {
|
|||
var uri = SinortWCF + '/api/GuardarSolicitud';
|
||||
LeerFormulario();
|
||||
|
||||
AjaxPostData(uri, model, false, true, GuardarTareasPendientes, null, null);
|
||||
AjaxPostData(uri, model, false, true, ObtenerRolPantalla, null, null);
|
||||
|
||||
//LimpiarSolicitud();
|
||||
}
|
||||
this.ObtenerRolPantalla = function (data) {
|
||||
IdSolicitud = data.Solicitud.IdSolicitud;
|
||||
var uri = CatalogosWCF + '/api/ObtenerRolesPantalla';
|
||||
var model = {
|
||||
codigo: 27
|
||||
};
|
||||
|
||||
AjaxPostData(uri, model, false, false, ObtenerUsuarioRol, null, null);
|
||||
|
||||
////////
|
||||
}
|
||||
this.ObtenerUsuarioRol = function (data) {
|
||||
|
||||
var modelPost = {
|
||||
listaCodigos: []
|
||||
};
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
modelPost.listaCodigos.push(item.IdRol);
|
||||
});
|
||||
|
||||
if (modelPost.listaCodigos.indexOf(1) == -1)
|
||||
modelPost.listaCodigos.push(1);
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerUsuariosRol';
|
||||
AjaxPostData(uri, modelPost, false, false, GuardarTareasPendientes, null, null);
|
||||
|
||||
}
|
||||
|
||||
/////
|
||||
this.GuardarTareasPendientes = function (data) {
|
||||
|
||||
if (data.CodigoRespuesta == 'EXITOSO'){
|
||||
|
||||
//if (data.CodigoRespuesta == 'EXITOSO'){
|
||||
var ArrayUsuarios = [];
|
||||
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
TareaPendiente
|
||||
= {
|
||||
Descripcion: 'Registro de solicitud (SINORT): solicitud de ' + DescTipoSolicitud +' #'+ data.Solicitud.IdSolicitud +' realizada por: ' +UsuarioSistema,
|
||||
ContenidoRelacionado: 'Solicitud de ' + DescTipoSolicitud +' #'+ data.Solicitud.IdSolicitud + ' realizada por ' +UsuarioSistema,
|
||||
Descripcion: 'Registro de solicitud (SINORT): solicitud de ' + DescTipoSolicitud + ' #' + IdSolicitud + ' realizada por: ' + UsuarioSistema,
|
||||
ContenidoRelacionado: 'Solicitud de ' + DescTipoSolicitud + ' #' + IdSolicitud + ' realizada por ' + UsuarioSistema,
|
||||
Respuesta: false,
|
||||
FechaVencimiento: '2018-7-17',
|
||||
TipoTareaPendiente: 'Solicitud',
|
||||
UsuarioAsignado: $("#txtNombreSuperior").val(),
|
||||
IdProyectoNormativo: data.Solicitud.IdSolicitud,
|
||||
UsuarioAsignado: item.Usuario.UsuarioSistema,
|
||||
IdProyectoNormativo: IdSolicitud,
|
||||
PromotorProyectoNormativo: UsuarioSistema
|
||||
}
|
||||
|
||||
ArrayUsuarios.push(TareaPendiente);
|
||||
});
|
||||
|
||||
|
||||
var uri = SinortWCF + '/api/InsertarActualizarTareasPendientes2';
|
||||
|
|
@ -318,7 +348,7 @@ this.GuardarTareasPendientes = function (data) {
|
|||
//EnviarCorreo();
|
||||
LimpiarSolicitud();
|
||||
location.reload();
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
this.EnviarCorreo = function () {
|
||||
|
|
|
|||
|
|
@ -75,36 +75,11 @@ this.CargarTablaSolicitudes = function (data) {
|
|||
{ "data": "Usuario1.NombreUsuario"},
|
||||
{ "data": null, className: "center", defaultContent: Seleccionar }
|
||||
];
|
||||
var contador = 0;
|
||||
|
||||
$('#tableSolicitudes').DataTable({
|
||||
|
||||
initComplete: function () {
|
||||
$('#tableSolicitudes').TableInit(1, false, true, true, true, columnDefinition, Solicitudes);
|
||||
|
||||
this.api().columns().every(function () {
|
||||
|
||||
var column = this;
|
||||
if (column.selector.cols == 2) {
|
||||
|
||||
var select = $('<select><option value=""></option></select>')
|
||||
.appendTo($(column.header()).empty())
|
||||
.on('change', function () {
|
||||
var val = $.fn.dataTable.util.escapeRegex(
|
||||
$(this).val()
|
||||
);
|
||||
|
||||
column
|
||||
.search(val ? '^' + val + '$' : '', true, false)
|
||||
.draw();
|
||||
});
|
||||
|
||||
column.data().unique().sort().each(function (d, j) {
|
||||
select.append('<option value="' + d + '">' + d + '</option>')
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -15,18 +15,12 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1">ID</th>
|
||||
<th class="col-sm-5">Título</th>
|
||||
<th class="col-sm-5">Área aplicación</th>
|
||||
<th class="col-sm-3">Creado por</th>
|
||||
<th class="col-sm-4">Título</th>
|
||||
<th class="col-sm-4">Área aplicación</th>
|
||||
<th class="col-sm-4">Creado por</th>
|
||||
<th class="col-sm-2">Acción</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="col-sm-1"></th>
|
||||
<th class="col-sm-5"></th>
|
||||
<th class="col-sm-3"></th>
|
||||
<th class="col-sm-4"></th>
|
||||
<th class="col-sm-2"></th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|||
using AYA.SlnSinortModel;
|
||||
using AYA.SlnSinortModel.Entidades;
|
||||
using AYA.SlnSinortModel.Sinort;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Validation;
|
||||
using Atesa.Utilitarios;
|
||||
using AYA.SlnSinortModel.Constantes;
|
||||
|
|
@ -177,37 +178,38 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
|
||||
#endregion
|
||||
|
||||
#region Obtener usuarios funcional experto
|
||||
#region ObtenerRolesPantalla
|
||||
|
||||
public List<CatalogosJSON> ObtenerUsuarioExperto(CatalogosPostJSON model)
|
||||
public List<RolesPantallas> ObtenerRolesPantalla(CatalogosPostJSON model)
|
||||
{
|
||||
List<CatalogosJSON> registros = null;
|
||||
List<RolesPantallas> registros = null;
|
||||
string filtro = model != null ? model.filtro : null;
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
registros = db.Roles.Where(t => t.Estado == true && t.Descripcion == "Usuario funcional experto".ToString() && (string.IsNullOrEmpty(filtro) || t.Descripcion.Trim().ToLower().Contains(filtro.Trim().ToLower())))
|
||||
//.Include(y => y.Usuario)
|
||||
.Select(t => new CatalogosJSON()
|
||||
if (model != null && !string.IsNullOrWhiteSpace(model.codigo))
|
||||
{
|
||||
codigo = t.IdRol.ToString(),
|
||||
descripcion = t.Descripcion,
|
||||
|
||||
})
|
||||
registros = db.RolesPantallas.Where(r => r.IdPantalla.ToString() == model.codigo).Include(u => u.Roles).OrderBy(u => u.IdRol).AsNoTracking()
|
||||
//.Select(t => new RolesPantallas()
|
||||
//{
|
||||
// IdRol = t.IdRol,
|
||||
//})
|
||||
.ToList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
log.Error(ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return registros;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
if (model != null && model.ListaCodigos != null && model.ListaCodigos.Count > 0)
|
||||
{
|
||||
registros = db.RolesUsuario.Where(r => model.ListaCodigos.Contains(r.IdRol.Value)).Include(u => u.Usuario).OrderBy(u => u.IdRolesUsuario).AsNoTracking().ToList();
|
||||
}
|
||||
|
||||
if (model != null && !string.IsNullOrWhiteSpace(model.codigo))
|
||||
{
|
||||
|
|
@ -120,7 +124,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
model.FechaCreacion = Actual.FechaCreacion;
|
||||
model.UsuarioCreacion = Actual.UsuarioCreacion;
|
||||
model.IdRol = Actual.IdRol;
|
||||
model.UsuarioSistema =Actual.UsuarioSistema ;
|
||||
model.UsuarioSistema = Actual.UsuarioSistema;
|
||||
Conn.Entry(Actual).State = System.Data.Entity.EntityState.Detached;
|
||||
Conn.RolesUsuario.Attach(model);
|
||||
Conn.Entry(model).State = System.Data.Entity.EntityState.Modified;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,15 @@ namespace AYA.SlnSinortModel.Entidades
|
|||
{
|
||||
//public object dataModel { get; set; }
|
||||
public string codigo { get; set; }
|
||||
public List<int> ListaCodigos { get; set; }
|
||||
|
||||
public List<string> ListaDesc { get; set; }
|
||||
|
||||
public string filtro { get; set; }
|
||||
public Usuario usuario { get; set; }
|
||||
public int? IdTipo { get; set; }
|
||||
|
||||
public int? IdPantalla { get; set; }
|
||||
}
|
||||
|
||||
public class RolesPantallasJSON : BaseJson
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue