Files
SIG/Inventarios/RepVentasXSurtir.aspx.vb
2019-11-04 13:38:30 -07:00

80 lines
2.6 KiB
VB.net

Option Explicit On
Option Strict On
Imports Extensiones
Partial Class Inventarios_RepVentasXSurtir
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
InicializaValores()
CargaURLParametros()
End If
End Sub
#Region " INICIALIZA VALORES "
Private Sub InicializaValores()
'Carga Productos
DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
DdlPS.SelectedText = "Todos"
DdlPS.SelectedValue = "-1"
Else
DdlPS.ddl.Items.Clear()
DdlPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
DdlPS.ddl.DataBind()
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
'Carga Sucursales
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyectos.DataBind()
UPFiltros.Update()
End Sub
#End Region
#Region " CARGA URL PARAMETROS "
Private Sub CargaURLParametros()
If Request("CvePS") IsNot Nothing AndAlso IsNumeric(Request("CvePS")) AndAlso Request("CvePS").ToEntero > 0 Then
DdlPS.SelectedValue = Request("CvePS").ToString
UPFiltros.Update()
CargaDatos()
End If
End Sub
#End Region
#Region " CARGA DATOS "
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetPendietePorSurtirVenta(DdlPS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlTipo.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjInventarios.DtResultados
Else
GvDatos.DataSource = Nothing
End If
GvDatos.DataBind()
ObjInventarios.Dispose()
UpDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Select Case e.Row.DBCampo("EsDevolucionVenta").ToEntero
Case 0
e.Row.Cells(0).Text = "<div class='label label-success'>Surtir</div>"
Case 1
e.Row.Cells(0).Text = "<div class='label label-warning'>Recibir</div>"
End Select
End If
End Sub
#End Region
End Class