git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C479
This commit is contained in:
parent
4b53dff112
commit
1d1b7171c9
4 changed files with 56 additions and 3 deletions
|
|
@ -106,7 +106,8 @@ namespace AYA.SlnSinort.WCF
|
||||||
[OperationContract]
|
[OperationContract]
|
||||||
List<DocumentosAdjuntos> ObtenerAdjuntos(AdjuntosJSON model);
|
List<DocumentosAdjuntos> ObtenerAdjuntos(AdjuntosJSON model);
|
||||||
|
|
||||||
|
[OperationContract]
|
||||||
|
int VerificarNombre(AdjuntosJSON model);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Tareas Pendientes
|
#region Tareas Pendientes
|
||||||
|
|
|
||||||
|
|
@ -1170,6 +1170,20 @@ namespace AYA.SlnSinort.WCF
|
||||||
}
|
}
|
||||||
return respuesta;
|
return respuesta;
|
||||||
}
|
}
|
||||||
|
public int VerificarNombre(AdjuntosJSON model)
|
||||||
|
{
|
||||||
|
int respuesta = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
respuesta = new DocumentosAdjuntosDAL().VerificarNombre(model);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error(ex);
|
||||||
|
}
|
||||||
|
return respuesta;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Tareas Pendientes
|
#region Tareas Pendientes
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ var FTPalabraClaveHistorico;
|
||||||
var UsuarioAlerta = false;
|
var UsuarioAlerta = false;
|
||||||
var tieneAlerta = false;
|
var tieneAlerta = false;
|
||||||
var FechaDocumentos;
|
var FechaDocumentos;
|
||||||
|
var ExisteNombreDoc = false;
|
||||||
|
|
||||||
var idFicha;
|
var idFicha;
|
||||||
var Alerta;
|
var Alerta;
|
||||||
|
|
@ -1097,7 +1098,12 @@ function ActualizarUpload() {
|
||||||
toastr.warning("El nombre del documento es requerido", Message_Warning);
|
toastr.warning("El nombre del documento es requerido", Message_Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ValidarNombre();
|
||||||
|
if (ExisteNombreDoc)
|
||||||
|
{
|
||||||
|
toastr.warning("El nombre del documento ya existe", Message_Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
data.submit();
|
data.submit();
|
||||||
},
|
},
|
||||||
progress: function (e, data) {
|
progress: function (e, data) {
|
||||||
|
|
@ -1209,7 +1215,17 @@ this.DivulgarFichaTecnica = function ()
|
||||||
|
|
||||||
$('#modalDivulgar').modal('show');
|
$('#modalDivulgar').modal('show');
|
||||||
}
|
}
|
||||||
|
this.ValidarNombre = function () {
|
||||||
|
model = {
|
||||||
|
Nombre: $('#txtDescripcionDocAux').val()
|
||||||
|
}
|
||||||
|
var uri = SinortWCF + '/api/VerificarNombre';
|
||||||
|
AjaxPostData(uri, model, false, false, ExisteNombre, null, null);
|
||||||
|
}
|
||||||
|
this.ExisteNombre = function (data) {
|
||||||
|
if (data > 0)
|
||||||
|
ExisteNombreDoc = true;
|
||||||
|
}
|
||||||
this.CargarUsuarios = function (filtro) {
|
this.CargarUsuarios = function (filtro) {
|
||||||
|
|
||||||
var uri = CatalogosWCF + '/api/ObtenerUsuario';
|
var uri = CatalogosWCF + '/api/ObtenerUsuario';
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,28 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
|
|
||||||
return respuesta;
|
return respuesta;
|
||||||
}
|
}
|
||||||
|
public int VerificarNombre(AdjuntosJSON model){
|
||||||
|
|
||||||
|
int nombre = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SinortContex db = new SinortContex())
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
nombre = db.DocumentosAdjuntos.Where(r => r.Nombre.ToString() == model.Nombre.ToLower() && r.IdTipoDocumento == 3).Count();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
log.Error(ex);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nombre;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue