git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C148
This commit is contained in:
parent
55ef4e357e
commit
a0593066cf
18 changed files with 516 additions and 24 deletions
|
|
@ -32,8 +32,15 @@ namespace AYA.SlnSinort.WCF
|
|||
|
||||
//[OperationContract]
|
||||
//ProyectoNormativoJSON EliminarConvocatoriaProyectoNormativo(ProyectoNormativoJSON model);
|
||||
|
||||
#region Adjuntos
|
||||
[OperationContract]
|
||||
AdjuntosJSON RemoverAdjunto(AdjuntosJSON model);
|
||||
|
||||
[OperationContract]
|
||||
AdjuntosJSON GuardarAdjuntos(AdjuntosJSON model);
|
||||
|
||||
[OperationContract]
|
||||
List<DocumentosAdjuntos> ObtenerAdjuntos(AdjuntosJSON model);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,6 +231,33 @@ namespace AYA.SlnSinort.WCF
|
|||
|
||||
#region Adjuntos
|
||||
|
||||
public AdjuntosJSON GuardarAdjuntos(AdjuntosJSON model)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var documentosDAL = new DocumentosAdjuntosDAL();
|
||||
if (model.Adjuntos == null)
|
||||
{
|
||||
model.CodigoRespuesta = EnumTipoCodigoRespuesta.ADVERTENCIA;
|
||||
model.DescripcionRespuesta = "No se encontraron datos del documento ";
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
documentosDAL.GuardarAdjuntos(model);
|
||||
model.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
model.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR;
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public AdjuntosJSON RemoverAdjunto(AdjuntosJSON model)
|
||||
{
|
||||
|
||||
|
|
@ -257,6 +284,22 @@ namespace AYA.SlnSinort.WCF
|
|||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<DocumentosAdjuntos> ObtenerAdjuntos(AdjuntosJSON model)
|
||||
{
|
||||
List<DocumentosAdjuntos> respuesta = null;
|
||||
try
|
||||
{
|
||||
respuesta = new DocumentosAdjuntosDAL().ObtenerAdjuntos(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
return respuesta;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,12 +21,16 @@ namespace AYA.SlnSinort.Controllers
|
|||
//parametros.GetValueKeyRegedit("SinortWCF", false);
|
||||
var SinortCatalogosWCF = "http://localhost/AYA.SlnSinort.WCF/SinortCatalogos.svc";
|
||||
//parametros.GetValueKeyRegedit("SinortCatalogosWCF",false);
|
||||
var Adjuntos = "http://localhost/AYA.SlnSinort/FileUploadHandler";
|
||||
var FileUploadHandler = "http://localhost/AYA.SlnSinort/FileUploadHandler";
|
||||
var RepositorioVirtual = ConfigurationManager.AppSettings["HttpRepository"].ToString();
|
||||
var RepositorioLocal = ConfigurationManager.AppSettings["FileRepository"].ToString();
|
||||
|
||||
ViewBag.SinortWCF = SinortWCF;
|
||||
ViewBag.SinortCatalogosWCF = SinortCatalogosWCF;
|
||||
ViewBag.AtesaUser = User.Identity.GetUserName();
|
||||
ViewBag.AdjuntosDoc = Adjuntos;
|
||||
ViewBag.FileUploadHandler = FileUploadHandler;
|
||||
ViewBag.RepositorioVirtual = RepositorioVirtual;
|
||||
ViewBag.RepositorioLocal = RepositorioLocal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@ namespace webAgenciaVirtual
|
|||
string pathrefer = context.Request.UrlReferrer.ToString();
|
||||
//string Serverpath = HttpContext.Current.Server.MapPath("DocumentosSINORT");
|
||||
string Serverpath = ConfigurationManager.AppSettings["FileRepository"].ToString();
|
||||
Serverpath += context.Request.QueryString["carpeta"].ToString();
|
||||
Serverpath += context.Request.QueryString["tipo"].ToString() + "\\" + context.Request.QueryString["id"].ToString() + "\\" + context.Request.QueryString["carpeta"].ToString();
|
||||
|
||||
var postedFile = context.Request.Files[0];
|
||||
string ext = Path.GetExtension(postedFile.FileName);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
var CatalogosWCF = $("#hiddenSinortCatalogosWCF").val();
|
||||
var SinortWCF = $("#hiddenSinortWCF").val();
|
||||
var AdjuntosDoc = $("#hiddenAdjuntos").val();
|
||||
var FileUploadHandler = $("#hiddenFileUploadHandler").val();
|
||||
var RepositorioVirtual = $("#hiddenRepositorioVirtual").val();
|
||||
var RepositorioLocal = $("#hiddenRepositorioLocal").val();
|
||||
var server = window.location.protocol + "//" + window.location.hostname + "/" + (window.location.pathname.split('/')[1]) + "/";
|
||||
var string_empty = "";
|
||||
var Atesa = {};
|
||||
|
|
@ -41,6 +43,12 @@ var Comentarios = {
|
|||
Foro: { Codigo: 1, Descripcion: "Comentario Foro" },
|
||||
Matriz: { Codigo: 2, Descripcion: "Comentario Matriz" }
|
||||
};
|
||||
var SubDocumento = {
|
||||
Matriz: { Codigo: 1, Descripcion: "Matriz" },
|
||||
Foro: { Codigo: 2, Descripcion: "Foro" },
|
||||
DocumentoAuxiliar: { Codigo: 3, Descripcion: "Documento Auxiliar" },
|
||||
Expediente: { Codigo: 4, Descripcion: "Expediente" }
|
||||
};
|
||||
//
|
||||
|
||||
//#region MOMENT CONFIGURATION (DATE AND TIME CONFIGURATION)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ var model = {};
|
|||
var EsRespuesta = false;
|
||||
var IDComentario = 0;
|
||||
var EsForo = false;
|
||||
var NombreDocumento;
|
||||
|
||||
var DescTipoproyecto;
|
||||
var SubTipoproyecto;
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
|
|
@ -13,6 +17,8 @@ jQuery(document).ready(function () {
|
|||
$('#tableDocAuxiliares').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableForo').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableMatriz').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocAuxiliares').TableInit(0, false, false, false, false, null, null);
|
||||
$('#tableDocAuxiliares').DataTable().column(3).visible(false);
|
||||
|
||||
$("#tabs").tabs();
|
||||
|
||||
|
|
@ -158,7 +164,7 @@ this.CargarFormulario = function (data) {
|
|||
|
||||
CargarConvocados();
|
||||
CargarForo();
|
||||
|
||||
|
||||
if (EsForo) {
|
||||
$("#divEmisor").css("display", "none");
|
||||
$("#divAplicacion").css("display", "none");
|
||||
|
|
@ -168,7 +174,7 @@ this.CargarFormulario = function (data) {
|
|||
} else {
|
||||
CargarMatriz();
|
||||
}
|
||||
|
||||
CargarDocumentosAuxiliares();
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
|
|
@ -545,3 +551,183 @@ $('#tableUsuarios').on('click', 'button', function () {
|
|||
$('#modalUsuarios').modal('hide');
|
||||
|
||||
});
|
||||
|
||||
//Documentos Auxiliares
|
||||
|
||||
this.AbrirAdjuntos = function (id) {
|
||||
$('#hiddenSubTipoDocumento').val(id);
|
||||
switch (id) {
|
||||
case 1:
|
||||
SubTipoproyecto = SubDocumento.Matriz.Descripcion;
|
||||
break;
|
||||
case 2:
|
||||
SubTipoproyecto = SubDocumento.Foro.Descripcion;
|
||||
break;
|
||||
case 3:
|
||||
SubTipoproyecto = SubDocumento.DocumentoAuxiliar.Descripcion;
|
||||
break;
|
||||
case 4:
|
||||
SubTipoproyecto = SubDocumento.Expediente.Descripcion;
|
||||
break;
|
||||
}
|
||||
if (EsForo) {
|
||||
DescTipoproyecto = Proyectos.Foro.Descripcion;
|
||||
} else {
|
||||
DescTipoproyecto = Proyectos.PropuestaNormativa.Descripcion;
|
||||
}
|
||||
ActulalizarUpload();
|
||||
$('#modalDocumentosAuxiliares').modal('show');
|
||||
}
|
||||
|
||||
this.GuardarAdjuntos= function (nombre) {
|
||||
|
||||
if (!confirm("Va a ingresar un documento auxiliar .\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
||||
var uri = SinortWCF + '/api/GuardarAdjuntos';
|
||||
var ruta;
|
||||
var tipoproyecto;
|
||||
if (EsForo) {
|
||||
tipoproyecto = Proyectos.Foro.Codigo;
|
||||
ruta = Proyectos.Foro.Descripcion + '\\' + model.ProyectoNormativo.IdProyectoNormativo + '\\' + SubTipoproyecto + '\\' + nombre;
|
||||
} else {
|
||||
tipoproyecto = Proyectos.PropuestaNormativa.Codigo;
|
||||
ruta = Proyectos.PropuestaNormativa.Descripcion + '\\' + model.ProyectoNormativo.IdProyectoNormativo + '\\' + SubTipoproyecto + '\\' + nombre;
|
||||
}
|
||||
var Arraynombre = [];
|
||||
Arraynombre = nombre.split(".");
|
||||
|
||||
|
||||
var AdjuntosDocumentosAuxiliar
|
||||
= {
|
||||
Nombre: $("#txtDescripcionDocAux").val(),
|
||||
IdTipoDocumento: tipoproyecto,
|
||||
NumeroTipoDocumento: model.ProyectoNormativo.IdProyectoNormativo,
|
||||
IdSubTipoDocumento: $('#hiddenSubTipoDocumento').val(),
|
||||
RutaFisica: RepositorioLocal + ruta,
|
||||
RutaDescarga : RepositorioVirtual + ruta,
|
||||
TipoArchivo: Arraynombre.pop()
|
||||
}
|
||||
|
||||
model.Adjuntos = AdjuntosDocumentosAuxiliar;
|
||||
|
||||
AjaxPostData(uri, model, false, true, null, null, null);
|
||||
|
||||
}
|
||||
|
||||
this.CargarDocumentosAuxiliares = function () {
|
||||
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
var model = {
|
||||
IdTipoDocumento: 1,
|
||||
IdSubTipoDocumento : 3
|
||||
};
|
||||
|
||||
AjaxPostData(uri, model, false, false, CargarTablaDocumentosAuxiliares, null, null);
|
||||
|
||||
}
|
||||
|
||||
this.CargarTablaDocumentosAuxiliares = function (data) {
|
||||
|
||||
var tableDocAuxiliares = $('#tableDocAuxiliares').DataTable();
|
||||
tableDocAuxiliares.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);
|
||||
}
|
||||
|
||||
tableDocAuxiliares.row.add([option,
|
||||
item.Nombre,
|
||||
item.UsuarioCreacion,
|
||||
item.RutaDescarga]).draw();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$('#tableDocAuxiliares').on('click', 'button', function () {
|
||||
|
||||
var data = $('#tableDocAuxiliares').DataTable().row($(this).parents('tr')).data();
|
||||
|
||||
window.open(data[3]);
|
||||
|
||||
});
|
||||
function ActulalizarUpload() {
|
||||
|
||||
|
||||
$('#fileupload').fileupload({
|
||||
|
||||
url: FileUploadHandler + '/FileUploadHandler.ashx?tipo=' + DescTipoproyecto + '&id=' + model.ProyectoNormativo.IdProyectoNormativo + '&carpeta=' + SubTipoproyecto,
|
||||
type: 'POST',
|
||||
|
||||
add: function (e, data) {
|
||||
|
||||
data.submit();
|
||||
},
|
||||
progress: function (e, data) {
|
||||
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||
$('#progress .progress-bar').css(
|
||||
'width',
|
||||
progress + '%'
|
||||
);
|
||||
|
||||
var tableAdjuntos = $('#tableAdjuntos').DataTable();
|
||||
|
||||
$.each(data.files, function (index, file) {
|
||||
|
||||
NombreDocumento = file.name;
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
success: function (response, status) {
|
||||
|
||||
GuardarAdjuntos(NombreDocumento);
|
||||
$('#progress .progress-bar').css(
|
||||
'width', '0%');
|
||||
ENDREQUEST();
|
||||
|
||||
},
|
||||
|
||||
error: function (error) {
|
||||
|
||||
if (error.status = "200") {
|
||||
|
||||
$('#progress .progress-bar').css(
|
||||
'width', '0%');
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
|
@ -571,8 +571,9 @@ this.AbrirAdjuntos = function () {
|
|||
|
||||
this.AbrirDocumento = function (value) {
|
||||
|
||||
window.open('http://localhost/AYA.SlnSinort/DocumentosSINORT/1/Captura.PNG');
|
||||
|
||||
var url = Repositorio + 'PropuestaNormativa/1/DocumentosAuxiliares/' + value;
|
||||
window.open(url);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -580,7 +581,7 @@ $(function () {
|
|||
|
||||
$('#fileupload').fileupload({
|
||||
|
||||
url: AdjuntosDoc + '/FileUploadHandler.ashx?carpeta=1',
|
||||
url: FileUploadHandler + '/FileUploadHandler.ashx?tipo=PropuestaNormativa&id=1&carpeta=DocumentosAuxiliares',
|
||||
type: 'POST',
|
||||
add: function (e, data) {
|
||||
|
||||
|
|
@ -603,7 +604,7 @@ $(function () {
|
|||
var optionRemover = $("#ucbtnRemoverAdjuntos").html();
|
||||
|
||||
tableAdjuntos.row.add(
|
||||
[file.name,
|
||||
[location.hre =file.name,
|
||||
optionVer,
|
||||
optionRemover])
|
||||
.draw();
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
<form id="formDetallePropuesta" class="form-horizontal" role="form">
|
||||
@*<div class="panel-body" id="divDescripcion"> <h3> <i class="fa fa-briefcase"></i> [$Propuesta] </h3> </div>*@
|
||||
<div class="panel panel-success">
|
||||
|
||||
<input id="hiddenSubTipoDocumento" type="hidden">
|
||||
<div class="panel-body">
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">Información General</a></li>
|
||||
<li><a href="#tabs-2">Usuarios</a></li>
|
||||
<li><a href="#tabs-3">Discusiones</a></li>
|
||||
<li><a href="#tabs-3">Área de proyecto</a></li>
|
||||
<li><a href="#tabs-4">Expediente</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
|
|
@ -197,16 +197,34 @@
|
|||
<i class="fa fa fa-folder-open-o"></i> <label id="lbTituloAccion">Documentos Auxliares</label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body" style="height: 250px;">
|
||||
<div class="panel-body" style="height: 300px;">
|
||||
|
||||
<div class="form-group " id="divAbrirDocAux">
|
||||
<label class="col-sm-4 control-label ControlsForms">Adjuntar</label>
|
||||
<div class="col-sm-8">
|
||||
<button type="button" id="btnVerAdjuntos" class="btn btn-success btn-medium btn-margin-catalogo" onclick="javascript: AbrirAdjuntos(3)">
|
||||
<i class=" fa fa-paperclip"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<table id="tableDocAuxiliares" class="display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-8">Nombre</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>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -257,6 +275,14 @@
|
|||
</form>
|
||||
|
||||
@* PLANTILLAS *@
|
||||
<div id="ucAbrirDocumento" style="display:none;">
|
||||
<span>
|
||||
<button type="button" id="btnAbrirAdjuntos" class="btn btn-default btn-xs">
|
||||
<i class="fa [$icon]"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="ucBtnSeleccionarCatalogo" style="display:none;">
|
||||
<button type="button" id="btnSeleccionarCatalogo" class="btn btn-default btn-xs">
|
||||
<i id="ibtnSeleccionarCatalogo" class="fa fa-check"></i>
|
||||
|
|
@ -339,6 +365,63 @@
|
|||
|
||||
@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-dialog modal-lg" style="width:40%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Documentos</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
@*---------------------Descripción ---------------------------------------------------------*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblDescDocAux">Descripción</label>
|
||||
<div class="input-group input-group-sm col-lg-8 col-md-8 col-sm-8 col-xs-8">
|
||||
<input type="text" id="txtDescripcionDocAux" name="txtDescripcionDocAux" class="form-control imput-xs" required="required" />
|
||||
</div>
|
||||
</div>
|
||||
@*---------------------Comentario ---------------------------------------------------------*@
|
||||
<div class="form-group " id="divComentarioDocAux">
|
||||
<label class="col-sm-4 control-label ControlsForms" id="lblComentarioDocAux">Comentario</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<textarea name="txtComentarioDocAux" rows="5" cols="45" id="txtComentarioDocAux" style="resize: none"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@*---------------------Adjuntar ---------------------------------------------------------*@
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label ControlsForms">Buscar</label>
|
||||
<div class="input-group input-group-sm col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<span class="btn btn-success fileinput-button">
|
||||
<i class="fa fa-search"></i>
|
||||
<input type="file" id="fileupload" name="file" />
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="col-sm-12">
|
||||
<div id="progress" class="progress">
|
||||
<div class="progress-bar progress-bar-success"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer" id="modalDiscusion-footer">
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*---------------------Usuario ---------------------------------------------------------*@
|
||||
<div class="modal fade" id="modalUsuarios" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;">
|
||||
<div class="modal-dialog modal-lg">
|
||||
|
|
@ -366,6 +449,7 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@
|
|||
<table id="tableAdjuntos" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-2">Nombre</th>
|
||||
<th class="col-sm-2"><a href="http://localhost/AYA.SlnSinort/DocumentosSINORT/PropuestaNormativa/1/DocumentosAuxiliares/Captura.PNG"> </a>Nombre</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
|
@ -370,6 +370,14 @@
|
|||
</i> Ver
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="ucbtnVerAdjuntos" style=" display:none;">
|
||||
<button type="button" id="btnVerAdjuntos" class="btn btn-default btn-xs" onclick="javascript: AbrirDocumento('[$value]')">
|
||||
<i class=" fa fa-search">
|
||||
</i> Ver
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="ucbtnRemoverAdjuntos" style=" display:none;">
|
||||
<button type="button" id="btnRemoverAdjuntos" class="btn btn-default btn-xs">
|
||||
<i class="fa fa-remove"></i> Remover
|
||||
|
|
|
|||
|
|
@ -392,8 +392,9 @@
|
|||
<input type="hidden" id="hiddenHref" value="@string.Concat(Url.Action("View", "Controller", null), ViewBag.QueryEncripted)">
|
||||
<input type="hidden" id="hiddenMenuCreado" value="" />
|
||||
<input type="hidden" id="hiddenUsuario" value="@ViewBag.AtesaUser" />
|
||||
<input type="hidden" id="hiddenAdjuntos" value="@ViewBag.AdjuntosDoc" />
|
||||
|
||||
<input type="hidden" id="hiddenFileUploadHandler" value="@ViewBag.FileUploadHandler" />
|
||||
<input type="hidden" id="hiddenRepositorioVirtual" value="@ViewBag.RepositorioVirtual" />
|
||||
<input type="hidden" id="hiddenRepositorioLocal" value="@ViewBag.RepositorioLocal" />
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
<add key="FileRepository" value="C:\DocumentosSINORT\" />
|
||||
<add key="HttpRepository" value="http://localhost/DocumentosSINORT/" />
|
||||
<add key="HttpRepository" value="http://localhost/AYA.SlnSinort/DocumentosSINORT/" />
|
||||
<add key="MaxSizeFileLoadKB" value="5120" />
|
||||
<add key="MaxCountFileLoad" value="3" />
|
||||
</appSettings>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
using Atesa.Utilitarios;
|
||||
using AYA.SlnSinortModel.Constantes;
|
||||
using AYA.SlnSinortModel.Entidades;
|
||||
using AYA.SlnSinortModel.Sinort;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity.Validation;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -10,5 +14,62 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
public class DocumentosAdjuntosDAL
|
||||
{
|
||||
Log log = new Log("DocumentosAdjuntosDAL");
|
||||
|
||||
public AdjuntosJSON GuardarAdjuntos(AdjuntosJSON model)
|
||||
{
|
||||
AdjuntosJSON Respuesta = new AdjuntosJSON();
|
||||
try
|
||||
{
|
||||
model.ClearProperties();
|
||||
|
||||
using (SinortContex Conn = new SinortContex())
|
||||
{
|
||||
int? Next_id = Conn.DocumentosAdjuntos.Max(t => (int?)t.IdDocumentoAdjunto);
|
||||
model.Adjuntos.IdDocumentoAdjunto = (Next_id == null) ? 1 : Next_id.Value + 1;
|
||||
model.Adjuntos.FechaCreacion = DateTime.Now;
|
||||
model.Adjuntos.RutaDescarga = model.Adjuntos.RutaDescarga.Replace("\\", "/");
|
||||
Conn.DocumentosAdjuntos.Add(model.Adjuntos);
|
||||
|
||||
Conn.SaveChanges();
|
||||
Conn.Commit();
|
||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.EXITOSO.ToString();
|
||||
}
|
||||
}
|
||||
catch (DbEntityValidationException ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
Respuesta.CodigoRespuesta = EnumTipoCodigoRespuesta.ERROR.ToString();
|
||||
}
|
||||
return Respuesta;
|
||||
}
|
||||
public List<DocumentosAdjuntos> ObtenerAdjuntos(AdjuntosJSON model)
|
||||
{
|
||||
List<DocumentosAdjuntos> registros = null;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
|
||||
|
||||
registros = db.DocumentosAdjuntos.Where(r => r.IdTipoDocumento == model.IdTipoDocumento && r.IdSubTipoDocumento == model.IdSubTipoDocumento ).OrderBy(r => r.IdDocumentoAdjunto).ToList();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
}
|
||||
|
||||
return registros;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@
|
|||
<Compile Include="Sinort\SinortContex.cs" />
|
||||
<Compile Include="Sinort\SubCategoriaContenido.cs" />
|
||||
<Compile Include="Sinort\SubCategoriaGrupoTematico.cs" />
|
||||
<Compile Include="Sinort\SubCategoriaTipoDocumento.cs" />
|
||||
<Compile Include="Sinort\TipoAplicacion.cs" />
|
||||
<Compile Include="Sinort\TipoComentario.cs" />
|
||||
<Compile Include="Sinort\TipoDocumento.cs" />
|
||||
|
|
|
|||
|
|
@ -25,13 +25,17 @@ namespace AYA.SlnSinortModel.Entidades
|
|||
|
||||
public class AdjuntosJSON : BaseJson
|
||||
{
|
||||
|
||||
public List<DocumentosAdjuntos> ListaAdjuntos { get; set; }
|
||||
public DocumentosAdjuntos Adjuntos { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
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; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,15 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int IdDocumentoAdjunto { get; set; }
|
||||
|
||||
public int? FechaAdjunto { get; set; }
|
||||
|
||||
[StringLength(200)]
|
||||
public string Nombre { get; set; }
|
||||
|
||||
public int? IdTipoDocumento { get; set; }
|
||||
|
||||
public int? NumeroTipoDocumento { get; set; }
|
||||
|
||||
public int? IdSubTipoDocumento { get; set; }
|
||||
|
||||
[Column(TypeName = "ntext")]
|
||||
public string RutaFisica { get; set; }
|
||||
|
||||
|
|
@ -43,6 +47,10 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
[StringLength(200)]
|
||||
public string UsuarioModificacion { get; set; }
|
||||
|
||||
public virtual SubCategoriaTipoDocumento SubCategoriaTipoDocumento { get; set; }
|
||||
|
||||
public virtual TipoDocumento TipoDocumento { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<BitacoraDocumentos> BitacoraDocumentos { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
|
||||
public partial class SinortContex : Contex
|
||||
{
|
||||
|
||||
|
||||
|
||||
public virtual DbSet<Aplicacion> Aplicacion { get; set; }
|
||||
public virtual DbSet<Categoria> Categoria { get; set; }
|
||||
public virtual DbSet<Contenido> Contenido { get; set; }
|
||||
|
|
@ -25,6 +26,7 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
public virtual DbSet<RolesUsuario> RolesUsuario { get; set; }
|
||||
public virtual DbSet<SubCategoriaContenido> SubCategoriaContenido { get; set; }
|
||||
public virtual DbSet<SubCategoriaGrupoTematico> SubCategoriaGrupoTematico { get; set; }
|
||||
public virtual DbSet<SubCategoriaTipoDocumento> SubCategoriaTipoDocumento { get; set; }
|
||||
public virtual DbSet<TipoAplicacion> TipoAplicacion { get; set; }
|
||||
public virtual DbSet<TipoComentario> TipoComentario { get; set; }
|
||||
public virtual DbSet<TipoDocumento> TipoDocumento { get; set; }
|
||||
|
|
@ -259,6 +261,23 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
.Property(e => e.UsuarioModificacion)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<SubCategoriaTipoDocumento>()
|
||||
.Property(e => e.Descripcion)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<SubCategoriaTipoDocumento>()
|
||||
.Property(e => e.UsuarioCreacion)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<SubCategoriaTipoDocumento>()
|
||||
.Property(e => e.UsuarioModificacion)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<SubCategoriaTipoDocumento>()
|
||||
.HasMany(e => e.DocumentosAdjuntos)
|
||||
.WithOptional(e => e.SubCategoriaTipoDocumento)
|
||||
.HasForeignKey(e => e.IdSubTipoDocumento);
|
||||
|
||||
modelBuilder.Entity<TipoAplicacion>()
|
||||
.Property(e => e.Descripcion)
|
||||
.IsUnicode(false);
|
||||
|
|
@ -295,6 +314,11 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
.Property(e => e.UsuarioModificacion)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<TipoDocumento>()
|
||||
.HasMany(e => e.SubCategoriaTipoDocumento)
|
||||
.WithRequired(e => e.TipoDocumento)
|
||||
.WillCascadeOnDelete(false);
|
||||
|
||||
modelBuilder.Entity<TipoEmisor>()
|
||||
.Property(e => e.Descripcion)
|
||||
.IsUnicode(false);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
namespace AYA.SlnSinortModel.Sinort
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
[Table("Catalogos.SubCategoriaTipoDocumento")]
|
||||
public partial class SubCategoriaTipoDocumento
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
|
||||
public SubCategoriaTipoDocumento()
|
||||
{
|
||||
DocumentosAdjuntos = new HashSet<DocumentosAdjuntos>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int IdSubCategoriaTipoDocumento { get; set; }
|
||||
|
||||
public int IdTipoDocumento { get; set; }
|
||||
|
||||
[StringLength(500)]
|
||||
public string Descripcion { get; set; }
|
||||
|
||||
public bool? Estado { get; set; }
|
||||
|
||||
public DateTime? FechaCreacion { get; set; }
|
||||
|
||||
[StringLength(200)]
|
||||
public string UsuarioCreacion { get; set; }
|
||||
|
||||
public DateTime? FechaModificacion { get; set; }
|
||||
|
||||
[StringLength(200)]
|
||||
public string UsuarioModificacion { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<DocumentosAdjuntos> DocumentosAdjuntos { get; set; }
|
||||
|
||||
public virtual TipoDocumento TipoDocumento { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,9 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
|
||||
public TipoDocumento()
|
||||
{
|
||||
SubCategoriaTipoDocumento = new HashSet<SubCategoriaTipoDocumento>();
|
||||
Documentos = new HashSet<Documentos>();
|
||||
DocumentosAdjuntos = new HashSet<DocumentosAdjuntos>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
|
|
@ -34,7 +36,13 @@ namespace AYA.SlnSinortModel.Sinort
|
|||
[StringLength(200)]
|
||||
public string UsuarioModificacion { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<SubCategoriaTipoDocumento> SubCategoriaTipoDocumento { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<Documentos> Documentos { get; set; }
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public virtual ICollection<DocumentosAdjuntos> DocumentosAdjuntos { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue