mails citrus get
This commit is contained in:
@@ -3480,6 +3480,25 @@ Public Class ClsCGame
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
Public Function MailsGet(cveMails As Int32, cveUsuarioCorreo As Int32, cveUsuario As Int32, cveEmpresa As Int32, tipo As Int32) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_CGame_MailsGet", CommandType.StoredProcedure)
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveMails", SqlDbType.Int).Value = cveMails
|
||||||
|
.Add("@CveUsuarioCorreo", SqlDbType.Int).Value = cveUsuarioCorreo
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = cveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
|
||||||
|
.Add("@Tipo", SqlDbType.Int).Value = tipo
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el reporte de inventario diario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
#Region "IDisposable Support"
|
#Region "IDisposable Support"
|
||||||
' IDisposable
|
' IDisposable
|
||||||
Protected Overridable Sub Dispose(disposing As Boolean)
|
Protected Overridable Sub Dispose(disposing As Boolean)
|
||||||
|
|||||||
@@ -235,6 +235,9 @@ Partial Class PopUpVerFactura
|
|||||||
If Request("onlyPrint").ToString() = "CitrusInventarioDiarioxls" AndAlso Not IsNothing(Request("fecha")) Then
|
If Request("onlyPrint").ToString() = "CitrusInventarioDiarioxls" AndAlso Not IsNothing(Request("fecha")) Then
|
||||||
imprimirRepcitrusInventarioDiario(Request("fecha").ToString(), "Excel")
|
imprimirRepcitrusInventarioDiario(Request("fecha").ToString(), "Excel")
|
||||||
End If
|
End If
|
||||||
|
If Request("onlyPrint").ToString() = "CitrusInventarioDiarioSendMail" AndAlso Not IsNothing(Request("fecha")) Then
|
||||||
|
imprimirRepcitrusInventarioDiario(Request("fecha").ToString(), "PDF", True)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -342,11 +345,11 @@ Partial Class PopUpVerFactura
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Sub imprimirRepcitrusInventarioDiario(fecha As String, formato As String)
|
Private Sub imprimirRepcitrusInventarioDiario(fecha As String, formato As String, Optional EnviarCorrreo As Boolean = False)
|
||||||
Dim totalPallets As String = ""
|
Dim totalPallets As String = ""
|
||||||
Dim totalBachas As String = ""
|
Dim totalBachas As String = ""
|
||||||
Dim dfec As DateTime = fecha.ToDateTime()
|
Dim dfec As DateTime = fecha.ToDateTime()
|
||||||
Dim fechas As String = String.Format(New System.Globalization.CultureInfo("es-MX"), "{0:dd} de {0:MMMM} del {0:yyyy}", dfec)
|
Dim fechas As String = String.Format(New System.Globalization.CultureInfo("es-MX"), "{0:dd} DE {0:MMMM} DEL {0:yyyy}", dfec)
|
||||||
Dim totalcajas As String = ""
|
Dim totalcajas As String = ""
|
||||||
Dim TotalBins As String = ""
|
Dim TotalBins As String = ""
|
||||||
|
|
||||||
@@ -382,7 +385,31 @@ Partial Class PopUpVerFactura
|
|||||||
|
|
||||||
'"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
|
'"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc"
|
||||||
Dim rutardlc = "Formatos\RepAgroInventarioDiario.rdlc"
|
Dim rutardlc = "Formatos\RepAgroInventarioDiario.rdlc"
|
||||||
ImprimirPDF(rutardlc, lrds, params, "Inventario", formato) ', Content_Disposition:="Inline")
|
If EnviarCorrreo Then
|
||||||
|
ImprimirPDF(rutardlc, lrds, params, "Inventario", formato) ', Content_Disposition:="Inline")
|
||||||
|
Else
|
||||||
|
Dim para As String = "caudillo.90d@gmail.com"
|
||||||
|
Dim dtCorreos As DataTable = New DataTable()
|
||||||
|
Dim archivoBinario As Byte() = StreamPDF(rutardlc, lrds, params, "Inventario", formato)
|
||||||
|
|
||||||
|
Using objnom As New ClsCGame
|
||||||
|
If objnom.MailsGet(-1, -1, -1, UsuarioActual.CveEmpresa, 2) Then
|
||||||
|
dtCorreos = objnom.DtResultados
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
For Each row As DataRow In dtCorreos.Rows
|
||||||
|
para = String.Format("{0},", para, row("Correo"))
|
||||||
|
Next
|
||||||
|
|
||||||
|
|
||||||
|
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||||
|
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = archivoBinario, .NombreArchivo = String.Format("Inventario {0}.pdf", fechas)})
|
||||||
|
|
||||||
|
|
||||||
|
Dim Mail As New ClsSisMail()
|
||||||
|
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, para, String.Format("Reporte de Inventario del {0}", fechas), "", "", Archivos:=LSRutasMail)
|
||||||
|
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
@@ -6974,9 +7001,9 @@ Partial Class PopUpVerFactura
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ImprimirPDF(RutaReporte, DtDetalle, params, $"P{TipoPolizaString}{FolioPoliza}", Formato:="PDF")
|
ImprimirPDF(RutaReporte, DtDetalle, params, $"P{TipoPolizaString}{FolioPoliza}", Formato:="PDF")
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
|
|||||||
Reference in New Issue
Block a user