Commit inicial Ventas Productivo
This commit is contained in:
120
RH/RepUniformes.aspx.vb
Normal file
120
RH/RepUniformes.aspx.vb
Normal file
@@ -0,0 +1,120 @@
|
||||
Option Strict On
|
||||
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
|
||||
|
||||
Partial Class RH_RepUniformes
|
||||
Inherits ClsPaginas
|
||||
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Sub RH_RepUniformes_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)
|
||||
DdlSubProyecto.DataBind()
|
||||
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlDepartamento.DataSource = GlobalDTDepartamentos.FiltraParametros("CveEmpresa =" & UsuarioActual.CveEmpresa & " AND Departamento <> 'Seleccione' ")
|
||||
DdlDepartamento.DataBind()
|
||||
DdlDepartamento.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
TxtFechaInicio.Text = Now.ToString("dd/MM/yyyy")
|
||||
TxtFechaFin.Text = Now.AddMonths(1).ToString("dd/MM/yyyy")
|
||||
|
||||
CargaDatos()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim objRH As New ClsRH
|
||||
|
||||
If objRH.UniformesRepGet(DdlSubProyecto.SelectedValue.ToEntero, DdlDepartamento.SelectedValue.ToEntero, TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, UsuarioActual.CveEmpresa) Then
|
||||
GvUniformes.DataSource = objRH.DtResultados
|
||||
DTDatos = objRH.DtResultados
|
||||
Else
|
||||
GvUniformes.DataSource = Nothing
|
||||
DTDatos = Nothing
|
||||
End If
|
||||
|
||||
objRH.Dispose()
|
||||
|
||||
GvUniformes.DataBind()
|
||||
UpGvUniforme.Update()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "I M P R I M I R P D F/Excel"
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub LinkPDF_Click(sender As Object, e As EventArgs) Handles LinkPDF.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
|
||||
|
||||
If DTDatos.Rows.Count > 0 Then
|
||||
Dim ObjTareas As New ClsOIEventos
|
||||
|
||||
Dim params As New List(Of ReportParameter)
|
||||
|
||||
|
||||
|
||||
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 Filtros As String = "<b>Filtros: </b> "
|
||||
|
||||
|
||||
|
||||
'Dim FechaI, FechaF As String
|
||||
|
||||
' params.Add(New ReportParameter("AgrupadoPor", Filtros))
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
'params.Add(New ReportParameter("FechaInicio", FechaI))
|
||||
'params.Add(New ReportParameter("FechaFin", FechaF))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas\Grales\Formatos\RepUniformes.rdlc", DTDatos, params, "ReporteUniformes", Formato:=Formato)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user