git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C462
This commit is contained in:
parent
c215e50a8a
commit
ccba57a38c
6 changed files with 339 additions and 162 deletions
|
|
@ -20,6 +20,9 @@ namespace AYA.SlnSinort.WCF
|
|||
[OperationContract]
|
||||
ProyectoNormativoJSON GuardarProyectoNormativo(ProyectoNormativoJSON model);
|
||||
|
||||
[OperationContract]
|
||||
string BuscarNombreProyecto(ProyectoNormativoJSON model);
|
||||
|
||||
[OperationContract]
|
||||
ProyectoNormativoJSON GuardarConvocatoriaProyectoNormativo(ProyectoNormativoJSON model);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,19 @@ namespace AYA.SlnSinort.WCF
|
|||
}
|
||||
return model;
|
||||
}
|
||||
public string BuscarNombreProyecto(ProyectoNormativoJSON model) {
|
||||
string respuesta = null;
|
||||
try
|
||||
{
|
||||
respuesta = new ProyectoNormativoDAL().BuscarNombreProyecto(model);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
return respuesta;
|
||||
}
|
||||
public ProyectoNormativoJSON GuardarConvocatoriaProyectoNormativo(ProyectoNormativoJSON model)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ this.getDataModel = function () {
|
|||
|
||||
$("#btnAgregarUsuario").unbind("click");
|
||||
$("#btnAgregarUsuario").click(function () {
|
||||
AgregarUsuario();
|
||||
VerificarRolUsuario();
|
||||
});
|
||||
|
||||
$("#btnBuscarUsuarioExterno").unbind("click");
|
||||
|
|
@ -29,7 +29,7 @@ this.getDataModel = function () {
|
|||
|
||||
$("#btnAgregarUsuarioExterno").unbind("click");
|
||||
$("#btnAgregarUsuarioExterno").click(function () {
|
||||
AgregarUsuarioExterno();
|
||||
VerificarRolUsuarioExterno();
|
||||
});
|
||||
|
||||
$('#GridConvocados').TableInit(0, false, true, true, false, null, null);
|
||||
|
|
@ -121,49 +121,6 @@ this.BuscarUsuario = function () {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
this.AgregarUsuario = function () {
|
||||
|
||||
if ($("#txtUsuario").val() == '') {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!confirm("¿Desea convocar a un nuevo participante?")) return;
|
||||
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
var repetido = false;
|
||||
var data = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
|
||||
if (item[0] == $('#hiddenUsuarioExterno').val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('No puede convocar dos veces al mismo usuario', Message_Warning);
|
||||
return;
|
||||
}
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenUsuario").val(),
|
||||
$("#txtUsuario").val(),
|
||||
option])
|
||||
.draw();
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
$('#hiddenUsuario').val('');
|
||||
$('#txtUsuario').val('');
|
||||
}
|
||||
|
||||
this.BuscarUsuarioExterno = function () {
|
||||
SelectedCatalog = 'UsuariosExterno';
|
||||
|
||||
|
|
@ -176,47 +133,174 @@ this.BuscarUsuarioExterno = function () {
|
|||
|
||||
}
|
||||
}
|
||||
//this.AgregarUsuario = function () {
|
||||
|
||||
this.AgregarUsuarioExterno = function () {
|
||||
// if ($("#txtUsuario").val() == '') {
|
||||
// toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
// return;
|
||||
// }
|
||||
|
||||
if ($("#txtUsuarioExterno").val() == '') {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
return;
|
||||
// if (!confirm("¿Desea convocar a un nuevo participante?")) return;
|
||||
|
||||
// var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
// var repetido = false;
|
||||
// var data = tableParticipantes
|
||||
// .rows()
|
||||
// .data();
|
||||
|
||||
// $.each(data, function (key, item) {
|
||||
|
||||
// if (item[0] == $('#hiddenUsuarioExterno').val()) {
|
||||
// repetido = true
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// });
|
||||
|
||||
// if (repetido == true) {
|
||||
// toastr.warning('No puede convocar dos veces al mismo usuario', Message_Warning);
|
||||
// return;
|
||||
// }
|
||||
// var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
|
||||
// tableParticipantes.row.add(
|
||||
// [$("#hiddenUsuario").val(),
|
||||
// $("#txtUsuario").val(),
|
||||
// option])
|
||||
// .draw();
|
||||
|
||||
// toastr.success(Message_Default, Message_Success);
|
||||
// $('#hiddenUsuario').val('');
|
||||
// $('#txtUsuario').val('');
|
||||
//}
|
||||
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 (!confirm("¿Desea convocar a un nuevo participante?")) return;
|
||||
if (data.pantallas.length > 0) {
|
||||
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
var repetido = false;
|
||||
var data = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
|
||||
if (item[0] == $('#hiddenUsuarioExterno').val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
if (!confirm("¿Desea convocar a un nuevo usuario?")) {
|
||||
ENDREQUEST(); return;
|
||||
}
|
||||
|
||||
});
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('No puede convocar dos veces al mismo usuario', Message_Warning);
|
||||
return;
|
||||
var repetido = false;
|
||||
var datos = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(datos, function (key, item) {
|
||||
|
||||
if (item[1].toLowerCase() == $("#hiddenUsuario").val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('Ya existe el usuario en la lista de participantes', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenUsuario").val(),
|
||||
$("#txtUsuario").val(),
|
||||
option])
|
||||
.draw();
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
|
||||
$('#hiddenUsuario').val('');
|
||||
$('#txtUsuario').val('');
|
||||
|
||||
} else {
|
||||
toastr.warning("Debe asignarle un rol al usuario", Message_Warning);
|
||||
}
|
||||
ENDREQUEST();
|
||||
}
|
||||
this.VerificarRolUsuarioExterno = function () {
|
||||
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
if ($("#txtUsuarioExterno").val() != "") {
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenUsuarioExterno").val(),
|
||||
$("#txtUsuarioExterno").val(),
|
||||
option])
|
||||
.draw();
|
||||
model = {
|
||||
codigo: $('#hiddenUsuarioExterno').val()
|
||||
}
|
||||
var uri = CatalogosWCF + '/api/BuscarUsuarioRol';
|
||||
AjaxPostData(uri, model, false, false, AgregarUsuario, null, null);
|
||||
}
|
||||
else {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
}
|
||||
}
|
||||
this.AgregarUsuarioExterno = function (data) {
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
$('#hiddenUsuarioExterno').val('');
|
||||
$('#txtUsuarioExterno').val('');
|
||||
if (data.pantallas.length > 0) {
|
||||
|
||||
if (!confirm("¿Desea convocar a un nuevo usuario?")) {
|
||||
ENDREQUEST(); return;
|
||||
}
|
||||
|
||||
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
var ArrayParticipantes = [];
|
||||
|
||||
|
||||
var repetido = false;
|
||||
var datos = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(datos, function (key, item) {
|
||||
|
||||
if (item[1].toLowerCase() == $("#hiddenUsuarioExterno").val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('Ya existe el usuario en la lista de participantes', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenusuario").val(),
|
||||
$("#txtUsuario").val(),
|
||||
option])
|
||||
.draw();
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
|
||||
$('#hiddenUsuarioExterno').val('');
|
||||
$('#txtUsuarioExterno').val('');
|
||||
|
||||
} else {
|
||||
toastr.warning("Debe asignarle un rol al usuario", Message_Warning);
|
||||
}
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
this.LimpiarUsuarioExterno = function () {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ this.getDataModel = function () {
|
|||
|
||||
$("#btnAgregarUsuario").unbind("click");
|
||||
$("#btnAgregarUsuario").click(function () {
|
||||
AgregarUsuario();
|
||||
VerificarRolUsuario();
|
||||
});
|
||||
|
||||
$("#btnBuscarUsuarioExterno").unbind("click");
|
||||
|
|
@ -36,7 +36,7 @@ this.getDataModel = function () {
|
|||
|
||||
$("#btnAgregarUsuarioExterno").unbind("click");
|
||||
$("#btnAgregarUsuarioExterno").click(function () {
|
||||
AgregarUsuarioExterno();
|
||||
VerificarRolUsuarioExterno();
|
||||
});
|
||||
|
||||
$("#btnBuscarEmisor").unbind("click");
|
||||
|
|
@ -225,8 +225,6 @@ this.CargarGridUsuariosExternos = function (data) {
|
|||
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
|
||||
this.BuscarUsuario = function () {
|
||||
SelectedCatalog = 'Usuarios';
|
||||
|
||||
|
|
@ -239,56 +237,6 @@ this.BuscarUsuario = function () {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
this.AgregarUsuario = function () {
|
||||
|
||||
if ($("#txtUsuario").val() == '') {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!confirm("¿Desea convocar a un nuevo participante?")) return;
|
||||
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
var repetido = false;
|
||||
var data = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
|
||||
if (item[0] == $('#hiddenusuario').val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('No puede convocar dos veces al mismo usuario', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenusuario").val(),
|
||||
$("#txtUsuario").val(),
|
||||
option])
|
||||
.draw();
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
$('#hiddenusuario').val('');
|
||||
$('#txtUsuario').val('');
|
||||
}
|
||||
|
||||
this.LimpiarUsuario = function () {
|
||||
$('#hiddenusuario').val('');
|
||||
$('#txtUsuario').val('');
|
||||
}
|
||||
|
||||
this.BuscarUsuarioExterno = function () {
|
||||
SelectedCatalog = 'UsuariosExterno';
|
||||
|
||||
|
|
@ -302,55 +250,146 @@ this.BuscarUsuarioExterno = function () {
|
|||
}
|
||||
}
|
||||
|
||||
this.AgregarUsuarioExterno = function () {
|
||||
this.VerificarRolUsuario = function () {
|
||||
|
||||
if ($("#txtUsuarioExterno").val() == '') {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
return;
|
||||
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 (!confirm("¿Desea convocar a un nuevo participante?")) return;
|
||||
if (data.pantallas.length > 0) {
|
||||
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
var repetido = false;
|
||||
var data = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
|
||||
if (item[0] == $('#hiddenUsuarioExterno').val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
if (!confirm("¿Desea convocar a un nuevo usuario?")) {
|
||||
ENDREQUEST(); return;
|
||||
}
|
||||
|
||||
});
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('No puede convocar dos veces al mismo usuario', Message_Warning);
|
||||
return;
|
||||
var repetido = false;
|
||||
var datos = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(datos, function (key, item) {
|
||||
|
||||
if (item[1].toLowerCase() == $("#hiddenusuario").val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('Ya existe el usuario en la lista de participantes', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenusuario").val(),
|
||||
$("#txtUsuario").val(),
|
||||
option])
|
||||
.draw();
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
|
||||
$('#hiddenusuario').val('');
|
||||
$('#txtUsuario').val('');
|
||||
|
||||
} else {
|
||||
toastr.warning("Debe asignarle un rol al usuario", Message_Warning);
|
||||
}
|
||||
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenUsuarioExterno").val(),
|
||||
$("#txtUsuarioExterno").val(),
|
||||
option])
|
||||
.draw();
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
$('#hiddenUsuarioExterno').val('');
|
||||
$('#txtUsuarioExterno').val('');
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
this.VerificarRolUsuarioExterno = function () {
|
||||
|
||||
if ($("#txtUsuarioExterno").val() != "") {
|
||||
|
||||
model = {
|
||||
codigo: $('#hiddenUsuarioExterno').val()
|
||||
}
|
||||
var uri = CatalogosWCF + '/api/BuscarUsuarioRol';
|
||||
AjaxPostData(uri, model, false, false, AgregarUsuario, null, null);
|
||||
}
|
||||
else {
|
||||
toastr.warning("Debe seleccionar un usuario", Message_Warning);
|
||||
}
|
||||
}
|
||||
|
||||
this.AgregarUsuarioExterno = function (data) {
|
||||
|
||||
if (data.pantallas.length > 0) {
|
||||
|
||||
if (!confirm("¿Desea convocar a un nuevo usuario?")) {
|
||||
ENDREQUEST(); return;
|
||||
}
|
||||
|
||||
|
||||
var tableParticipantes = $('#tableParticipantes').DataTable();
|
||||
var ArrayParticipantes = [];
|
||||
|
||||
|
||||
var repetido = false;
|
||||
var datos = tableParticipantes
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(datos, function (key, item) {
|
||||
|
||||
if (item[1].toLowerCase() == $("#hiddenUsuarioExterno").val()) {
|
||||
repetido = true
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (repetido == true) {
|
||||
toastr.warning('Ya existe el usuario en la lista de participantes', Message_Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var option = $("#ucbtnRemoverParticipante").html();
|
||||
|
||||
|
||||
tableParticipantes.row.add(
|
||||
[$("#hiddenusuario").val(),
|
||||
$("#txtUsuario").val(),
|
||||
option])
|
||||
.draw();
|
||||
|
||||
toastr.success(Message_Default, Message_Success);
|
||||
|
||||
$('#hiddenUsuarioExterno').val('');
|
||||
$('#txtUsuarioExterno').val('');
|
||||
|
||||
} else {
|
||||
toastr.warning("Debe asignarle un rol al usuario", Message_Warning);
|
||||
}
|
||||
ENDREQUEST();
|
||||
}
|
||||
this.LimpiarUsuario = function () {
|
||||
$('#hiddenusuario').val('');
|
||||
$('#txtUsuario').val('');
|
||||
}
|
||||
this.LimpiarUsuarioExterno = function () {
|
||||
$('#hiddenUsuarioExterno').val('');
|
||||
$('#txtUsuarioExterno').val('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//TABLES
|
||||
$('#tableUsuariosExterno').on('click', 'button', function () {
|
||||
|
||||
|
|
@ -409,7 +448,21 @@ $('#tableUsuarios').on('click', 'button', function () {
|
|||
$('#modalUsuario').modal('hide');
|
||||
|
||||
});
|
||||
|
||||
this.BuscarNombre = function () {
|
||||
model = {
|
||||
nombreProyecto: $("#txtNombreProyecto").val()
|
||||
}
|
||||
var uri = SinortWCF + '/api/BuscarNombreProyecto';
|
||||
AjaxPostData(uri, model, false, false, ExisteNombre, null, null);
|
||||
}
|
||||
this.ExisteNombre = function (data) {
|
||||
if(data!= null){
|
||||
if (parseInt(data) > 0) {
|
||||
toastr.warning("El nombre de la propuesta ya existe");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.GuardarPropuesta = function () {
|
||||
|
||||
if (!$("#formPropuestaNormativa").valid()) {
|
||||
|
|
@ -422,6 +475,7 @@ this.GuardarPropuesta = function () {
|
|||
return false;
|
||||
}
|
||||
|
||||
BuscarNombre();
|
||||
|
||||
if (!confirm("Va a ingresar una nueva propuesta normativa .\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,29 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
public class ProyectoNormativoDAL
|
||||
{
|
||||
Log log = new Log("ProyectoNormativoDAL");
|
||||
public string BuscarNombreProyecto(ProyectoNormativoJSON model)
|
||||
{
|
||||
string nombre = "0";
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
|
||||
nombre = db.ProyectoNormativo.Where(r => r.NombreProyectoNormativo.ToString() == model.nombreProyecto.ToLower()).Count().ToString();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
|
||||
}
|
||||
|
||||
return nombre;
|
||||
}
|
||||
public ProyectoNormativoJSON GuardarProyectoNormativo(ProyectoNormativoJSON model)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ namespace AYA.SlnSinortModel.Entidades
|
|||
public PlantillaEmail PlantillaEmail { get; set; }
|
||||
public TareasPendientes TareasPendientes { get; set; }
|
||||
public List<TareasPendientes> ListaTareasPendientes { get; set; }
|
||||
|
||||
public string nombreProyecto { get; set; }
|
||||
}
|
||||
|
||||
//Ficha tecnica
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue