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 System.Collections.Generic;
|
||||||
using ClosedXML;
|
using ClosedXML;
|
||||||
|
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Web.Hosting;
|
||||||
|
|
||||||
public class TareasJam : IHttpHandler
|
public class TareasJam : IHttpHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -50,12 +53,15 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
private bool EjecutaThalamus(int CveEmpresa, HttpContext context)
|
private bool EjecutaThalamus(int CveEmpresa, HttpContext context)
|
||||||
{
|
{
|
||||||
|
Usuario Usuario = ValidaUsuarioSistema(100, 119);
|
||||||
|
|
||||||
this.GuardaLog("EjecutaThalamus: Inicio. ");
|
this.GuardaLog("EjecutaThalamus: Inicio. ");
|
||||||
|
|
||||||
bool Respuesta = false;
|
bool Respuesta = false;
|
||||||
StringBuilder SBLog = new StringBuilder();
|
StringBuilder SBLog = new StringBuilder();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ClsGenerales ObjGenerales = new ClsGenerales();
|
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||||
|
|
||||||
DataTable DTProductos = new DataTable();
|
DataTable DTProductos = new DataTable();
|
||||||
@@ -116,7 +122,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
SBLog.AppendLine("<b>Consultas</b><br>");
|
SBLog.AppendLine("<b>Consultas</b><br>");
|
||||||
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
||||||
Usuario Usuario = ValidaUsuarioSistema(100, 119);
|
|
||||||
|
|
||||||
this.GuardaLog("EjecutaThalamus: Consultando Productos. ");
|
this.GuardaLog("EjecutaThalamus: Consultando Productos. ");
|
||||||
if (ObjGenerales.GetJAMCorveta(1))
|
if (ObjGenerales.GetJAMCorveta(1))
|
||||||
@@ -319,6 +325,8 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
||||||
var wsClientes = wbAClientes.Worksheet(1);
|
var wsClientes = wbAClientes.Worksheet(1);
|
||||||
|
wsClientes.Column(8).Style.NumberFormat.Format = "@";
|
||||||
|
wsClientes.Column(9).Style.NumberFormat.Format = "@";
|
||||||
|
|
||||||
count = 2;
|
count = 2;
|
||||||
|
|
||||||
@@ -332,7 +340,8 @@ public class TareasJam : IHttpHandler
|
|||||||
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
|
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
|
||||||
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
|
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
|
||||||
wsClientes.Cell(count, 7).Value = DRow["address.city"].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, 9).Value = DRow["address.street2"].ToString();
|
||||||
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
||||||
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
||||||
@@ -372,7 +381,7 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//ErrorProceso = true;
|
ErrorProceso = true;
|
||||||
|
|
||||||
|
|
||||||
if (!ErrorProceso)
|
if (!ErrorProceso)
|
||||||
@@ -630,25 +639,65 @@ public class TareasJam : IHttpHandler
|
|||||||
return Respuesta;
|
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 */;
|
if (ObjUsuarios.DtResultados.Rows.Count > 0)
|
||||||
ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios();
|
|
||||||
if (ObjUsuarios.GetUsuarios(CveUsuario))
|
|
||||||
{
|
{
|
||||||
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();
|
// CrearHttpContextArtificial();
|
||||||
string Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString();
|
CrearHttpContextConSession();
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa: CveEmpresa);
|
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa;
|
|
||||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
private bool VerificarArchivo(FileInfo FInfo, long Tamanio, string FTPServer, string FTPUsr, string FTPPass)
|
||||||
|
|||||||
@@ -1521,7 +1521,7 @@ Partial Class ProductosyServicios
|
|||||||
If CvePS = -1 Then
|
If CvePS = -1 Then
|
||||||
Dim PSS As String = TxtPS.Text.Trim.Replace("|", "")
|
Dim PSS As String = TxtPS.Text.Trim.Replace("|", "")
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper
|
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper
|
||||||
If ObjProductosServicios.AddPS(DdlClasificacion.SelectedValue.ToEntero, -1, DdlUnidadMedida.SelectedValue.ToEntero, TxtCodigo.Text.Trim, "", TxtCodigoBarras.Text.Trim, PSS,
|
If ObjProductosServicios.AddPS(DdlClasificacion.SelectedValue.ToEntero, -1, DdlUnidadMedida.SelectedValue.ToEntero, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS,
|
||||||
TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble, (TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, CveProveedor, True,
|
TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble, (TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, CveProveedor, True,
|
||||||
ChkAplicaParaVenta.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMetodoInv, EsPaquete, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero,
|
ChkAplicaParaVenta.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMetodoInv, EsPaquete, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero,
|
||||||
FuePorXML:=False, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarca, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim,
|
FuePorXML:=False, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarca, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim,
|
||||||
|
|||||||
Reference in New Issue
Block a user