75 lines
3.1 KiB
VB.net
75 lines
3.1 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
|
|
Partial Class CGame_PopUpBuscarOrdenProduccion
|
|
Inherits ClsPaginas
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
CType(Me.Master, BaseMasterPage).EsPopup = True
|
|
TxtFechaEntregaI.Text = Now.AddDays(0).ToShortDateString
|
|
TxtFechaEntregaF.Text = Now.AddDays(0).ToShortDateString
|
|
CargaCliente()
|
|
CargaEstatus()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaCliente()
|
|
Dim ObjOP As New ClsCGame
|
|
If ObjOP.GetCliente(-1, -1, UsuarioActual.CveEmpresa) Then
|
|
DdlCliente.DataSource = ObjOP.DtResultados
|
|
DdlCliente.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
DdlCliente.DataBind()
|
|
End If
|
|
ObjOP.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaEstatus()
|
|
Dim ObjOP As New ClsCGame
|
|
If ObjOP.GetEstatus(UsuarioActual.CveEmpresa, Estado:=1) Then
|
|
DdlEstatus.DataSource = ObjOP.DtResultados
|
|
DdlEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
DdlEstatus.DataBind()
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
|
Dim Folio As String
|
|
If TxtFolio.Text.Trim <> "" Then Folio = TxtFolio.Text Else Folio = "-1"
|
|
If ValidarFiltrosSeleccionado() Then
|
|
Dim ObjOP As New ClsCGame
|
|
If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate,
|
|
DdlCliente.SelectedValue.ToEntero, TopSelect:=100) Then
|
|
GvOP.DataSource = ObjOP.DtResultados
|
|
GvOP.DataBind()
|
|
LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString
|
|
If Not ObjOP.DtResultados.Rows.Count > 0 Then
|
|
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia)
|
|
Else
|
|
TblBusqueda.Visible = True
|
|
End If
|
|
End If
|
|
ObjOP.Dispose()
|
|
UPDatos.Update()
|
|
Else
|
|
Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub GvOP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOP.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir(""" & e.Row.DBCampo("CveOrdenProduccion") & """);'>", e.Row.DBCampo("Folio"))
|
|
End If
|
|
End Sub
|
|
|
|
Private Function ValidarFiltrosSeleccionado() As Boolean
|
|
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
|
|
If TxtFolio.Text.Length > 0 Then Return True
|
|
If TxtFechaEntregaI.Text.Length > 0 Then Return True
|
|
If TxtFechaEntregaF.Text.Length > 0 Then Return True
|
|
If DdlCliente.SelectedValue.ToEntero > 0 Then Return True
|
|
Return False
|
|
End Function
|
|
End Class
|