Commit inicial Ventas Productivo
This commit is contained in:
151
Acarreos/RepPreEstimacionDetalle.aspx.vb
Normal file
151
Acarreos/RepPreEstimacionDetalle.aspx.vb
Normal file
@@ -0,0 +1,151 @@
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Drawing
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Acarreos_RepPreEstimacionDetalle
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property CveAcarreoProyecto As Integer
|
||||
Get
|
||||
CveAcarreoProyecto = ViewState("CveAcarreoProyecto").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveAcarreoProyecto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveMaterial As Integer
|
||||
Get
|
||||
CveMaterial = ViewState("CveMaterial").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMaterial") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property NumPreEstimacion As Integer
|
||||
Get
|
||||
NumPreEstimacion = ViewState("NumPreEstimacion").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("NumPreEstimacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTCont As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DTCont")), Nothing, CType(ViewState("DTCont"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTCont") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CveAcarreoProyecto = IfNull(Request("CveAcarreoProyecto"), "").ToString.ToEntero
|
||||
CveMaterial = IfNull(Request("CveMaterial"), "").ToString.ToEntero
|
||||
NumPreEstimacion = IfNull(Request("NumPreEstimacion"), "").ToString.ToEntero
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjAcar As New ClsAcarreos
|
||||
If ObjAcar.GetRepPreEstimacionDetalle(CveAcarreoProyecto, CveMaterial, UsuarioActual.CveEmpresa, NumPreEstimacion) Then
|
||||
GvDatos.DataSource = ObjAcar.DtResultados
|
||||
GvDatos.DataBind()
|
||||
DTCont = ObjAcar.DtResultados
|
||||
End If
|
||||
ObjAcar.Dispose()
|
||||
UPDatos.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.FCLiteral("LtlFolio").Text = "" Then
|
||||
e.Row.FCLiteral("LtlFolio").Text = e.Row.DBCampo("Gpo")
|
||||
e.Row.CssClass = "Totales"
|
||||
Else
|
||||
Dim Css As String = "Texto"
|
||||
Dim Liga As String = $"/Acarreos/RegistroAcarreo.aspx?&CveAcarreo={e.Row.DBCampo("CveAcarreo")}"
|
||||
e.Row.FCLiteral("LtlFolio").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlFolio").Text & "</a>"
|
||||
End If
|
||||
|
||||
|
||||
e.Row.FCLiteral("LtlImporte").Text = "$" + FormatNumber(e.Row.FCLiteral("LtlImporte").Text, 2, , , TriState.True)
|
||||
e.Row.FCLiteral("LtlVolumen").Text = FormatNumber(e.Row.FCLiteral("LtlVolumen").Text, 2, , , TriState.True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "PDF"
|
||||
Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
|
||||
|
||||
If DTCont IsNot Nothing Then
|
||||
Dim StrFiltro As New StringBuilder
|
||||
StrFiltro.AppendFormat(" <b>Numero de Pre-Estimacion</b>: {0}", NumPreEstimacion)
|
||||
|
||||
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepPreEstimacionDetalle.rdlc", DTCont, params, String.Format("RepPreEstimacionDetalle-{0}", Now.ToDateTime.ToShortDateString))
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "EXCEL"
|
||||
|
||||
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
|
||||
If DTCont IsNot Nothing Then
|
||||
Dim StrFiltro As New StringBuilder
|
||||
StrFiltro.AppendFormat(" <b>Numero de Pre-Estimacion</b>: {0}", NumPreEstimacion)
|
||||
|
||||
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepPreEstimacionDetalle.rdlc", DTCont, params, String.Format("RepPreEstimacionDetalle-{0}", Now.ToDateTime.ToShortDateString), "Excel")
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user