Cambios Compras
This commit is contained in:
@@ -2688,77 +2688,88 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
TmpDT.Columns.Add("CveContrato", GetType(Integer))
|
TmpDT.Columns.Add("CveContrato", GetType(Integer))
|
||||||
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
|
TmpDT.Columns.Add("DifPSSat", GetType(Integer))
|
||||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
|
||||||
TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer))
|
If Not TmpDT.Columns.Contains("CveContratoDetalle") Then
|
||||||
|
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not TmpDT.Columns.Contains("CveCultivoCuadroDetalle") Then
|
||||||
|
TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GvPS.DataSource = TmpDT
|
GvPS.DataSource = TmpDT
|
||||||
GvPS.DataBind()
|
GvPS.DataBind()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
|
||||||
CargaHidendsAC()
|
|
||||||
End If
|
|
||||||
|
|
||||||
CalculaTotales(True)
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.UsaInventarios Then
|
|
||||||
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
|
|
||||||
|
|
||||||
If dr("Inventario").ToString = "1" Then
|
|
||||||
|
|
||||||
CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero
|
|
||||||
|
|
||||||
Dim Inv As New ClsInventarios
|
|
||||||
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
||||||
'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento")))
|
|
||||||
'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros)
|
|
||||||
|
|
||||||
ImgImprimirAlmacen.Visible = True
|
|
||||||
ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento"))
|
|
||||||
|
|
||||||
Dim drt As DataRow
|
|
||||||
'actualizo el almacen
|
|
||||||
For Each dri As DataRow In DtInv.Rows
|
|
||||||
|
|
||||||
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
|
||||||
If drt IsNot Nothing Then
|
|
||||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie
|
|
||||||
TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie
|
|
||||||
|
|
||||||
dri("CveAlmacen") = drt("CveAlmacen")
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Next
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Proceso Super Tramposo de Charlie
|
|
||||||
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then
|
|
||||||
Dim drt As DataRow
|
|
||||||
For Each dri As DataRow In DtInv.Rows
|
|
||||||
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
|
||||||
If drt IsNot Nothing Then
|
|
||||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0)
|
|
||||||
TmpDr("CveAlmacen") = drt("CveAlmacen")
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
|
|
||||||
Inv.Dispose()
|
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.UsaAC Then
|
||||||
|
CargaHidendsAC()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
CargaGvInv()
|
CalculaTotales(True)
|
||||||
|
|
||||||
'Ocultamos "Recibir Aqui"
|
If UsuarioActual.Empresa.UsaInventarios Then
|
||||||
GvInv.Columns(6).Visible = False
|
DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy
|
||||||
GvInv.Columns(7).Visible = False
|
|
||||||
|
|
||||||
|
If dr("Inventario").ToString = "1" Then
|
||||||
|
|
||||||
|
CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim Inv As New ClsInventarios
|
||||||
|
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||||
|
'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento")))
|
||||||
|
'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros)
|
||||||
|
|
||||||
|
ImgImprimirAlmacen.Visible = True
|
||||||
|
ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento"))
|
||||||
|
|
||||||
|
Dim drt As DataRow
|
||||||
|
'actualizo el almacen
|
||||||
|
For Each dri As DataRow In DtInv.Rows
|
||||||
|
|
||||||
|
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
||||||
|
If drt IsNot Nothing Then
|
||||||
|
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie
|
||||||
|
TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie
|
||||||
|
|
||||||
|
dri("CveAlmacen") = drt("CveAlmacen")
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Proceso Super Tramposo de Charlie
|
||||||
|
If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then
|
||||||
|
Dim drt As DataRow
|
||||||
|
For Each dri As DataRow In DtInv.Rows
|
||||||
|
drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad")))
|
||||||
|
If drt IsNot Nothing Then
|
||||||
|
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0)
|
||||||
|
TmpDr("CveAlmacen") = drt("CveAlmacen")
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
Inv.Dispose()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
CargaGvInv()
|
||||||
|
|
||||||
|
'Ocultamos "Recibir Aqui"
|
||||||
|
GvInv.Columns(6).Visible = False
|
||||||
|
GvInv.Columns(7).Visible = False
|
||||||
|
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
DdlTipoComprobante.Enabled = False
|
DdlTipoComprobante.Enabled = False
|
||||||
DdlTipoComprobante.SelectedValue = dr("TipoDocto").ToString
|
DdlTipoComprobante.SelectedValue = dr("TipoDocto").ToString
|
||||||
If dr("TipoDocto").ToString = "Fac" Then
|
If dr("TipoDocto").ToString = "Fac" Then
|
||||||
ChkAplicaNotaCredito.Enabled = True
|
ChkAplicaNotaCredito.Enabled = True
|
||||||
|
|||||||
@@ -273,188 +273,210 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
if (!ErrorProceso)
|
if (!ErrorProceso)
|
||||||
{
|
{
|
||||||
//////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. ");
|
try
|
||||||
int count = 2;
|
|
||||||
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
|
|
||||||
var wsVentas = wbVentas.Worksheet(1);
|
|
||||||
|
|
||||||
foreach (DataRow DRow in DTVentas.Rows)
|
|
||||||
{
|
{
|
||||||
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
|
||||||
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
|
//////////////////////////////////////////////////////////////
|
||||||
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
|
|
||||||
wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString();
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. ");
|
||||||
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
|
int count = 2;
|
||||||
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
|
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
|
||||||
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
|
this.GuardaLog($"EjecutaThalamus: archivo excel ventas cargado. ");
|
||||||
count++;
|
this.GuardaLog($"EjecutaThalamus: archivo excel ventas creando sheet.");
|
||||||
|
var wsVentas = wbVentas.Worksheet(1);
|
||||||
|
this.GuardaLog($"EjecutaThalamus: archivo excel ventas sheet creada.");
|
||||||
|
|
||||||
|
foreach (DataRow DRow in DTVentas.Rows)
|
||||||
|
{
|
||||||
|
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||||
|
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
|
||||||
|
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
|
||||||
|
wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString();
|
||||||
|
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
|
||||||
|
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
|
||||||
|
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " ");
|
||||||
|
wbVentas.SaveAs(RutaVentas);
|
||||||
|
|
||||||
|
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
|
||||||
|
var wsAlmacenes = wbAlmacenes.Worksheet(1);
|
||||||
|
|
||||||
|
count = 2;
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. ");
|
||||||
|
foreach (DataRow DRow in DTAlmacenes.Rows)
|
||||||
|
{
|
||||||
|
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
|
||||||
|
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
|
||||||
|
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
|
||||||
|
wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString();
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " ");
|
||||||
|
wbAlmacenes.SaveAs(RutaAlmacenes);
|
||||||
|
|
||||||
|
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
||||||
|
var wsClientes = wbAClientes.Worksheet(1);
|
||||||
|
|
||||||
|
count = 2;
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. ");
|
||||||
|
foreach (DataRow DRow in DTClientes.Rows)
|
||||||
|
{
|
||||||
|
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
||||||
|
wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString();
|
||||||
|
wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString();
|
||||||
|
wsClientes.Cell(count, 4).Value = DRow["email"].ToString();
|
||||||
|
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, 9).Value = DRow["address.street2"].ToString();
|
||||||
|
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
||||||
|
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
||||||
|
wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString();
|
||||||
|
wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString();
|
||||||
|
wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString();
|
||||||
|
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " ");
|
||||||
|
wbAClientes.SaveAs(RutaClientes);
|
||||||
|
|
||||||
|
var wbProductos = new ClosedXML.Excel.XLWorkbook(FormatoProductos);
|
||||||
|
var wsProductos = wbProductos.Worksheet(1);
|
||||||
|
|
||||||
|
count = 2;
|
||||||
|
this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. ");
|
||||||
|
foreach (DataRow DRow in DTProductos.Rows)
|
||||||
|
{
|
||||||
|
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
|
||||||
|
wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString();
|
||||||
|
wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString();
|
||||||
|
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " ");
|
||||||
|
wbProductos.SaveAs(RutaProductos);
|
||||||
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
}
|
}
|
||||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " ");
|
catch (Exception ex)
|
||||||
wbVentas.SaveAs(RutaVentas);
|
|
||||||
|
|
||||||
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
|
|
||||||
var wsAlmacenes = wbAlmacenes.Worksheet(1);
|
|
||||||
|
|
||||||
count = 2;
|
|
||||||
|
|
||||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. ");
|
|
||||||
foreach (DataRow DRow in DTAlmacenes.Rows)
|
|
||||||
{
|
{
|
||||||
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
|
this.GuardaLog($"EjecutaThalamus: Error procesamiento archivos exel " + ex.StackTrace.ToString() + " ");
|
||||||
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
|
ErrorProceso = true;
|
||||||
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
|
Respuesta = false;
|
||||||
wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString();
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " ");
|
|
||||||
wbAlmacenes.SaveAs(RutaAlmacenes);
|
|
||||||
|
|
||||||
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
|
||||||
var wsClientes = wbAClientes.Worksheet(1);
|
|
||||||
|
|
||||||
count = 2;
|
|
||||||
|
|
||||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. ");
|
|
||||||
foreach (DataRow DRow in DTClientes.Rows)
|
|
||||||
{
|
|
||||||
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
|
|
||||||
wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString();
|
|
||||||
wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString();
|
|
||||||
wsClientes.Cell(count, 4).Value = DRow["email"].ToString();
|
|
||||||
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, 9).Value = DRow["address.street2"].ToString();
|
|
||||||
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
|
||||||
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
|
||||||
wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString();
|
|
||||||
wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString();
|
|
||||||
wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString();
|
|
||||||
|
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " ");
|
if (!ErrorProceso)
|
||||||
wbAClientes.SaveAs(RutaClientes);
|
|
||||||
|
|
||||||
var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos);
|
|
||||||
var wsProductos = wbProductos.Worksheet(1);
|
|
||||||
|
|
||||||
count = 2;
|
|
||||||
this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. ");
|
|
||||||
foreach (DataRow DRow in DTProductos.Rows)
|
|
||||||
{
|
{
|
||||||
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
|
var FInfoProductos = new FileInfo(RutaProductos);
|
||||||
wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString();
|
var FInfoVentas = new FileInfo(RutaVentas);
|
||||||
wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString();
|
var FInfoClientes = new FileInfo(RutaClientes);
|
||||||
|
var FInfoAlmacenes = new FileInfo(RutaAlmacenes);
|
||||||
|
|
||||||
count++;
|
bool CargaProductos = false;
|
||||||
}
|
bool CargaVentas = false;
|
||||||
this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " ");
|
bool CargaClientes = false;
|
||||||
wbProductos.SaveAs(RutaProductos);
|
bool CargaAlmacenes = false;
|
||||||
/////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
var FInfoProductos = new FileInfo(RutaProductos);
|
SBLog.AppendLine("<b>Cargas</b><br>");
|
||||||
var FInfoVentas = new FileInfo(RutaVentas);
|
SBLog.AppendLine("<table border='1'> <tr><th>Archivo</th><th>Estado</th></tr>");
|
||||||
var FInfoClientes = new FileInfo(RutaClientes);
|
|
||||||
var FInfoAlmacenes = new FileInfo(RutaAlmacenes);
|
|
||||||
|
|
||||||
bool CargaProductos = false;
|
|
||||||
bool CargaVentas = false;
|
|
||||||
bool CargaClientes = false;
|
|
||||||
bool CargaAlmacenes = false;
|
|
||||||
|
|
||||||
SBLog.AppendLine("<b>Cargas</b><br>");
|
|
||||||
SBLog.AppendLine("<table border='1'> <tr><th>Archivo</th><th>Estado</th></tr>");
|
|
||||||
|
|
||||||
|
|
||||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. ");
|
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. ");
|
||||||
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
|
CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass);
|
||||||
|
|
||||||
if (CargaProductos)
|
if (CargaProductos)
|
||||||
{
|
{
|
||||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. ");
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. ");
|
||||||
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
|
CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CargaProductos)
|
if (CargaProductos)
|
||||||
{
|
{
|
||||||
SBLog.AppendLine($"<tr><td>Productos</td><td>ok</td></tr>");
|
SBLog.AppendLine($"<tr><td>Productos</td><td>ok</td></tr>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SBLog.AppendLine($"<tr><td>Productos</td><td>Error carga</td></tr>");
|
SBLog.AppendLine($"<tr><td>Productos</td><td>Error carga</td></tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CargaProductos)
|
||||||
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. ");
|
||||||
|
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||||
|
if (CargaVentas)
|
||||||
|
{
|
||||||
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. ");
|
||||||
|
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (CargaProductos)
|
|
||||||
{
|
|
||||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. ");
|
|
||||||
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
|
||||||
if (CargaVentas)
|
if (CargaVentas)
|
||||||
{
|
{
|
||||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. ");
|
SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>");
|
||||||
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (CargaVentas)
|
if (CargaProductos & CargaVentas)
|
||||||
{
|
{
|
||||||
SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>");
|
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. ");
|
||||||
}
|
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||||
else
|
if (CargaClientes)
|
||||||
{
|
{
|
||||||
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>");
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. ");
|
||||||
}
|
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (CargaProductos & CargaVentas)
|
|
||||||
{
|
|
||||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. ");
|
|
||||||
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
|
||||||
if (CargaClientes)
|
if (CargaClientes)
|
||||||
{
|
{
|
||||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. ");
|
SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>");
|
||||||
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
if (CargaClientes)
|
|
||||||
{
|
|
||||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error carga</td></tr>");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CargaProductos & CargaVentas & CargaClientes)
|
|
||||||
{
|
|
||||||
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. ");
|
|
||||||
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
|
||||||
if (CargaClientes)
|
|
||||||
{
|
{
|
||||||
this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. ");
|
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error carga</td></tr>");
|
||||||
CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (CargaAlmacenes)
|
if (CargaProductos & CargaVentas & CargaClientes)
|
||||||
{
|
{
|
||||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>");
|
this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. ");
|
||||||
}
|
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
||||||
else
|
if (CargaClientes)
|
||||||
{
|
{
|
||||||
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error carga</td></tr>");
|
this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. ");
|
||||||
}
|
CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CargaAlmacenes)
|
||||||
|
{
|
||||||
|
SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error carga</td></tr>");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CargaProductos & CargaVentas & CargaClientes & CargaAlmacenes)
|
if (CargaProductos & CargaVentas & CargaClientes & CargaAlmacenes)
|
||||||
{
|
{
|
||||||
Respuesta = true;
|
Respuesta = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
Respuesta = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}else
|
||||||
{
|
{
|
||||||
Respuesta = false;
|
Respuesta = false;
|
||||||
}
|
}
|
||||||
@@ -505,8 +527,8 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
|
|
||||||
ClsSisMail Correo = new ClsSisMail();
|
ClsSisMail Correo = new ClsSisMail();
|
||||||
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
|
||||||
// string Para = "oscar.irigoyen@adssistemas.mx";
|
// string Para = "oscar.irigoyen@adssistemas.mx";
|
||||||
string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}";
|
string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}";
|
||||||
|
|
||||||
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);
|
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);
|
||||||
|
|||||||
Reference in New Issue
Block a user