git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C459
This commit is contained in:
parent
255f583fcc
commit
14d8e49f96
5 changed files with 81 additions and 25 deletions
|
|
@ -107,6 +107,9 @@ namespace AYA.SlnSinort.WCF
|
|||
[OperationContract]
|
||||
Usuario BuscarUsuario(CatalogosPostJSON model);
|
||||
|
||||
[OperationContract]
|
||||
RolesUsuario BuscarUsuarioRol(CatalogosPostJSON model);
|
||||
|
||||
[OperationContract]
|
||||
List<RolesUsuario> ObtenerUsuariosRol(CatalogosPostJSON model);
|
||||
|
||||
|
|
|
|||
|
|
@ -476,6 +476,21 @@ namespace AYA.SlnSinort.WCF
|
|||
}
|
||||
return respuesta;
|
||||
}
|
||||
public RolesUsuario BuscarUsuarioRol(CatalogosPostJSON model)
|
||||
{
|
||||
RolesUsuario respuesta = null;
|
||||
try
|
||||
{
|
||||
respuesta = new UsuarioDAL().BuscarUsuarioRol(model);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
return respuesta;
|
||||
}
|
||||
|
||||
public List<RolesUsuario> ObtenerUsuariosRol(CatalogosPostJSON model)
|
||||
{
|
||||
List<RolesUsuario> respuesta = null;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ this.getDataModel = function () {
|
|||
|
||||
$("#btnAgregarUsuario").unbind("click");
|
||||
$("#btnAgregarUsuario").click(function () {
|
||||
AgregarUsuario();
|
||||
VerificarRolUsuario();
|
||||
});
|
||||
|
||||
$("#btnAgregarComentario").unbind("click");
|
||||
|
|
@ -675,11 +675,24 @@ this.BuscarUsuario = function () {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
this.AgregarUsuario = function () {
|
||||
this.VerificarRolUsuario = function () {
|
||||
|
||||
if ($("#txtUsuario").val() != "") {
|
||||
|
||||
model = {
|
||||
codigo: $('#hiddenUsuario').val()
|
||||
}
|
||||
var uri = CatalogosWCF + '/api/BuscarUsuarioRol';
|
||||
AjaxPostData(uri, model, false, false, AgregarUsuario, null, null);
|
||||
}
|
||||
else {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
}
|
||||
}
|
||||
this.AgregarUsuario = function (data) {
|
||||
|
||||
if (data != null) {
|
||||
|
||||
if (!confirm("¿Desea convocar a un nuevo usuario?")) return;
|
||||
|
||||
|
||||
|
|
@ -690,11 +703,11 @@ this.AgregarUsuario = function () {
|
|||
|
||||
|
||||
var repetido = false;
|
||||
var data = tableParticipantes
|
||||
var datos = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
$.each(datos, function (key, item) {
|
||||
|
||||
if (item[1].toLowerCase() == $("#hiddenUsuario").val()) {
|
||||
repetido = true
|
||||
|
|
@ -725,26 +738,26 @@ this.AgregarUsuario = function () {
|
|||
|
||||
AjaxPostData(uri, model, false, true, GuardarTareasPendientes, null, null);
|
||||
|
||||
} else {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
//participanteConfirmado = replaceAll("[$icon]", "fa-check-circle", participanteConfirmado);
|
||||
//participanteConfirmado = replaceAll("[$state_color]", "muted", participanteConfirmado);
|
||||
|
||||
//tableParticipantes.row.add(
|
||||
// [participanteConfirmado,
|
||||
// $("#hiddenUsuario").val(),
|
||||
// $("#txtUsuario").val(),
|
||||
// moment().format('DD-MM-YYYY'),
|
||||
// option])
|
||||
// .draw();
|
||||
|
||||
//toastr.success(Message_Default, Message_Success);
|
||||
}
|
||||
else {
|
||||
toastr.warning("El usuario seleccionado no tiene ningún rol asignado", Message_Warning);
|
||||
}
|
||||
|
||||
|
||||
//participanteConfirmado = replaceAll("[$icon]", "fa-check-circle", participanteConfirmado);
|
||||
//participanteConfirmado = replaceAll("[$state_color]", "muted", participanteConfirmado);
|
||||
|
||||
//tableParticipantes.row.add(
|
||||
// [participanteConfirmado,
|
||||
// $("#hiddenUsuario").val(),
|
||||
// $("#txtUsuario").val(),
|
||||
// moment().format('DD-MM-YYYY'),
|
||||
// option])
|
||||
// .draw();
|
||||
|
||||
//toastr.success(Message_Default, Message_Success);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.GuardarTareasPendientes = function () {
|
||||
|
||||
var ArrayConvocados = [];
|
||||
|
|
@ -1170,7 +1183,7 @@ this.GuardarComentarioMatriz = function () {
|
|||
IdDocumento: Iddoc
|
||||
}
|
||||
|
||||
AjaxPostData(uri, model, false, false, ComentarioMatrizGuardado, null, null);
|
||||
AjaxPostData(uri, model, false, true, ComentarioMatrizGuardado, null, null);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1190,7 +1203,8 @@ this.ComentarioMatrizGuardado = function (data) {
|
|||
$('#modalElemento').modal('hide');
|
||||
var tableDocMatriz = $('#tableDocMatriz').DataTable();
|
||||
tableDocMatriz.clear().draw();
|
||||
CargarMatriz();
|
||||
CargarMatriz(); location.reload(true);
|
||||
//$('#tabs ul li:nth-child(3) a').addClass("active");
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ background-image:url(http://AYA-VSRV-APPTT:2525/dist/img/ajax-loader.gif);backgr
|
|||
<input id="hiddenSubTipoDocumento" type="hidden">
|
||||
<div class="panel-body">
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<ul id="menu">
|
||||
<li><a href="#tabs-1">Información General</a></li>
|
||||
<li><a href="#tabs-2">Usuarios</a></li>
|
||||
<li><a href="#tabs-3" id="tab3">Área de proyecto</a></li>
|
||||
|
|
|
|||
|
|
@ -189,6 +189,30 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
|
||||
return usuario;
|
||||
}
|
||||
public RolesUsuario BuscarUsuarioRol(CatalogosPostJSON model)
|
||||
{
|
||||
RolesUsuario usuario = new RolesUsuario();
|
||||
string filtro = model != null ? model.filtro : null;
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
|
||||
usuario = db.RolesUsuario.Where(r => r.UsuarioSistema.ToString() == model.codigo).FirstOrDefault();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
|
||||
}
|
||||
|
||||
return usuario;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region InsertarActualizarRolesUsuarios
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue