git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C481
This commit is contained in:
parent
a7486aa07c
commit
161a14d52d
11 changed files with 121 additions and 125 deletions
|
|
@ -109,8 +109,7 @@ namespace AYA.SlnSinort.WCF
|
|||
[OperationContract]
|
||||
List<DocumentosAdjuntos> ObtenerAdjuntos(AdjuntosJSON model);
|
||||
|
||||
[OperationContract]
|
||||
int VerificarNombre(AdjuntosJSON model);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Tareas Pendientes
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ namespace AYA.SlnSinort.WCF
|
|||
List<PalabraClave> ObtenerPalabraClave();
|
||||
|
||||
[OperationContract]
|
||||
List<CatalogosJSON> ObtenerPalabraClavePopUp(CatalogosPost model);
|
||||
List<PalabraClave> ObtenerPalabraClavePopUp();
|
||||
|
||||
[OperationContract]
|
||||
BaseJson InsertarActualizarPalabraClave(PalabraClave model);
|
||||
|
|
|
|||
|
|
@ -1185,20 +1185,7 @@ namespace AYA.SlnSinort.WCF
|
|||
}
|
||||
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
|
||||
|
||||
#region Tareas Pendientes
|
||||
|
|
|
|||
|
|
@ -919,16 +919,17 @@ namespace AYA.SlnSinort.WCF
|
|||
return respuesta;
|
||||
}
|
||||
|
||||
public List<CatalogosJSON> ObtenerPalabraClavePopUp(CatalogosPost model)
|
||||
|
||||
public List<PalabraClave> ObtenerPalabraClavePopUp()
|
||||
{
|
||||
List<CatalogosJSON> respuesta = new List<CatalogosJSON>();
|
||||
List<PalabraClave> respuesta = new List<PalabraClave>();
|
||||
CatalogosPostJSON CatalogosPostJSON = new CatalogosPostJSON();
|
||||
CatalogosPostJSON.filtro = model.filtro;
|
||||
CatalogosPostJSON.IdTipo = model.IdTipo;
|
||||
CatalogosPostJSON.filtro = null;
|
||||
CatalogosPostJSON.IdTipo = null;
|
||||
try
|
||||
{
|
||||
|
||||
respuesta = new PalabraClaveDAL().ObtenerPalabraClave(CatalogosPostJSON);
|
||||
respuesta = new PalabraClaveDAL().ObtenerPalabraClavePopUp();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.IO;
|
|||
using System.Web.Script.Serialization;
|
||||
using System.Security.AccessControl;
|
||||
|
||||
|
||||
namespace webAgenciaVirtual
|
||||
{
|
||||
/// <summary>
|
||||
|
|
@ -19,82 +20,79 @@ namespace webAgenciaVirtual
|
|||
{
|
||||
try
|
||||
{
|
||||
|
||||
string Serverpath = ConfigurationManager.AppSettings["FileRepository"].ToString();
|
||||
//Server.MapPath("../../DocsRespuesta/" + txtCedulaPropietario.Text.Trim() + "/" + ViewState["PKFORMULARIO"].ToString() + "/");
|
||||
|
||||
//String pathMail = ConfigurationManager.AppSettings["RutaPdf"].ToString() + txtCedulaPropietario.Text.Trim() + @"\" + ViewState["PKFORMULARIO"].ToString() + @"\";
|
||||
|
||||
if (!Directory.Exists(Serverpath))
|
||||
Directory.CreateDirectory(Serverpath);
|
||||
|
||||
|
||||
var postedFile = context.Request.Files[0];
|
||||
string fecha = context.Request.QueryString["tipo"].ToString();
|
||||
|
||||
string ext = Path.GetExtension(postedFile.FileName);
|
||||
string file;
|
||||
file = postedFile.FileName.Replace(" ", "_");
|
||||
string fileDirectory = Serverpath;
|
||||
string[] Arraynombre = new string[2];
|
||||
Arraynombre = file.Split('.');
|
||||
var nom = Arraynombre[0];
|
||||
file = nom + fecha + ext;
|
||||
fileDirectory = file;
|
||||
|
||||
|
||||
string pathrefer = context.Request.UrlReferrer.ToString();
|
||||
//string Serverpath = HttpContext.Current.Server.MapPath("DocumentosSINORT");
|
||||
string Serverpath = ConfigurationManager.AppSettings["FileRepository"].ToString();
|
||||
//if (context.Request.QueryString["id"] != null)
|
||||
|
||||
|
||||
Documento oDoc = new Documento();
|
||||
//se transaforma el archivo a un arreglo de bytes
|
||||
|
||||
byte[] fileData = null;
|
||||
using (var binaryReader = new BinaryReader(context.Request.Files[0].InputStream))
|
||||
{
|
||||
fileData = binaryReader.ReadBytes(context.Request.Files[0].ContentLength);
|
||||
}
|
||||
|
||||
string strResultado = oDoc.Archivar_Documento(file, nom, fileData);
|
||||
|
||||
if (strResultado != string.Empty)
|
||||
context.Response.Write("Error");
|
||||
else
|
||||
context.Response.Write("Success");
|
||||
|
||||
|
||||
if (context.Request.QueryString["fileName"] != null)
|
||||
{
|
||||
//file = context.Request.QueryString["fileName"].Replace(" ", "_");
|
||||
//if (File.Exists(fileDirectory + "\\" + file))
|
||||
//{
|
||||
//Serverpath += context.Request.QueryString["tipo"].ToString() + "\\" + context.Request.QueryString["id"].ToString() + "\\" + context.Request.QueryString["carpeta"].ToString();
|
||||
//}else
|
||||
//{
|
||||
//Serverpath += context.Request.QueryString["tipo"].ToString();
|
||||
// File.Delete(fileDirectory + "\\" + file);
|
||||
//}
|
||||
var postedFile = context.Request.Files[0];
|
||||
string ext = Path.GetExtension(postedFile.FileName);
|
||||
string fecha = context.Request.QueryString["tipo"].ToString();
|
||||
//if (ext == ".pdf" || ext == ".PDF")
|
||||
//{
|
||||
string file;
|
||||
}
|
||||
|
||||
//For IE to get file name
|
||||
if (HttpContext.Current.Request.Browser.Browser.ToUpper() == "IE")
|
||||
{
|
||||
string[] files = postedFile.FileName.Split(new char[] { '\\' });
|
||||
file = files[files.Length - 1].Replace(" ","_");
|
||||
}
|
||||
else
|
||||
{
|
||||
file = postedFile.FileName.Replace(" ", "_");
|
||||
}
|
||||
|
||||
file = postedFile.FileName.Replace(" ", "_");
|
||||
|
||||
if (!Directory.Exists(Serverpath))
|
||||
Directory.CreateDirectory(Serverpath);
|
||||
|
||||
string fileDirectory = Serverpath;
|
||||
if (context.Request.QueryString["fileName"] != null)
|
||||
{
|
||||
file = context.Request.QueryString["fileName"].Replace(" ", "_");
|
||||
if (File.Exists(fileDirectory + "\\" + file))
|
||||
{
|
||||
File.Delete(fileDirectory + "\\" + file);
|
||||
}
|
||||
}
|
||||
|
||||
string [] Arraynombre = new string[2];
|
||||
Arraynombre = file.Split('.');
|
||||
var nom = Arraynombre[0];
|
||||
file = nom + fecha + ext;
|
||||
fileDirectory = Serverpath + "\\" + file ;
|
||||
|
||||
postedFile.SaveAs(fileDirectory);
|
||||
|
||||
context.Response.AddHeader("Vary", "Accept");
|
||||
try
|
||||
{
|
||||
if (context.Request["HTTP_ACCEPT"].Contains("application/json"))
|
||||
context.Response.ContentType = "application/json";
|
||||
else
|
||||
context.Response.ContentType = "text/plain";
|
||||
}
|
||||
catch
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
}
|
||||
|
||||
context.Response.Write("Success");
|
||||
context.Response.AddHeader("Vary", "Accept");
|
||||
try
|
||||
{
|
||||
if (context.Request["HTTP_ACCEPT"].Contains("application/json"))
|
||||
context.Response.ContentType = "application/json";
|
||||
else
|
||||
context.Response.ContentType = "text/plain";
|
||||
context.Response.Write(file);
|
||||
return;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// context.Response.Write("errorEXT");
|
||||
// return;
|
||||
//}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
context.Response.ContentType = "text/plain";
|
||||
}
|
||||
|
||||
|
||||
context.Response.ContentType = "text/plain";
|
||||
//context.Response.Write(file);
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,13 +8,14 @@ var NombreUsuario = $("#hiddenNombreUsuario").val();
|
|||
var LinkPropuesta = "http://10.50.1.97:6075/PropuestaNormativa/DetallePropuesta?";
|
||||
var LinkSolicitudTarea = "http://10.50.1.97:6075/Home/TareasPendientes";
|
||||
var LinkSolicitudResponder = "http://10.50.1.97:6075/NormativaReglamentacionTecnica/VerSolicitudes?";
|
||||
var LinkBusquedaFichaTecnica = "http://10.50.1.97:6075/Home/Normativa_Reglamentacion_Tecnica?solicitud=`"
|
||||
//aya-vsrv-apptt:2525
|
||||
//http://aya-vsrv-apptt:2525/Home/TareasPendientes
|
||||
//http://aya-vsrv-wstt:2005/Sinort.svc
|
||||
//http://aya-vsrv-wstt:2005/SinortCatalogos.svc
|
||||
var server = window.location.protocol + "//" + "10.50.1.97:6075" + "/" + (window.location.pathname.split('/')[1]) + "/";
|
||||
var SinorLoginWCF = "http://10.50.1.123:2070/Sinort.svc";
|
||||
var SinorSignupWCF = "http://10.50.1.123:2070/SinortCatalogos.svc";
|
||||
var server = window.location.protocol + "//" + "localhost" + "/" + (window.location.pathname.split('/')[1]) + "/";
|
||||
var SinorLoginWCF = "http://localhost/AYA.SlnSinort.WCF/Sinort.svc";
|
||||
var SinorSignupWCF = "http://localhost/AYA.SlnSinort.WCF/SinortCatalogos.svc";
|
||||
var string_empty = "";
|
||||
var Atesa = {};
|
||||
var StarterTemplateVisible = true;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ $('#tableGotitasPendientes').on('click', 'button', function () {
|
|||
//$('#richText-dgbcu').val(InfoIDescripcion);
|
||||
$('#txtFechaCaducidad').val(InfoIFechaCaducidad);
|
||||
|
||||
$("#txtAreaDescripcion").val(InfoIDescripcion.html);
|
||||
$("#txtAreaDescripcion").val(InfoIDescripcion);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ var UsuarioAlerta = false;
|
|||
var tieneAlerta = false;
|
||||
var FechaDocumentos;
|
||||
var ExisteNombreDoc = false;
|
||||
var rutaarchivo;
|
||||
|
||||
var idFicha;
|
||||
var Alerta;
|
||||
|
|
@ -314,7 +315,7 @@ this.GuardarFichaTecnica = function () {
|
|||
|
||||
FichaTecnica = {
|
||||
IdFichaTecnica: IsNullOrEmpty(FichaTecnicaId) ? 0 : FichaTecnicaId,
|
||||
IdDocumento: IsNullOrEmpty(modelDocumentoAdjunto) ? 0 : modelDocumentoAdjunto.Adjuntos.IdDocumentoAdjunto,
|
||||
IdDocumento: IsNullOrEmpty(modelDocumentoAdjunto) ? null : modelDocumentoAdjunto.Adjuntos.IdDocumentoAdjunto,
|
||||
DescripcionDocumento: IsNullOrEmpty(modelDocumentoAdjunto) ? 0 : modelDocumentoAdjunto.Adjuntos.Nombre,
|
||||
Identificacion: $("#txtAreaIdentificacion").val(),
|
||||
IdEstado: $("#hiddenEstado").val(),
|
||||
|
|
@ -379,7 +380,7 @@ this.GuardarFichaTecnica = function () {
|
|||
|
||||
LimpiarControles();
|
||||
if (IDFicha != null && IDFicha != "[$id]") {
|
||||
document.location.href = "http://localhost/AYA.SlnSinort/Home/Normativa_Reglamentacion_Tecnica?solicitud=`";
|
||||
document.location.href = LinkBusquedaFichaTecnica;
|
||||
}
|
||||
|
||||
//location.replace("javascript: EntrarVerEstadoFicha('1');");
|
||||
|
|
@ -465,7 +466,7 @@ this.LimpiarControles = function () {
|
|||
$("#txtEmisor").val('');
|
||||
$("#txtFechaPublicacionDocumentoTecnico").val('');
|
||||
$("#txtNumeroPublicacionVersion").val('');
|
||||
|
||||
$('#txtListaPalabraClave').val('');
|
||||
$('#txtDescripcionDocAux').val('');
|
||||
$('#txtComentarioDocAux').val('');
|
||||
var tableDocFichaTecnica = $('#tableDocFichaTecnica').DataTable();
|
||||
|
|
@ -492,6 +493,15 @@ this.EliminarAdjunto = function () {
|
|||
|
||||
if (!confirm("¿Desea eliminar el documento técnico ?")) return;
|
||||
|
||||
var uri = SinortWCF + '/api/EliminarbaseAdjunto';
|
||||
|
||||
var docs = {
|
||||
Id: modelDocumentoAdjunto.Adjuntos.IdDocumentoAdjunto
|
||||
};
|
||||
|
||||
AjaxPostData(uri, docs, false, true, null, null, null);
|
||||
|
||||
|
||||
model.Adjuntos = null;
|
||||
modelDocumentoAdjunto = null;
|
||||
var tableDocFichaTecnica = $('#tableDocFichaTecnica').DataTable();
|
||||
|
|
@ -499,8 +509,10 @@ this.EliminarAdjunto = function () {
|
|||
$('#txtComentarioDocAux').val('');
|
||||
$('#txtDescripcionDocAux').val('');
|
||||
$('#fileupload').prop("disabled", false);
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
|
||||
this.CargarEmisor = function (filtro) {
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerEmisorPopUp';
|
||||
|
|
@ -750,7 +762,7 @@ this.CargarGridSubGrupoTematico = function (data) {
|
|||
|
||||
this.CargarPalabraClave = function (filtro) {
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerPalabraClave';
|
||||
var uri = CatalogosWCF + '/api/ObtenerPalabraClavePopUp';
|
||||
AjaxPostData(uri, null, false, false, CargarGridPalabraClave, null, null);
|
||||
|
||||
}
|
||||
|
|
@ -1116,11 +1128,13 @@ function ActualizarUpload() {
|
|||
ValidarNombre();
|
||||
if (ExisteNombreDoc) {
|
||||
toastr.warning("El nombre del documento ya existe", Message_Warning);
|
||||
ENDREQUEST();
|
||||
return;
|
||||
}
|
||||
|
||||
var fr = new FileReader();
|
||||
fr.readAsArrayBuffer(data.files[0]);
|
||||
|
||||
data.submit();
|
||||
},
|
||||
progress: function (e, data) {
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@
|
|||
<add key="ClientValidationEnabled" value="true" />
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
|
||||
<add key="SinortWCF" value="http://10.50.1.123:2070/Sinort.svc" />
|
||||
<!-- <add key="SinortWCF" value="http://10.50.1.123:2070/Sinort.svc" />
|
||||
<add key="SinortCatalogosWCF" value="http://10.50.1.123:2070/SinortCatalogos.svc" />
|
||||
<add key="FileRepository" value="\\10.50.1.97\Aplicaciones\SINORT(6075)\Raiz\DocumentosSinort\" />
|
||||
<add key="HttpRepository" value="http://10.50.1.97:6075/DocumentosSinort/" />
|
||||
<add key="FileUploadHandler" value="http://10.50.1.97:6075/FileUploadHandler" />
|
||||
<add key="RutaLogoSINORT" value="http://10.50.1.97:6075/dist/img/" />
|
||||
<add key="RutaImagenes" value="http://10.50.1.97:6075/bower_components/Ionicons/png/512/" />
|
||||
<add key="RutaImagenes" value="http://10.50.1.97:6075/bower_components/Ionicons/png/512/" /> -->
|
||||
|
||||
|
||||
<!--<add key="SinortWCF" value="http://aya-vsrv-wstt:2005/Sinort.svc" />
|
||||
|
|
@ -50,13 +50,13 @@
|
|||
<add key="const_strGaveta" value="Sinort"/>
|
||||
<add key="const_strLlaves" value="Nombre_Documento"/>
|
||||
|
||||
<!--<add key="SinortWCF" value="http://localhost/AYA.SlnSinort.WCF/Sinort.svc" />
|
||||
<add key="SinortWCF" value="http://localhost/AYA.SlnSinort.WCF/Sinort.svc" />
|
||||
<add key="SinortCatalogosWCF" value="http://localhost/AYA.SlnSinort.WCF/SinortCatalogos.svc" />
|
||||
<add key="FileRepository" value="C:\DocumentosSinort\" />
|
||||
<add key="HttpRepository" value="http://localhost/AYA.SlnSinort/DocumentosSINORT/" />
|
||||
<add key="FileUploadHandler" value="http://localhost/AYA.SlnSinort/FileUploadHandler" />
|
||||
<add key="RutaLogoSINORT" value="http://localhost/AYA.SlnSinort/dist/img/" />
|
||||
<add key="RutaImagenes" value="http://localhost/AYA.SlnSinort/bower_components/Ionicons/png/512/" /> -->
|
||||
<add key="RutaImagenes" value="http://localhost/AYA.SlnSinort/bower_components/Ionicons/png/512/" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
|
||||
|
|
|
|||
|
|
@ -158,28 +158,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,24 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
|||
|
||||
return registros;
|
||||
}
|
||||
public List<PalabraClave> ObtenerPalabraClavePopUp()
|
||||
{
|
||||
List<PalabraClave> respuesta = null;
|
||||
try
|
||||
{
|
||||
using (SinortContex db = new SinortContex())
|
||||
{
|
||||
respuesta = db.PalabraClave.Where(t => t.Estado == true).ToList();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return respuesta;
|
||||
}
|
||||
public List<PalabraClave> ObtenerPalabraClave()
|
||||
{
|
||||
List<PalabraClave> respuesta = null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue