git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C152
This commit is contained in:
parent
f15280d746
commit
1dee17733b
11 changed files with 448 additions and 95 deletions
|
|
@ -292,6 +292,7 @@ namespace AYA.SlnSinort.WCF
|
|||
List<DocumentosAdjuntos> respuesta = null;
|
||||
try
|
||||
{
|
||||
|
||||
respuesta = new DocumentosAdjuntosDAL().ObtenerAdjuntos(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ jQuery(document).ready(function () {
|
|||
$('#tableDocAuxiliares').DataTable().column(3).visible(false);
|
||||
$('#tableDocExpediente').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocExpediente').DataTable().column(3).visible(false);
|
||||
$('#tableDocForo').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocForo').DataTable().column(0).visible(false);
|
||||
$('#tableDocForo').DataTable().column(4).visible(false);
|
||||
$('#tableDocMatriz').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocMatriz').DataTable().column(0).visible(false);
|
||||
$('#tableDocMatriz').DataTable().column(4).visible(false);
|
||||
|
||||
$("#tabs").tabs();
|
||||
|
||||
|
|
@ -70,6 +76,7 @@ this.getDataModel = function () {
|
|||
$("#lblcomentario").text("Comentario");
|
||||
$("#txtAsunto").val('');
|
||||
$("#txtComentario").val('');
|
||||
$('#btnVerAdjuntosForo').prop("disabled", false);
|
||||
EsRespuesta = false;
|
||||
|
||||
$('#modalDiscusion-footer').css("display", "block");
|
||||
|
|
@ -91,8 +98,8 @@ this.getDataModel = function () {
|
|||
$("#txtApartadoMatriz").val('');
|
||||
$("#txtTextoOriginal").val('');
|
||||
$("#txtTextoPropuesto").val('');
|
||||
$('#btnVerAdjuntosMatriz').prop("disabled", false);
|
||||
EsRespuesta = false;
|
||||
|
||||
$('#modalDiscusion-footer').css("display", "block");
|
||||
$('#modalElemento').modal('show');
|
||||
});
|
||||
|
|
@ -173,6 +180,7 @@ this.CargarFormulario = function (data) {
|
|||
$("#divMatriz").css("display", "none");
|
||||
$("#divMatrizCambios").css("display", "none");
|
||||
$("#divComentarios").css("height", "450px");
|
||||
$("#tab3").val("Área de foro");
|
||||
} else {
|
||||
CargarMatriz();
|
||||
}
|
||||
|
|
@ -200,7 +208,7 @@ this.CargarGridUsuarios = function (data) {
|
|||
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
||||
}
|
||||
|
||||
ENDREQUEST();
|
||||
|
||||
}
|
||||
|
||||
this.CargarConvocados = function () {
|
||||
|
|
@ -313,8 +321,15 @@ this.GuardarComentario = function () {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!confirm("Va a ingresar una nueva discusión. ¿Desea continuar?"))
|
||||
{ return; }
|
||||
tableDocForo = $('#tableDocForo').DataTable();
|
||||
var Iddoc;
|
||||
var data = tableDocForo
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
Iddoc = item[0]
|
||||
});
|
||||
|
||||
var uri = SinortWCF + '/api/GuardarComentarioProyectoNormativo';
|
||||
|
||||
|
|
@ -324,7 +339,8 @@ this.GuardarComentario = function () {
|
|||
Comentario: $("#txtComentario").val(),
|
||||
Respuesta: EsRespuesta ? IDComentario : null,
|
||||
IdTipoComentario: Comentarios.Foro.Codigo,
|
||||
DescTipoComentario: Comentarios.Foro.Descripcion
|
||||
DescTipoComentario: Comentarios.Foro.Descripcion,
|
||||
IdDocumento : Iddoc
|
||||
}
|
||||
|
||||
AjaxPostData(uri, model, false, true, ComentarioGuardado, null, null);
|
||||
|
|
@ -340,6 +356,8 @@ this.ComentarioGuardado = function (data) {
|
|||
$("#txtAsunto").val('');
|
||||
$("#txtComentario").val('');
|
||||
$('#modalDiscusion').modal('hide');
|
||||
var tableDocForo = $('#tableDocForo').DataTable();
|
||||
tableDocForo.clear().draw();
|
||||
|
||||
CargarForo();
|
||||
ENDREQUEST();
|
||||
|
|
@ -411,9 +429,11 @@ this.VerDetalleAporte = function (IdComentario,IdTipoComentario) {
|
|||
$("#lblcomentario").text("Comentario");
|
||||
$("#txtAsunto").val(comentario.Asunto);
|
||||
$("#txtComentario").val(comentario.Comentario);
|
||||
|
||||
$('#modalDiscusion-footer').css("display", "none");
|
||||
$('#modalDiscusion').modal('show');
|
||||
$("#txtAsunto").val(comentario.Asunto);
|
||||
$('#btnVerAdjuntosForo').prop("disabled", true);
|
||||
CargarDocumentosForo(comentario.IdDocumento);
|
||||
}
|
||||
|
||||
if (IdTipoComentario == Comentarios.Matriz.Codigo) {
|
||||
|
|
@ -427,6 +447,8 @@ this.VerDetalleAporte = function (IdComentario,IdTipoComentario) {
|
|||
$("#txtTextoPropuesto").val(comentario.TextoPropuesto);
|
||||
$('#modalElemento-footer').css("display", "none");
|
||||
$('#modalElemento').modal('show');
|
||||
$('#btnVerAdjuntosMatriz').prop("disabled", true);
|
||||
CargarDocumentosMatriz(comentario.IdDocumento);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -470,7 +492,16 @@ this.GuardarComentarioMatriz = function () {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!confirm("Va a ingresar un nuevo elemento. ¿Desea continuar?")) return;
|
||||
tableDocMatriz = $('#tableDocMatriz').DataTable();
|
||||
var Iddoc;
|
||||
var data = tableDocMatriz
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
$.each(data, function (key, item) {
|
||||
Iddoc = item[0]
|
||||
});
|
||||
|
||||
|
||||
var uri = SinortWCF + '/api/GuardarComentarioProyectoNormativo';
|
||||
|
||||
|
|
@ -484,7 +515,8 @@ this.GuardarComentarioMatriz = function () {
|
|||
Comentario: $("#txtComentarioMatriz").val(),
|
||||
Respuesta: EsRespuesta ? IDComentario : null,
|
||||
IdTipoComentario: Comentarios.Matriz.Codigo,
|
||||
DescTipoComentario: Comentarios.Matriz.Descripcion
|
||||
DescTipoComentario: Comentarios.Matriz.Descripcion,
|
||||
IdDocumento : Iddoc
|
||||
}
|
||||
|
||||
AjaxPostData(uri, model, false, true, ComentarioMatrizGuardado, null, null);
|
||||
|
|
@ -505,7 +537,8 @@ this.ComentarioMatrizGuardado = function (data) {
|
|||
$("#txtTextoPropuesto").val('');
|
||||
|
||||
$('#modalElemento').modal('hide');
|
||||
|
||||
var tableDocMatriz = $('#tableDocMatriz').DataTable();
|
||||
tableDocMatriz.clear().draw();
|
||||
CargarMatriz();
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
|
@ -558,14 +591,19 @@ $('#tableUsuarios').on('click', 'button', function () {
|
|||
//Documentos Auxiliares
|
||||
|
||||
this.CargarDocumentosAuxiliares = function () {
|
||||
|
||||
var AdjuntosAux = {
|
||||
IdTipoDocumento: 1,
|
||||
IdSubTipoDocumento: 3,
|
||||
NumeroTipoDocumento: model.ProyectoNormativo.IdProyectoNormativo
|
||||
}
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
var model = {
|
||||
IdTipoDocumento: 1,
|
||||
IdSubTipoDocumento: 3
|
||||
|
||||
var modeldoc = {
|
||||
Adjuntos: AdjuntosAux
|
||||
|
||||
};
|
||||
|
||||
AjaxPostData(uri, model, false, false, CargarTablaDocumentosAuxiliares, null, null);
|
||||
AjaxPostData(uri, modeldoc, false, false, CargarTablaDocumentosAuxiliares, null, null);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -623,17 +661,23 @@ $('#tableDocAuxiliares').on('click', 'button', function () {
|
|||
|
||||
});
|
||||
|
||||
//Expediente
|
||||
|
||||
// Documentos Expediente
|
||||
|
||||
this.CargarDocumentosExpediente = function () {
|
||||
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
var model = {
|
||||
var AdjuntosExp = {
|
||||
IdTipoDocumento: 1,
|
||||
IdSubTipoDocumento: 4
|
||||
IdSubTipoDocumento: 4,
|
||||
NumeroTipoDocumento: model.ProyectoNormativo.IdProyectoNormativo
|
||||
}
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
|
||||
var modeldoc = {
|
||||
Adjuntos: AdjuntosExp
|
||||
|
||||
};
|
||||
|
||||
AjaxPostData(uri, model, false, false, CargarTablaDocumentosExpediente, null, null);
|
||||
AjaxPostData(uri, modeldoc, false, false, CargarTablaDocumentosExpediente, null, null);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -691,23 +735,174 @@ $('#tableDocExpediente').on('click', 'button', function () {
|
|||
|
||||
});
|
||||
|
||||
//Documentos Foro
|
||||
|
||||
this.CargarDocumentosForo = function (id) {
|
||||
|
||||
var tableDocForo = $('#tableDocForo').DataTable();
|
||||
tableDocForo.clear().draw();
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
|
||||
var modeldoc = {
|
||||
IdDocumentoAdjunto: id
|
||||
|
||||
};
|
||||
|
||||
AjaxPostData(uri, modeldoc, false, false, CargarTablaDocumentosForo, null, null);
|
||||
|
||||
}
|
||||
|
||||
this.CargarTablaDocumentosForo = function (data) {
|
||||
|
||||
var tableDocForo = $('#tableDocForo').DataTable();
|
||||
tableDocForo.clear().draw();
|
||||
var lista = data;
|
||||
|
||||
$.each(lista, function (key, item) {
|
||||
|
||||
|
||||
var option = $("#ucAbrirDocumento").html();
|
||||
var ext = item.TipoArchivo.toLowerCase();
|
||||
switch (ext) {
|
||||
case 'pdf':
|
||||
option = replaceAll("[$icon]", "fa-file-pdf-o", option);
|
||||
break;
|
||||
case 'doc':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'docx':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'png':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'jpg':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'xls':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
case 'xlsx':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
default:
|
||||
option = replaceAll("[$icon]", "fa-file-text", option);
|
||||
}
|
||||
|
||||
tableDocForo.row.add([item.IdDocumentoAdjunto,
|
||||
option,
|
||||
item.Nombre,
|
||||
item.UsuarioCreacion,
|
||||
item.RutaDescarga]).draw();
|
||||
|
||||
});
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
$('#tableDocForo').on('click', 'button', function () {
|
||||
|
||||
var data = $('#tableDocForo').DataTable().row($(this).parents('tr')).data();
|
||||
|
||||
window.open(data[4]);
|
||||
|
||||
});
|
||||
|
||||
//Documentos Matriz
|
||||
|
||||
this.CargarDocumentosMatriz = function (id) {
|
||||
|
||||
var tableDocMatriz = $('#tableDocMatriz').DataTable();
|
||||
tableDocMatriz.clear().draw();
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
|
||||
var modeldoc = {
|
||||
IdDocumentoAdjunto: id
|
||||
|
||||
};
|
||||
|
||||
AjaxPostData(uri, modeldoc, false, false, CargarTablaDocumentosMatriz, null, null);
|
||||
|
||||
}
|
||||
|
||||
this.CargarTablaDocumentosMatriz = function (data) {
|
||||
|
||||
var tableDocMatriz = $('#tableDocMatriz').DataTable();
|
||||
tableDocMatriz.clear().draw();
|
||||
var lista = data;
|
||||
|
||||
$.each(lista, function (key, item) {
|
||||
|
||||
|
||||
var option = $("#ucAbrirDocumento").html();
|
||||
var ext = item.TipoArchivo.toLowerCase();
|
||||
switch (ext) {
|
||||
case 'pdf':
|
||||
option = replaceAll("[$icon]", "fa-file-pdf-o", option);
|
||||
break;
|
||||
case 'doc':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'docx':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'png':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'jpg':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'xls':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
case 'xlsx':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
default:
|
||||
option = replaceAll("[$icon]", "fa-file-text", option);
|
||||
}
|
||||
|
||||
tableDocMatriz.row.add([item.IdDocumentoAdjunto,
|
||||
option,
|
||||
item.Nombre,
|
||||
item.UsuarioCreacion,
|
||||
item.RutaDescarga]).draw();
|
||||
|
||||
});
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
$('#tableDocMatriz').on('click', 'button', function () {
|
||||
|
||||
var data = $('#tableDocMatriz').DataTable().row($(this).parents('tr')).data();
|
||||
|
||||
window.open(data[4]);
|
||||
|
||||
});
|
||||
|
||||
this.AbrirAdjuntos = function (id) {
|
||||
$('#hiddenSubTipoDocumento').val(id);
|
||||
|
||||
|
||||
switch (id) {
|
||||
case 1:
|
||||
SubTipoproyecto = SubDocumento.Matriz.Descripcion;
|
||||
$('#divEnviarDocAux').show();
|
||||
break;
|
||||
case 2:
|
||||
SubTipoproyecto = SubDocumento.Foro.Descripcion;
|
||||
$('#divEnviarDocAux').show();
|
||||
break;
|
||||
case 3:
|
||||
SubTipoproyecto = SubDocumento.DocumentoAuxiliar.Descripcion;
|
||||
$('#divEnviarDocAux').hide();
|
||||
break;
|
||||
case 4:
|
||||
SubTipoproyecto = SubDocumento.Expediente.Descripcion;
|
||||
$('#divEnviarDocAux').hide();
|
||||
break;
|
||||
case 4:
|
||||
SubTipoproyecto = SubDocumento.Calendario.Descripcion;
|
||||
$('#divEnviarDocAux').hide();
|
||||
break;
|
||||
}
|
||||
if (EsForo) {
|
||||
|
|
@ -718,16 +913,30 @@ this.AbrirAdjuntos = function (id) {
|
|||
ActulalizarUpload();
|
||||
$('#modalDocumentosAuxiliares').modal('show');
|
||||
}
|
||||
$('#cboxDocAux').change(function () {
|
||||
|
||||
var cheched = $("#cboxDocAux").prop("checked") ? true : false
|
||||
if ($('#hiddenSubTipoDocumento').val() == 1) {
|
||||
SubTipoproyecto = cheched == true ? SubDocumento.DocumentoAuxiliar.Descripcion : SubDocumento.Matriz.Descripcion
|
||||
}
|
||||
if ($('#hiddenSubTipoDocumento').val() == 2) {
|
||||
SubTipoproyecto = cheched == true ? SubDocumento.DocumentoAuxiliar.Descripcion : SubDocumento.Foro.Descripcion
|
||||
}
|
||||
|
||||
ActulalizarUpload();
|
||||
});
|
||||
this.GuardarAdjuntos= function (nombre) {
|
||||
|
||||
if (!confirm("Va a ingresar un documento auxiliar .\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
||||
var uri = SinortWCF + '/api/GuardarAdjuntos';
|
||||
var ruta;
|
||||
var Idetipoproyecto;
|
||||
var DesTipoProyecto;
|
||||
var cheched = $("#cboxDocAux").prop("checked") ? true : false
|
||||
var IdSubTipoDocumento = $('#hiddenSubTipoDocumento').val();
|
||||
if (IdSubTipoDocumento == 1 || IdSubTipoDocumento == 2) {
|
||||
SubTipoproyecto = cheched == true ? SubDocumento.DocumentoAuxiliar.Descripcion : SubTipoproyecto;
|
||||
IdSubTipoDocumento = cheched == true ? 3 : IdSubTipoDocumento;
|
||||
}
|
||||
if (EsForo) {
|
||||
Idetipoproyecto = Proyectos.Foro.Codigo;
|
||||
DesTipoProyecto = Proyectos.Foro.Descripcion;
|
||||
|
|
@ -757,10 +966,74 @@ this.GuardarAdjuntos= function (nombre) {
|
|||
|
||||
model.Adjuntos = AdjuntosDocumentosAuxiliar;
|
||||
|
||||
AjaxPostData(uri, model, false, true, null, null, null);
|
||||
AjaxPostData(uri, model, true, false, CargarGridComentario, null, null);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
this.CargarGridComentario = function (data) {
|
||||
|
||||
var tipo = $('#hiddenSubTipoDocumento').val();
|
||||
var lista = data.Adjuntos;
|
||||
|
||||
var option = $("#ucAbrirDocumento").html();
|
||||
var ext = lista.TipoArchivo.toLowerCase();
|
||||
switch (ext) {
|
||||
case 'pdf':
|
||||
option = replaceAll("[$icon]", "fa-file-pdf-o", option);
|
||||
break;
|
||||
case 'doc':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'docx':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'png':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'jpg':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'xls':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
case 'xlsx':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
default:
|
||||
option = replaceAll("[$icon]", "fa-file-text", option);
|
||||
}
|
||||
|
||||
switch (tipo) {
|
||||
case "1":
|
||||
var tableDocMatriz = $('#tableDocMatriz').DataTable();
|
||||
tableDocMatriz.clear().draw();
|
||||
tableDocMatriz.row.add([lista.IdDocumentoAdjunto,
|
||||
option,
|
||||
lista.Nombre,
|
||||
lista.UsuarioCreacion,
|
||||
lista.RutaDescarga]).draw();
|
||||
|
||||
$('#btnVerAdjuntosMatriz').prop("disabled", true);
|
||||
break;
|
||||
case "2":
|
||||
var tableDocForo = $('#tableDocForo').DataTable();
|
||||
tableDocForo.clear().draw();
|
||||
tableDocForo.row.add([lista.IdDocumentoAdjunto,
|
||||
option,
|
||||
lista.Nombre,
|
||||
lista.UsuarioCreacion,
|
||||
lista.RutaDescarga]).draw();
|
||||
|
||||
$('#btnVerAdjuntosForo').prop("disabled", true);
|
||||
break;
|
||||
default :
|
||||
CargarDocumentosAuxiliares();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function ActulalizarUpload() {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ jQuery(document).ready(function () {
|
|||
getDataModel();
|
||||
|
||||
|
||||
|
||||
Adjuntos
|
||||
});
|
||||
|
||||
//#endregion
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<form id="formSitios" class="form-horizontal" role="form">
|
||||
|
||||
<div class="panel-body"> <h3> <i class="fa fa-list-ul"></i> Sitios </h3> </div>
|
||||
<div class="panel-body"> <h3> <i class="fa fa-list-ul"></i> Proyectos y foros </h3> </div>
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-body">
|
||||
<br />
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<div id="ucbtnVista" style=" display:none;">
|
||||
<button type="button" id="btnseleccionar" class="btn btn-default btn-xs">
|
||||
<i class="fa fa-search"></i> Mostrar Detalle
|
||||
<i class="fa fa-search"></i> Ingresar
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<ul>
|
||||
<li><a href="#tabs-1">Información General</a></li>
|
||||
<li><a href="#tabs-2">Usuarios</a></li>
|
||||
<li><a href="#tabs-3">Área de proyecto</a></li>
|
||||
<li><a href="#tabs-3" id="tab3">Área de proyecto</a></li>
|
||||
<li><a href="#tabs-4">Expediente</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
|
|
@ -209,18 +209,20 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
<table id="tableDocAuxiliares" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1"></th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
<th class="col-sm-4">Creado por</th>
|
||||
<th></th>
|
||||
<div class="col-sm-12">
|
||||
<table id="tableDocAuxiliares" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1"></th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
<th class="col-sm-4">Creado por</th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -411,7 +413,7 @@
|
|||
@section Modals{
|
||||
|
||||
@*---------------------Adjuntar documentos ---------------------------------------------------------*@
|
||||
<div class="modal fade" id="modalDocumentosAuxiliares" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;">
|
||||
<div class="modal fade" id="modalDocumentosAuxiliares" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;z-index:1600;">
|
||||
<div class="modal-dialog modal-lg" style="width:40%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
|
@ -436,6 +438,13 @@
|
|||
<textarea name="txtComentarioDocAux" rows="5" cols="45" id="txtComentarioDocAux" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@*---------------------Doc Auxiliar ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divEnviarDocAux">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblEnviarDocAux">Documento Auxiliar</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<input type="checkbox" id="cboxDocAux">
|
||||
</div>
|
||||
</div>
|
||||
@*---------------------Adjuntar ---------------------------------------------------------*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ControlsForms">Buscar</label>
|
||||
|
|
@ -454,12 +463,13 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer" id="modalDiscusion-footer">
|
||||
<div class="modal-footer" id="modalAfjuntos-footer">
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
|
|
@ -528,6 +538,29 @@
|
|||
<textarea name="txtComentario" rows="8" cols="45" id="txtComentario" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@*--------------------- Adjuntar ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divAbrirDocForo">
|
||||
<label class="col-sm-4 control-label ControlsForms">Adjuntar</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<button type="button" id="btnVerAdjuntosForo" class="btn btn-success btn-medium btn-margin-catalogo" onclick="javascript: AbrirAdjuntos(2)">
|
||||
<i class=" fa fa-paperclip"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table id="tableDocForo" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="col-sm-1"></th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
<th class="col-sm-4">Creado por</th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,66 +611,100 @@
|
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title"> <i class="fa fa-comment-o"></i> Agregar Elemento </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="formElemento">
|
||||
@*---------------------Asunto ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divAsuntoMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblAsunto">Asunto</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input name="txtAsuntoMatriz" class="form-control imput-xs" id="txtAsuntoMatriz" type="text" />
|
||||
<div class="col-md-12" style="overflow-y: scroll; height:450px;" id="divMatrizForm">
|
||||
<div class="modal-body">
|
||||
|
||||
<form id="formElemento">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@*---------------------Asunto ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divAsuntoMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblAsunto">Asunto</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input name="txtAsuntoMatriz" class="form-control imput-xs" id="txtAsuntoMatriz" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*---------------------Capitulo ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divCapituloMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblAsunto">Capítulo</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input name="txtCapituloMatriz" class="form-control imput-xs" id="txtCapituloMatriz" type="text" />
|
||||
@*---------------------Capitulo ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divCapituloMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblAsunto">Capítulo</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input name="txtCapituloMatriz" class="form-control imput-xs" id="txtCapituloMatriz" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*---------------------Apartado ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divApartadoMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblAsunto">Apartado</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input name="txtApartadoMatriz" class="form-control imput-xs" id="txtApartadoMatriz" type="text" />
|
||||
@*---------------------Apartado ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divApartadoMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblAsunto">Apartado</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input name="txtApartadoMatriz" class="form-control imput-xs" id="txtApartadoMatriz" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group " id="divRespuestaMatriz">
|
||||
<div class="form-group " id="divRespuestaMatriz">
|
||||
|
||||
</div>
|
||||
|
||||
@*--------------------- Original ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divTextoOriginal">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblcomentario">Texto Original</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtTextoOriginal" rows="5" cols="45" id="txtTextoOriginal" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*--------------------- Propuesto ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divTextoPropuesto">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblcomentario">Texto Propuesto</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtTextoPropuesto" rows="5" cols="45" id="txtTextoPropuesto" style="resize: none"></textarea>
|
||||
@*--------------------- Original ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divTextoOriginal">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblcomentario">Texto Original</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtTextoOriginal" rows="5" cols="45" id="txtTextoOriginal" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*--------------------- Comentario ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divComentarioMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblComentarioMatriz">Comentario</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtComentarioMatriz" rows="5" cols="45" id="txtComentarioMatriz" style="resize: none"></textarea>
|
||||
@*--------------------- Propuesto ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divTextoPropuesto">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblcomentario">Texto Propuesto</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtTextoPropuesto" rows="5" cols="45" id="txtTextoPropuesto" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@*--------------------- Comentario ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divComentarioMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblComentarioMatriz">Comentario</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtComentarioMatriz" rows="5" cols="45" id="txtComentarioMatriz" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group " id="divAbrirDocMatriz">
|
||||
<label class="col-sm-4 control-label ControlsForms">Adjuntar</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<button type="button" id="btnVerAdjuntosMatriz" class="btn btn-success btn-medium btn-margin-catalogo" onclick="javascript: AbrirAdjuntos(1)">
|
||||
<i class=" fa fa-paperclip"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table id="tableDocMatriz" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="col-sm-1"></th>
|
||||
<th class="col-sm-4">Nombre</th>
|
||||
<th class="col-sm-4">Creado por</th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer" id="modalElemento-footer">
|
||||
<button type="button" id="btnGuardarComentarioMatriz" class="btn btn-success btn-sm" data-dismiss="modal">Aceptar</button>
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -50,15 +50,24 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
public List<DocumentosAdjuntos> ObtenerAdjuntos(AdjuntosJSON model)
|
||||
{
|
||||
List<DocumentosAdjuntos> registros = null;
|
||||
|
||||
DocumentosAdjuntos Actual = new DocumentosAdjuntos();
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
Actual = db.DocumentosAdjuntos.Where(x => x.IdDocumentoAdjunto == model.IdDocumentoAdjunto).FirstOrDefault();
|
||||
|
||||
registros = db.DocumentosAdjuntos.Where(r => r.IdTipoDocumento == model.IdTipoDocumento && r.IdSubTipoDocumento == model.IdSubTipoDocumento ).OrderBy(r => r.IdDocumentoAdjunto).ToList();
|
||||
if (Actual == null)
|
||||
{
|
||||
registros = db.DocumentosAdjuntos.Where(r => r.IdTipoDocumento == model.Adjuntos.IdTipoDocumento && r.IdSubTipoDocumento == model.Adjuntos.IdSubTipoDocumento && r.NumeroTipoDocumento == model.Adjuntos.NumeroTipoDocumento).OrderBy(r => r.IdDocumentoAdjunto).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
registros = db.DocumentosAdjuntos.Where(r => r.IdDocumentoAdjunto == model.IdDocumentoAdjunto).OrderBy(r => r.IdDocumentoAdjunto).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,7 @@ namespace AYA.SlnSinortModel.Entidades
|
|||
public string Tipo { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Carpeta { get; set; }
|
||||
public int IdTipoDocumento { get; set; }
|
||||
public int IdSubTipoDocumento { get; set; }
|
||||
|
||||
public int? IdDocumentoAdjunto { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
[StringLength(200)]
|
||||
public string UsuarioModificacion { get; set; }
|
||||
|
||||
public virtual Documentos Documentos { get; set; }
|
||||
public virtual DocumentosAdjuntos DocumentosAdjuntos { get; set; }
|
||||
|
||||
public virtual ProyectoNormativo ProyectoNormativo { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
public Documentos()
|
||||
{
|
||||
BitacoraDocumentos = new HashSet<BitacoraDocumentos>();
|
||||
ComentariosProyecto = new HashSet<ComentariosProyecto>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
|
|
@ -39,8 +38,5 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<BitacoraDocumentos> BitacoraDocumentos { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<ComentariosProyecto> ComentariosProyecto { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
public DocumentosAdjuntos()
|
||||
{
|
||||
BitacoraDocumentos = new HashSet<BitacoraDocumentos>();
|
||||
ComentariosProyecto = new HashSet<ComentariosProyecto>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
|
|
@ -62,5 +63,8 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<BitacoraDocumentos> BitacoraDocumentos { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<ComentariosProyecto> ComentariosProyecto { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
|
||||
public partial class SinortContex : Contex
|
||||
{
|
||||
|
||||
|
||||
|
||||
public virtual DbSet<Aplicacion> Aplicacion { get; set; }
|
||||
public virtual DbSet<Categoria> Categoria { get; set; }
|
||||
|
|
@ -430,6 +430,11 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
.Property(e => e.UsuarioModificacion)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<DocumentosAdjuntos>()
|
||||
.HasMany(e => e.ComentariosProyecto)
|
||||
.WithOptional(e => e.DocumentosAdjuntos)
|
||||
.HasForeignKey(e => e.IdDocumento);
|
||||
|
||||
modelBuilder.Entity<Calendario>()
|
||||
.Property(e => e.Titulo)
|
||||
.IsUnicode(false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue