82 lines
3.6 KiB
VB.net
82 lines
3.6 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
|
|
Partial Class Ventas_RepVentasPV
|
|
Inherits ClsPaginas
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
CargaCombos()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaCombos()
|
|
|
|
'CargaSucursales
|
|
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1).FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
DdlSubProyecto.DataBind()
|
|
|
|
End Sub
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
UPDatos.Update()
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjVentas As New ClsVentas()
|
|
|
|
Dim FechaI, FechaF, FechaIEjec, FechaFEjec As String
|
|
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
|
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
|
FechaIEjec = "-1"
|
|
FechaFEjec = "-1"
|
|
If ObjVentas.GetRepVentasPV(FechaI, FechaF, FechaIEjec, FechaFEjec, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, "-1", -1, -1, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero) Then
|
|
GvDatos.DataSource = ObjVentas.DtResultados
|
|
Else
|
|
GvDatos.DataSource = Nothing
|
|
End If
|
|
ObjVentas.Dispose()
|
|
GvDatos.DataBind()
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
Dim Css As String = "Texto"
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
|
|
e.Row.Cells(0).Width = Unit.Pixel(200)
|
|
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
|
'e.Row.Cells(1).Width = Unit.Pixel(60)
|
|
'e.Row.Cells(2).Width = Unit.Pixel(90)
|
|
'e.Row.Cells(3).Width = Unit.Pixel(90)
|
|
'e.Row.Cells(4).Width = Unit.Pixel(90)
|
|
'e.Row.Cells(5).Width = Unit.Pixel(80)
|
|
'e.Row.Cells(8).Width = Unit.Pixel(100)
|
|
e.Row.CssClass = "Totales"
|
|
Css = "Totales"
|
|
End If
|
|
|
|
Dim FechaI, FechaF As String
|
|
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
|
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
|
|
|
Dim Liga As String = String.Format("/Ventas/RepVentaDetalle.aspx?GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveCliente={5}&CveSucursal={6}&Vendedor={7}&CveUsuario={8}&CveEstatusFactura={9}&FechaI={10}&FechaF={11}&IVA={12}&CveCorte=-1",
|
|
DdlGrupo.SelectedValue, e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), -1, e.Row.DBCampo("CveSucursal"),
|
|
"-1", -1, -1, FechaI, FechaF, -1)
|
|
|
|
e.Row.FCLiteral("LtlGrupo").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlGrupo").Text & "</a>"
|
|
e.Row.FCLiteral("LtlCantidad").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlCantidad").Text & "</a>"
|
|
|
|
'If e.Row.DBCampo("SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlSubTotal").Text = ""
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
|
|
GvDatos.ExportToExcel("ReporteVentasPV" & NowADS().ToShortDateString)
|
|
End Sub
|
|
End Class
|