Files
SIG/Ventas/CatPromociones.aspx.vb
JORGE LUIS CAUDILLO ESPARZA c35cf91883 Commit inicial Ventas Productivo
2019-08-14 16:40:54 -07:00

70 lines
2.0 KiB
VB.net

Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Ventas_CatPromociones
Inherits ClsPaginas
#Region " PROPIEDADES "
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
'ImgAddPromocion.Attributes.Add("OnClick", "window.location = '/Ventas/Promociones.aspx'")
'CARGA SUCURSALES
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromociones(-1, "-1", -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero) Then
DtDatos = ObjVentas.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar las promociones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
If DtDatos IsNot Nothing Then
CargaGrid()
End If
End Sub
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCHyperLink("HLPromocion").NavigateUrl = String.Format("/Ventas/Promociones.aspx?CvePromocion={0}", e.Row.DBCampo("CvePromocion"))
End If
End Sub
End Class