Commit inicial Ventas Productivo
This commit is contained in:
159
Bancos/RepCortes.aspx.vb
Normal file
159
Bancos/RepCortes.aspx.vb
Normal file
@@ -0,0 +1,159 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Extensiones
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Partial Class Bancos_RepCortes
|
||||
Inherits ClsPaginas
|
||||
Private Shared missing As Object = System.Reflection.Missing.Value
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
|
||||
Private Property DtCortesVentasResumen As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCortesVentasResumen"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCortesVentasResumen") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtCortesVentas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCortesVentas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCortesVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Fecha As String
|
||||
Get
|
||||
Return CType(ViewState("Fecha"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Fecha") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Nombre As String
|
||||
Get
|
||||
Return CType(ViewState("Nombre"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Nombre") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveCorte As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveCorte"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCorte") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
txtFechaVI.Text = Now.ToShortDateString
|
||||
txtFechaVF.Text = Now.ToShortDateString
|
||||
Me.Form.DefaultButton = BtnConsultar.UniqueID
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " C A R G A - D A T O S "
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjPuntoVenta As New ClsPuntoVenta
|
||||
Dim FechaI As Date = If(txtFechaVI.Text <> "", txtFechaVI.Text.ToDate, MinFecha)
|
||||
Dim FechaF As Date = If(txtFechaVF.Text <> "", txtFechaVF.Text.ToDate, MaxFecha)
|
||||
If ObjPuntoVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaI, FechaF) Then
|
||||
GvDatos.DataSource = ObjPuntoVenta.DtResultados
|
||||
GvDatos.DataBind()
|
||||
UPDatos.Update()
|
||||
End If
|
||||
ObjPuntoVenta.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "G V - D A T O S "
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Protected Sub GvD_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvD.RowCommand
|
||||
' If e.CommandArgument.ToString.ToEntero > 0 Then
|
||||
|
||||
|
||||
' End If
|
||||
|
||||
' Dim Vent As New ClsPuntoVenta
|
||||
' If Vent.GetCortesDetalleVentas(16200, 61) Then
|
||||
' Alert(Vent.DtResultados.Rows.Count.ToString)
|
||||
' GvD.DataSource = Vent.DtResultados
|
||||
' GvD.DataBind()
|
||||
' 'RegistraScript("$get")
|
||||
' divDetalle.Visible = True
|
||||
' End If
|
||||
|
||||
' Vent.Dispose()
|
||||
|
||||
'End Sub
|
||||
#End Region
|
||||
|
||||
#Region "BOTONES"
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
||||
GvDatos.Columns(1).Visible = ChkUsuarioCancelacion.Checked
|
||||
GvDatos.Columns(2).Visible = ChkTipo.Checked
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbDescripcion_Click(sender As Object, e As EventArgs)
|
||||
Dim btn As LinkButton = DirectCast(sender, LinkButton)
|
||||
Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
|
||||
CveCorte = gvr.DataKey("CveCorte").ToString.ToEntero
|
||||
Dim Finalizado As Integer = gvr.DataKey("Finalizado").ToString.ToEntero
|
||||
Fecha = gvr.DataKey("FechaInicial").ToString
|
||||
Nombre = gvr.DataKey("Nombre").ToString
|
||||
Dim Vent As New ClsPuntoVenta
|
||||
Dim Vn As New ClsVentas
|
||||
If Vn.GetCortesDetalleVentasResumen(CveCorte, UsuarioActual.CveEmpresa) Then
|
||||
GvP.DataSource = Vn.DtResultados
|
||||
DtCortesVentasResumen = Vn.DtResultados
|
||||
End If
|
||||
If Vent.GetCortesDetalleVentas(CveCorte, UsuarioActual.CveEmpresa) Then
|
||||
GvD.DataSource = Vent.DtResultados
|
||||
DtCortesVentas = Vent.DtResultados
|
||||
divDetalle.Visible = True
|
||||
End If
|
||||
If DtCortesVentasResumen.Rows.Count > 0 Or DtCortesVentas.Rows.Count > 0 Then
|
||||
HplDownPDF.Visible = True
|
||||
HplDownEXCEL.Visible = True
|
||||
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "PDF")))
|
||||
HplDownEXCEL.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CORT&CVECORTE={0}&FORMATO={1}", CveCorte, "EXCEL")))
|
||||
Else
|
||||
HplDownPDF.Visible = False
|
||||
HplDownEXCEL.Visible = False
|
||||
End If
|
||||
Vn.Dispose()
|
||||
Vent.Dispose()
|
||||
GvD.DataBind()
|
||||
GvP.DataBind()
|
||||
UPPDetalle.Update()
|
||||
UpAcciones.Update()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user