Commit inicial Ventas Productivo
This commit is contained in:
104
Ventas/RepArqueos.aspx.vb
Normal file
104
Ventas/RepArqueos.aspx.vb
Normal file
@@ -0,0 +1,104 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Data
|
||||
Partial Class Ventas_RepArqueos
|
||||
Inherits ClsPaginas
|
||||
#Region "P R O P I E D A D E S"
|
||||
Private Property DtProductos As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtProductos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtProductos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDepositos As DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtDepositos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDepositos") = 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
|
||||
CargaCombos()
|
||||
CargaDatos(Now.Year, -1)
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaCombos()
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("TipoSucursal = 1")
|
||||
DdlSubProyecto.DataBind()
|
||||
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos(Anio As Integer, CveSubProyecto As Integer)
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetRepArqueos(Anio, CveSubProyecto, UsuarioActual.CveEmpresa) Then
|
||||
DtProductos = ObjVentas.DataSetResultados.Tables(0).Copy()
|
||||
DtDepositos = ObjVentas.DataSetResultados.Tables(1).Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GvDatos.DataSource = DtProductos
|
||||
GvTotales.DataSource = DtDepositos
|
||||
|
||||
GvDatos.DataBind()
|
||||
GvTotales.DataBind()
|
||||
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
Protected Sub GvTotales_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveTipoTransaccion") = "-1" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
e.Row.FCHyperLink("HpTotal").NavigateUrl = String.Format("/Ventas/RepArqueosDetalle.aspx?CveSubProyecto={0}&Fecha={1}", DdlSubProyecto.SelectedValue.ToEntero(), Now.ToString("dd/MM/yyyy"))
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos(Now.Year, DdlSubProyecto.SelectedValue.ToEntero())
|
||||
End Sub
|
||||
Protected Sub GeneraPDF(Formato As String)
|
||||
Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
|
||||
Dim Imagen As System.IO.FileInfo = 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)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString()))
|
||||
|
||||
params.Add(New ReportParameter("Encabezado", String.Format("Sucursal:{0}", DdlSubProyecto.SelectedItem.Text)))
|
||||
|
||||
|
||||
Dim lrds As List(Of ReportDataSource) = New List(Of ReportDataSource)()
|
||||
Dim rds As ReportDataSource = New ReportDataSource()
|
||||
rds.Name = "DataSet1"
|
||||
rds.Value = DtProductos
|
||||
|
||||
Dim rds2 As ReportDataSource = New ReportDataSource()
|
||||
rds2.Name = "DataSet2"
|
||||
rds2.Value = DtDepositos
|
||||
|
||||
lrds.Add(rds)
|
||||
lrds.Add(rds2)
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepArqueos.rdlc", lrds, params, "Rep Arqueos", Formato)
|
||||
End Sub
|
||||
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs)
|
||||
GeneraPDF("PDF")
|
||||
End Sub
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs)
|
||||
GeneraPDF("EXCEL")
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user