From 53bf07107965df7b834abaf0f9bc382bd04f5577 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 28 Sep 2020 18:33:51 -0700 Subject: [PATCH 1/4] Cambio entre portales (portal del proveedor) --- App_Code/ClsSisUsuarios.vb | 109 ++++++++++++++++++++++- Sistemas/PopUpAddUsuario.aspx.vb | 16 +++- Sistemas/PopUpSeleccionarEmpresa.aspx | 17 ++++ Sistemas/PopUpSeleccionarEmpresa.aspx.vb | 62 ++++++++++--- 4 files changed, 191 insertions(+), 13 deletions(-) diff --git a/App_Code/ClsSisUsuarios.vb b/App_Code/ClsSisUsuarios.vb index 298590f13..c1f9e640a 100644 --- a/App_Code/ClsSisUsuarios.vb +++ b/App_Code/ClsSisUsuarios.vb @@ -416,7 +416,7 @@ Public Class ClsSisUsuarios End Function - Public Function ValidaUsuarioPortalCliente(Clave As String, Usuario As String, Password As String) As Usuario + Public Function ValidaUsuarioPortalCliente(CveCliente As Integer, Usuario As String, Password As String) As Usuario Dim Retorno As Usuario = Nothing DataAdapter("PA_Sis_UsuariosGet") @@ -442,7 +442,7 @@ Public Class ClsSisUsuarios Retorno.Rol = Data.Rows(0)("Rol").ToString 'Retorno.NombreEmpresa = Data.Rows(0)("Empresa").ToString Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero - Retorno.CveCliente = Clave.ToEntero + Retorno.CveCliente = CveCliente Retorno.ClienteGPS = False Retorno.Portal = True Retorno.Referencia = Data.Rows(0)("Referencia").ToString @@ -473,6 +473,64 @@ Public Class ClsSisUsuarios Return Retorno End Function + Public Function ValidaUsuarioPortalProveedor(CveProveedor As Integer, Usuario As String, Password As String) As Usuario + Dim Retorno As Usuario = Nothing + + DataAdapter("PA_Sis_UsuariosGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveUsuario", SqlDbType.Int).Value = -1 + .Add("@CveRol", SqlDbType.Int).Value = -1 + .Add("@Usuario", SqlDbType.VarChar).Value = Usuario + .Add("@Contraseña", SqlDbType.VarChar).Value = Password + .Add("@EsLogIn", SqlDbType.Bit).Value = 1 + End With + + Try + SqlAdapter.Fill(Data) + If Data.Rows.Count > 0 Then + Retorno = New Usuario + + Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero + Retorno.Usuario = Usuario + Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString + Retorno.Nombre = Data.Rows(0)("Nombre").ToString + Retorno.CveRol = Data.Rows(0)("CveRol").ToString.ToEntero + Retorno.Rol = Data.Rows(0)("Rol").ToString + 'Retorno.NombreEmpresa = Data.Rows(0)("Empresa").ToString + Retorno.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero + Retorno.CveProveedor = CveProveedor + Retorno.ClienteGPS = False + Retorno.Portal = True + Retorno.Referencia = Data.Rows(0)("Referencia").ToString + Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False) + 'Retorno.Liga = Data.Rows(0)("Liga").ToString + 'cargo los modulos del usuario y genero el menú + Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveProveedor) + + Dim UsuariosModulos As New HybridDictionary + For Each Row As DataRow In dttmp.Rows + UsuariosModulos.Add(Convert.ToInt32(Row("CveModulo")), Row("CveModulo").ToString) + Next + + Retorno.Modulos = UsuariosModulos + ''cargo los procesos del usuario + dttmp = GetUsuariosRolesProcesos(Retorno.CveUsuario) + Dim UsuariosProcesos As New HybridDictionary + For Each Row As DataRow In dttmp.Rows + UsuariosProcesos.Add(Convert.ToInt32(Row("CveProceso")), Row("CveProceso").ToString) + Next + Retorno.Procesos = UsuariosProcesos + End If + + Catch ex As SqlException + OnError("Ocurrio un error al Iniciar Acceso a Sitio.", ex) + Retorno = Nothing + End Try + + Return Retorno + End Function + #Region "U S U A R I O - I N D I C A D O R E S" Public Function getUsuarioIndicadores(_CveUsuario As Integer, _CveEmpresa As Integer, _CveRol As Integer) As DataTable @@ -2740,6 +2798,30 @@ Public Class ClsSisUsuarios .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya existe un Usuario con el mismo nombre: " & Usuario & ".", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar el nuevo usuario", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error el acceso a clientes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function AddUsuarioProveedor(CveUsuario As Integer, CveProveedor As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_UsuariosProveedoresAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + Try SqlAdapter.Fill(Data) Retorno = True @@ -2755,6 +2837,29 @@ Public Class ClsSisUsuarios Return Retorno End Function + Public Function GetUsuarioProveedor(CveUsuario As Integer, CveProveedor As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Sis_UsuariosProveedorGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + If Ex1.Message.Contains("Número: 2627;") Then + Alert("Ya existe un Usuario con el mismo nombre: " & Usuario & ".", TipoMensaje.MsgAdvertencia) + Else + Me.OnError("Ocurrió un error al guardar el nuevo usuario", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If + Catch ex As Exception + OnError("Ocurrió un error al obtener el acceso a proveedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function #End Region diff --git a/Sistemas/PopUpAddUsuario.aspx.vb b/Sistemas/PopUpAddUsuario.aspx.vb index 58101c3ed..22ed375a3 100644 --- a/Sistemas/PopUpAddUsuario.aspx.vb +++ b/Sistemas/PopUpAddUsuario.aspx.vb @@ -371,7 +371,8 @@ Partial Class Sistemas_PopUpAddUsuario ' Return 'End If - If UsuarioActual.Empresa.CvePlataforma = 1 Then + 'SI ES UN USUARIO DEL ERP, DEBE DARLE ACCESO AL CLIENTE + If UsuarioActual.Empresa.CvePlataforma = 1 AndAlso CveCliente > 0 Then Dim DtClientesAcceso As DataTable = Nothing If Not HuboError AndAlso ObjUsuarios.GetUsuarioCliente(CveUsuario, CveCliente) Then 'DEBE AGREGAR EL USUARIO AL CLIENTE @@ -383,6 +384,19 @@ Partial Class Sistemas_PopUpAddUsuario Else HuboError = True End If + 'SI ES UN USUARIO DEL ERP, DEBE DARLE ACCESO AL PROVEEDOR + ElseIf UsuarioActual.Empresa.CvePlataforma = 1 AndAlso CveProveedor > 0 Then + Dim DtProveedoresAcceso As DataTable = Nothing + If Not HuboError AndAlso ObjUsuarios.GetUsuarioProveedor(CveUsuario, CveProveedor) Then + 'DEBE AGREGAR EL USUARIO AL PROVEEDOR + If ObjUsuarios.DtResultados.Rows.Count = 0 Then + If Not HuboError AndAlso Not ObjUsuarios.AddUsuarioProveedor(CveUsuario, CveProveedor) Then + HuboError = True + End If + End If + Else + HuboError = True + End If ElseIf UsuarioActual.Empresa.CvePlataforma = 3 Then If Not ObjUsuarios.UpdateUsuario(LtlUsuario.Text.Trim, TxtNombre.Text, -1, TxtEmail.Text, -1, -1, False, True, -1, CveUsuario, -1, -1) Then HuboError = True diff --git a/Sistemas/PopUpSeleccionarEmpresa.aspx b/Sistemas/PopUpSeleccionarEmpresa.aspx index 4ba92eb82..38fdabe9d 100644 --- a/Sistemas/PopUpSeleccionarEmpresa.aspx +++ b/Sistemas/PopUpSeleccionarEmpresa.aspx @@ -75,6 +75,20 @@ + + + + Portal del Proveedor + + + + + + + + @@ -110,6 +124,9 @@ function Ir4() { gotourl('/PortalCliente/PortalCliente.aspx'); } + function Ir5() { + gotourl('/PortalProveedor/PortalProveedor.aspx'); + } function buscarDT() { $('.TxtBusqueda').on('keyup', function () { diff --git a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb index 04470a006..d0f150423 100644 --- a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb +++ b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb @@ -12,8 +12,6 @@ Partial Class PopUpSeleccionarEmpresa Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then CType(Me.Master, BaseMasterPage).EsPopup = True - 'CType(Me.Master, BaseMasterPage).PopupWidth = HdnAncho.Value.ToEntero - 'RegistraScript("alertSize();") GetEmpresas() End If End Sub @@ -26,10 +24,14 @@ Partial Class PopUpSeleccionarEmpresa LtlTotalRegistros.Text = Dt.Rows.Count.ToString.FormatoNumero(0) GvEmpresas.DataSource = Dt.FiltraParametros("CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)", "Empresa") GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa") - GvPortalCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 6 AND CveCliente IS NOT NULL", "Empresa") + GvPortalCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 6 AND CveCliente IS NOT NULL", "Empresa") + GvPortalProveedor.DataSource = Dt.FiltraParametros("CvePlataforma = 7 AND CveProveedor IS NOT NULL", "Empresa") Else LtlTotalRegistros.Text = "0" GvEmpresas.DataSource = Nothing + GvPortalRastreo.DataSource = Nothing + GvPortalCliente.DataSource = Nothing + GvPortalProveedor.DataSource = Nothing Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia) End If End If @@ -37,6 +39,7 @@ Partial Class PopUpSeleccionarEmpresa GvEmpresas.DataBind() GvPortalRastreo.DataBind() GvPortalCliente.DataBind() + GvPortalProveedor.DataBind() UPDatos.Update() @@ -116,7 +119,6 @@ Partial Class PopUpSeleccionarEmpresa End If End Sub - Protected Sub GvPortalCliente_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalCliente.RowCommand If e.CommandName = "Cambia" Then Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) @@ -125,7 +127,7 @@ Partial Class PopUpSeleccionarEmpresa Dim ObjUsuario As New ClsSisUsuarios Dim Usuario As Usuario = Nothing - Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente"), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña")) + Usuario = ObjUsuario.ValidaUsuarioPortalCliente(gvr.DataKey("CveCliente").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña")) ObjUsuario.Dispose() @@ -155,7 +157,48 @@ Partial Class PopUpSeleccionarEmpresa End If End If - End Sub + End Sub + Protected Sub GvPortalProveedor_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GvPortalProveedor.RowCommand + If e.CommandName = "Cambia" Then + Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) + + If gvr IsNot Nothing Then + + Dim ObjUsuario As New ClsSisUsuarios + Dim Usuario As Usuario = Nothing + Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña")) + + ObjUsuario.Dispose() + + If Usuario IsNot Nothing Then + Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario) + + Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion + Usuario.ModoSimulacion = ModoSimulacion + ADSSession.ADSSessionConfig.sessionUser = Usuario + ADSSession.ADSSessionConfig.sessionDpage = False + + If dt IsNot Nothing Then + If dt.Rows.Count >= 1 Then + If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True + Usuario.CvePlataforma = 7 + UsuarioActual.CveEmpresa = gvr.DataKey("CveEmpresa").ToEntero() + ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, UsuarioActual.CveEmpresa) + CreaObjetoEmpresa(Usuario) + 'si la contraseña es la prederminada, pide la nueva contraseña + 'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False) + RegistraScript("Ir5();") + End If + End If + dt.Dispose() + End If + + End If + + End If + End Sub + +#Region "F U N C I O N E S" Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click RegistraScript(String.Format("$get('tdContenido').style.height='{0}px'; $get('tdContenido').style.width='{1}px'", HdnAlto.Value.ToEntero - 30, HdnAncho.Value.ToEntero - 30)) End Sub @@ -181,8 +224,6 @@ Partial Class PopUpSeleccionarEmpresa End If ObjEmpresa.Dispose() End Sub - - Private Sub GuardaLogR(Mensaje As String) Dim ArchivoW As IO.StreamWriter Dim MensajeLog As String = "" @@ -209,6 +250,7 @@ Partial Class PopUpSeleccionarEmpresa End Try ArchivoW.Close() ArchivoW.Dispose() - End Sub - + End Sub +#End Region + End Class \ No newline at end of file From 81b2ef824a71383455819b7f7d7ab4fa46fff85c Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 29 Sep 2020 15:55:12 -0700 Subject: [PATCH 2/4] Cambios entre portales --- Sistemas/PopUpSeleccionarEmpresa.aspx | 2 +- Sistemas/PopUpSeleccionarEmpresa.aspx.vb | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Sistemas/PopUpSeleccionarEmpresa.aspx b/Sistemas/PopUpSeleccionarEmpresa.aspx index 38fdabe9d..efd3192d7 100644 --- a/Sistemas/PopUpSeleccionarEmpresa.aspx +++ b/Sistemas/PopUpSeleccionarEmpresa.aspx @@ -29,7 +29,7 @@
- diff --git a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb index d0f150423..32de18d83 100644 --- a/Sistemas/PopUpSeleccionarEmpresa.aspx.vb +++ b/Sistemas/PopUpSeleccionarEmpresa.aspx.vb @@ -21,11 +21,20 @@ Partial Class PopUpSeleccionarEmpresa If Dt IsNot Nothing Then If Dt.Rows.Count > 0 Then - LtlTotalRegistros.Text = Dt.Rows.Count.ToString.FormatoNumero(0) - GvEmpresas.DataSource = Dt.FiltraParametros("CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)", "Empresa") + Dim NumRegistros As Integer = 0 + GvEmpresas.DataSource = Dt.FiltraParametros("(CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)) AND CvePlataformaUsuario NOT IN (6,7)", "Empresa") + NumRegistros += DirectCast(GvEmpresas.DataSource, System.Data.DataTable).Rows.Count + GvPortalRastreo.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa") + NumRegistros += DirectCast(GvPortalRastreo.DataSource, System.Data.DataTable).Rows.Count + GvPortalCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 6 AND CveCliente IS NOT NULL", "Empresa") - GvPortalProveedor.DataSource = Dt.FiltraParametros("CvePlataforma = 7 AND CveProveedor IS NOT NULL", "Empresa") + NumRegistros += DirectCast(GvPortalCliente.DataSource, System.Data.DataTable).Rows.Count + + GvPortalProveedor.DataSource = Dt.FiltraParametros("CvePlataforma = 7 AND CveProveedor IS NOT NULL", "Empresa") + NumRegistros += DirectCast(GvPortalProveedor.DataSource, System.Data.DataTable).Rows.Count + + LtlTotalRegistros.Text = NumRegistros.ToString().FormatoNumero(0) Else LtlTotalRegistros.Text = "0" GvEmpresas.DataSource = Nothing From f53dc040c2af42edf6c6772e7f8b868058714e3e Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 29 Sep 2020 15:55:29 -0700 Subject: [PATCH 3/4] Validacion en WS --- asmx/WSApp.asmx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index fa5c03748..7917b12e9 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -548,15 +548,19 @@ Public Class WSApp Salida.CveSubProyecto = UsuarioActual.CveSubProyecto Salida.Procesos = UsuarioActual.Procesos.Values.Cast(Of String).ToList() - If ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + If UsuarioActual.CveCliente > 0 AndAlso ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then If ObjClientes.DtResultados.Rows.Count > 0 Then Salida.Cliente = ObjClientes.Nombre Salida.CvePrecioLista = ObjClientes.CvePrecioLista - Salida.CveEstatusCliente = If(ObjClientes.Estatus, 1, 0) - End If - End If - - retorno = JsonConvert.SerializeObject(Salida) + Salida.CveEstatusCliente = If(ObjClientes.Estatus, 1, 0) + + retorno = JsonConvert.SerializeObject(Salida) + End If + Else + retorno = "{}" + End If + + Else retorno = "{}" End If From 6a6c7a70d8b90595b05f01a46d1a41d3406a1b9c Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Tue, 29 Sep 2020 16:56:48 -0700 Subject: [PATCH 4/4] Talamus --- TareasProgramadas/Tareas119.ashx | 56 +++++++++++++++++--------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index a123a8239..9617b6a33 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -94,14 +94,14 @@ public class TareasJam : IHttpHandler //"ftp://us2.hostedftp.com/", "agrojam", "A12345678"; - //string FTPServer = "ftp://127.0.0.1/"; - //string TFPUsr = "Toor"; - //string FTPPass = "agj-3500"; + string FTPServer = "ftp://127.0.0.1/"; + string TFPUsr = "Toor"; + string FTPPass = "agj-3500"; - string FTPServer = "ftp://us2.hostedftp.com"; - string TFPUsr = "agrojam"; - string FTPPass = "A12345678"; + //string FTPServer = "ftp://us2.hostedftp.com"; + //string TFPUsr = "agrojam"; + //string FTPPass = "A12345678"; bool ErrorProceso = false; @@ -198,8 +198,8 @@ public class TareasJam : IHttpHandler DTAlmacenes.AcceptChanges(); - DataTable dtCloned = DTVentas.Clone(); - dtCloned.Columns[3].DataType = typeof(string); + DataTable dtCloned = DTVentas.Clone(); + dtCloned.Columns[3].DataType = typeof(DateTime); foreach (DataRow row in DTVentas.Rows) { @@ -207,17 +207,17 @@ public class TareasJam : IHttpHandler } DTVentas = dtCloned; - foreach(DataRow dRow in DTVentas.Rows) + foreach (DataRow dRow in DTVentas.Rows) { - string tmpString = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd"); - dRow[3] = tmpString; + DateTime tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd").ToDate(); + dRow[3] = tmpDate; } DTVentas.AcceptChanges(); - dtCloned = DTAlmacenes.Clone(); - dtCloned.Columns[3].DataType = typeof(string); + dtCloned = DTAlmacenes.Clone(); + dtCloned.Columns[3].DataType = typeof(DateTime); foreach (DataRow row in DTAlmacenes.Rows) { @@ -225,10 +225,10 @@ public class TareasJam : IHttpHandler } DTAlmacenes = dtCloned; - foreach(DataRow dRow in DTAlmacenes.Rows) + foreach (DataRow dRow in DTAlmacenes.Rows) { - string tmpString = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd"); - dRow[3] = tmpString; + DateTime tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd").ToDate(); + dRow[3] = tmpDate; } DTAlmacenes.AcceptChanges(); @@ -252,6 +252,16 @@ public class TareasJam : IHttpHandler SpreadsheetInfo.SetLicense(Extensiones.ModExtensiones.SerialGemBoxSpreadsheet()); + var workbookAlmacenes = new ExcelFile(); + var worksheetAlmacenes = workbookAlmacenes.Worksheets.Add("Almacenes"); + worksheetAlmacenes.InsertDataTable(DTAlmacenes, new InsertDataTableOptions() + { + ColumnHeaders = true, + StartRow = 0 + }); + worksheetAlmacenes.Columns[3].Style.NumberFormat = "yyyy/MM/dd"; + workbookAlmacenes.Save(RutaAlmacenes); + var workbookProductos = new ExcelFile(); var worksheetProductos = workbookProductos.Worksheets.Add("Productos"); worksheetProductos.InsertDataTable(DTProductos, new InsertDataTableOptions() @@ -268,6 +278,7 @@ public class TareasJam : IHttpHandler ColumnHeaders = true, StartRow = 0 }); + worksheetVentas.Columns[3].Style.NumberFormat = "yyyy/MM/dd"; workbookVentas.Save(RutaVentas); @@ -281,14 +292,7 @@ public class TareasJam : IHttpHandler workbookClientes.Save(RutaClientes); - var workbookAlmacenes = new ExcelFile(); - var worksheetAlmacenes = workbookAlmacenes.Worksheets.Add("Almacenes"); - worksheetAlmacenes.InsertDataTable(DTAlmacenes, new InsertDataTableOptions() - { - ColumnHeaders = true, - StartRow = 0 - }); - workbookAlmacenes.Save(RutaAlmacenes); + var FInfoProductos = new FileInfo(RutaProductos); @@ -434,8 +438,8 @@ public class TareasJam : IHttpHandler ClsSisMail Correo = new ClsSisMail(); - string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx"; - //string Para = "oscar.irigoyen@adssistemas.mx"; + // string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;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")}"; Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);