Thalamus Campo address.street1 se envia como fecha, Prodcutos servicios no se esta enviando campo
This commit is contained in:
@@ -13,6 +13,9 @@ using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using ClosedXML;
|
||||
|
||||
using System.Web.SessionState;
|
||||
using System.Web.Hosting;
|
||||
|
||||
public class TareasJam : IHttpHandler
|
||||
{
|
||||
|
||||
@@ -50,12 +53,15 @@ public class TareasJam : IHttpHandler
|
||||
}
|
||||
private bool EjecutaThalamus(int CveEmpresa, HttpContext context)
|
||||
{
|
||||
Usuario Usuario = ValidaUsuarioSistema(100, 119);
|
||||
|
||||
this.GuardaLog("EjecutaThalamus: Inicio. ");
|
||||
|
||||
bool Respuesta = false;
|
||||
StringBuilder SBLog = new StringBuilder();
|
||||
|
||||
|
||||
|
||||
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||
|
||||
DataTable DTProductos = new DataTable();
|
||||
@@ -116,7 +122,7 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
SBLog.AppendLine("<b>Consultas</b><br>");
|
||||
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
||||
Usuario Usuario = ValidaUsuarioSistema(100, 119);
|
||||
|
||||
|
||||
this.GuardaLog("EjecutaThalamus: Consultando Productos. ");
|
||||
if (ObjGenerales.GetJAMCorveta(1))
|
||||
@@ -319,6 +325,8 @@ public class TareasJam : IHttpHandler
|
||||
|
||||
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
||||
var wsClientes = wbAClientes.Worksheet(1);
|
||||
wsClientes.Column(8).Style.NumberFormat.Format = "@";
|
||||
wsClientes.Column(9).Style.NumberFormat.Format = "@";
|
||||
|
||||
count = 2;
|
||||
|
||||
@@ -332,7 +340,8 @@ public class TareasJam : IHttpHandler
|
||||
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
|
||||
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
|
||||
wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
|
||||
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
|
||||
|
||||
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
|
||||
wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
|
||||
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
||||
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
||||
@@ -372,7 +381,7 @@ public class TareasJam : IHttpHandler
|
||||
}
|
||||
|
||||
|
||||
//ErrorProceso = true;
|
||||
ErrorProceso = true;
|
||||
|
||||
|
||||
if (!ErrorProceso)
|
||||
@@ -630,25 +639,65 @@ public class TareasJam : IHttpHandler
|
||||
return Respuesta;
|
||||
}
|
||||
|
||||
private Usuario ValidaUsuarioSistema(int CveUsuario, int CveEmpresa)
|
||||
private Usuario ValidaUsuarioSistema(int CveUsuario, int CveEmpresa)
|
||||
{
|
||||
Usuario UsuarioActual = null/* TODO Change to default(_) if this is not a reference type */;
|
||||
ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios();
|
||||
|
||||
if (ObjUsuarios.GetUsuarios(CveUsuario))
|
||||
{
|
||||
Usuario UsuarioActual = null/* TODO Change to default(_) if this is not a reference type */;
|
||||
ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios();
|
||||
if (ObjUsuarios.GetUsuarios(CveUsuario))
|
||||
if (ObjUsuarios.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
if (ObjUsuarios.DtResultados.Rows.Count > 0)
|
||||
string Usuario = ObjUsuarios.DtResultados.Rows[0]["Usuario"].ToString();
|
||||
string Contrasenia = ObjUsuarios.DtResultados.Rows[0]["Contraseña"].ToString();
|
||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa: CveEmpresa);
|
||||
UsuarioActual.CveEmpresa = CveEmpresa;
|
||||
|
||||
if( HttpContext.Current.Session == null)
|
||||
{
|
||||
string Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString();
|
||||
string Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString();
|
||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa: CveEmpresa);
|
||||
UsuarioActual.CveEmpresa = CveEmpresa;
|
||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual;
|
||||
// CrearHttpContextArtificial();
|
||||
CrearHttpContextConSession();
|
||||
|
||||
|
||||
}
|
||||
|
||||
HttpContext.Current.Session["UsuarioSIG"] = UsuarioActual;
|
||||
}
|
||||
ObjUsuarios.Dispose();
|
||||
return UsuarioActual;
|
||||
}
|
||||
|
||||
ObjUsuarios.Dispose();
|
||||
return UsuarioActual;
|
||||
}
|
||||
|
||||
|
||||
//public static void CrearHttpContextArtificial()
|
||||
//{
|
||||
// // Crear un SimpleWorkerRequest
|
||||
// var workerRequest = new SimpleWorkerRequest("/dummy", null, new StringWriter());
|
||||
|
||||
// // Crear un HttpContext utilizando el SimpleWorkerRequest
|
||||
// HttpContext.Current = new HttpContext(workerRequest);
|
||||
|
||||
// // Ahora puedes usar HttpContext.Current como si estuviera en un contexto web
|
||||
// // Nota: La sesión aún no está disponible
|
||||
//}
|
||||
|
||||
public static void CrearHttpContextConSession()
|
||||
{
|
||||
//CrearHttpContextArtificial();
|
||||
|
||||
// Para agregar soporte de sesión, debemos inicializar el manejador de sesión
|
||||
var sessionContainer = new HttpSessionStateContainer("id",
|
||||
new SessionStateItemCollection(),
|
||||
new HttpStaticObjectsCollection(),
|
||||
10,
|
||||
true,
|
||||
HttpCookieMode.AutoDetect,
|
||||
SessionStateMode.InProc,
|
||||
false);
|
||||
|
||||
SessionStateUtility.AddHttpSessionStateToContext(HttpContext.Current, sessionContainer);
|
||||
}
|
||||
|
||||
|
||||
private bool VerificarArchivo(FileInfo FInfo, long Tamanio, string FTPServer, string FTPUsr, string FTPPass)
|
||||
|
||||
Reference in New Issue
Block a user