Correciones pago electronico, tareas thalamus
This commit is contained in:
@@ -1197,7 +1197,7 @@ Partial Class Bancos_PagoElectronicoGrupos
|
|||||||
|
|
||||||
|
|
||||||
For Each drow As DataRow In DTPendientesTemp.Rows
|
For Each drow As DataRow In DTPendientesTemp.Rows
|
||||||
|
EsCIE = False
|
||||||
|
|
||||||
MENSAJEError.Clear()
|
MENSAJEError.Clear()
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ public class TareasJam : IHttpHandler
|
|||||||
switch (Metodo)
|
switch (Metodo)
|
||||||
{
|
{
|
||||||
case "TestConexion":
|
case "TestConexion":
|
||||||
//PruebaConexionFTP("ftp://127.0.0.1/", "Toor", "agj-3500");
|
retorno = PruebaConexionFTP("ftp://us2.hostedftp.com/", "agrojam", "A12345678");
|
||||||
retorno = PruebaConexionFTP("ftp://us2.hostedftp.com/", "agrojam", "A12345678");
|
|
||||||
break;
|
break;
|
||||||
case "EjecutaThalamus":
|
case "EjecutaThalamus":
|
||||||
retorno =EjecutaThalamus(CveEmpresa);
|
retorno =EjecutaThalamus(CveEmpresa);
|
||||||
@@ -41,8 +40,8 @@ public class TareasJam : IHttpHandler
|
|||||||
context.Response.Write("False");
|
context.Response.Write("False");
|
||||||
|
|
||||||
}
|
}
|
||||||
context.Response.End();
|
context.Response.End();
|
||||||
//ModExtensiones.GuardaLogAD(string.Format("{3} CveEmpresa={0} cveTareaProgramada={1} CveTareaProgramadaHistorial={2}", CveEmpresa, cveTareaProgramada, CveTareaProgramadaHistorial, Metodo), "Tareas Programadas");
|
|
||||||
}
|
}
|
||||||
private bool EjecutaThalamus(int CveEmpresa)
|
private bool EjecutaThalamus(int CveEmpresa)
|
||||||
{
|
{
|
||||||
@@ -52,6 +51,8 @@ public class TareasJam : IHttpHandler
|
|||||||
DataTable DTProductos = new DataTable();
|
DataTable DTProductos = new DataTable();
|
||||||
DataTable DTVentas = new DataTable();
|
DataTable DTVentas = new DataTable();
|
||||||
DataTable DTClientes = new DataTable();
|
DataTable DTClientes = new DataTable();
|
||||||
|
DataTable DTAlmacenes = new DataTable();
|
||||||
|
|
||||||
bool ErrorProceso = false;
|
bool ErrorProceso = false;
|
||||||
|
|
||||||
if (ObjGenerales.GetJAMCorveta(1))
|
if (ObjGenerales.GetJAMCorveta(1))
|
||||||
@@ -72,6 +73,12 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
else { ErrorProceso = true; }
|
else { ErrorProceso = true; }
|
||||||
|
|
||||||
|
if (ObjGenerales.GetJAMCorveta(4))
|
||||||
|
{
|
||||||
|
DTAlmacenes = ObjGenerales.DtResultados.Copy();
|
||||||
|
}
|
||||||
|
else { ErrorProceso = true; }
|
||||||
|
|
||||||
ObjGenerales.Dispose();
|
ObjGenerales.Dispose();
|
||||||
|
|
||||||
if (!ErrorProceso)
|
if (!ErrorProceso)
|
||||||
@@ -79,6 +86,8 @@ public class TareasJam : IHttpHandler
|
|||||||
string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
string RutaProductos = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Productos{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
||||||
string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
string RutaVentas = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Ventas{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
||||||
string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
||||||
|
string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
|
||||||
|
|
||||||
|
|
||||||
string FTPServer = "ftp://127.0.0.1/";
|
string FTPServer = "ftp://127.0.0.1/";
|
||||||
string TFPUsr = "Toor";
|
string TFPUsr = "Toor";
|
||||||
@@ -87,7 +96,7 @@ public class TareasJam : IHttpHandler
|
|||||||
SpreadsheetInfo.SetLicense(Extensiones.ModExtensiones.SerialGemBoxSpreadsheet());
|
SpreadsheetInfo.SetLicense(Extensiones.ModExtensiones.SerialGemBoxSpreadsheet());
|
||||||
|
|
||||||
var workbookProductos = new ExcelFile();
|
var workbookProductos = new ExcelFile();
|
||||||
var worksheetProductos = workbookProductos.Worksheets.Add("Ventas");
|
var worksheetProductos = workbookProductos.Worksheets.Add("Productos");
|
||||||
worksheetProductos.InsertDataTable(DTProductos, new InsertDataTableOptions()
|
worksheetProductos.InsertDataTable(DTProductos, new InsertDataTableOptions()
|
||||||
{
|
{
|
||||||
ColumnHeaders = true,
|
ColumnHeaders = true,
|
||||||
@@ -106,7 +115,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
|
|
||||||
var workbookClientes = new ExcelFile();
|
var workbookClientes = new ExcelFile();
|
||||||
var worksheetClientes = workbookClientes.Worksheets.Add("Ventas");
|
var worksheetClientes = workbookClientes.Worksheets.Add("Clientes");
|
||||||
worksheetClientes.InsertDataTable(DTClientes, new InsertDataTableOptions()
|
worksheetClientes.InsertDataTable(DTClientes, new InsertDataTableOptions()
|
||||||
{
|
{
|
||||||
ColumnHeaders = true,
|
ColumnHeaders = true,
|
||||||
@@ -115,14 +124,26 @@ public class TareasJam : IHttpHandler
|
|||||||
workbookClientes.Save(RutaClientes);
|
workbookClientes.Save(RutaClientes);
|
||||||
|
|
||||||
|
|
||||||
|
var workbookAlmacenes = new ExcelFile();
|
||||||
|
var worksheetAlmacenes = workbookClientes.Worksheets.Add("Almacenes");
|
||||||
|
worksheetAlmacenes.InsertDataTable(DTAlmacenes, new InsertDataTableOptions()
|
||||||
|
{
|
||||||
|
ColumnHeaders = true,
|
||||||
|
StartRow = 0
|
||||||
|
});
|
||||||
|
workbookClientes.Save(RutaAlmacenes);
|
||||||
|
|
||||||
|
|
||||||
var FInfoProductos = new FileInfo(RutaProductos);
|
var FInfoProductos = new FileInfo(RutaProductos);
|
||||||
var FInfoVentas = new FileInfo(RutaVentas);
|
var FInfoVentas = new FileInfo(RutaVentas);
|
||||||
var FInfoClientes = new FileInfo(RutaClientes);
|
var FInfoClientes = new FileInfo(RutaClientes);
|
||||||
|
var FInfoAlmacenes = new FileInfo(RutaAlmacenes);
|
||||||
|
|
||||||
|
|
||||||
bool CargaProductos = false;
|
bool CargaProductos = false;
|
||||||
bool CargaVentas = false;
|
bool CargaVentas = false;
|
||||||
bool CargaClientes = false;
|
bool CargaClientes = false;
|
||||||
|
bool CargaAlmacenes = false;
|
||||||
|
|
||||||
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
|
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
|
||||||
if (CargaProductos)
|
if (CargaProductos)
|
||||||
@@ -149,7 +170,17 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CargaProductos & CargaVentas & CargaClientes)
|
if (CargaProductos & CargaVentas& CargaClientes )
|
||||||
|
{
|
||||||
|
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, FTPServer, TFPUsr, FTPPass);
|
||||||
|
if (CargaClientes)
|
||||||
|
{
|
||||||
|
CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, FTPServer, TFPUsr, FTPPass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (CargaProductos & CargaVentas & CargaClientes & CargaAlmacenes)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -272,7 +303,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
private bool PruebaConexionFTP( string FTPServer, string FTPUsr, string FTPPass)
|
private bool PruebaConexionFTP( string FTPServer, string FTPUsr, string FTPPass)
|
||||||
{
|
{
|
||||||
bool Respuesta = false;
|
bool Respuesta = false;
|
||||||
|
|
||||||
FtpWebRequest request =(FtpWebRequest)WebRequest.Create($"{FTPServer}/Test.log");
|
FtpWebRequest request =(FtpWebRequest)WebRequest.Create($"{FTPServer}/Test.log");
|
||||||
request.Method = WebRequestMethods.Ftp.ListDirectory;
|
request.Method = WebRequestMethods.Ftp.ListDirectory;
|
||||||
|
|||||||
Reference in New Issue
Block a user