112 lines
4.9 KiB
VB.net
112 lines
4.9 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
Partial Class OS_PopUpBuscarOS
|
|
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
|
|
CType(Me.Master, BaseMasterPage).PopupWidth = 500
|
|
RegistraScript("$get('tdContenido').style.height='470px'")
|
|
|
|
CargaClientes()
|
|
CargaUsuarioRecibio()
|
|
CargaEstatusOrdenServicio()
|
|
CargaSucursales()
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
|
Dim ObjOS As New ClsOS
|
|
|
|
Dim Folio As Integer = -1
|
|
Dim CveCliente As Integer = -1
|
|
Dim CveUsuarioRecibio As Integer = -1
|
|
Dim CveEstatusOrdenServicio As Integer = -1
|
|
Dim FechaRecibido As String = "-1"
|
|
|
|
|
|
If TxtFolio.Text.Trim <> String.Empty Then Folio = TxtFolio.Text.ToEntero
|
|
If DdlCliente.SelectedValue <> String.Empty Then CveCliente = DdlCliente.SelectedValue.ToEntero
|
|
If DdlUsuarioRecibio.SelectedValue <> String.Empty Then CveUsuarioRecibio = DdlUsuarioRecibio.SelectedValue.ToEntero
|
|
'If TxtFechaRecibido.Text.Trim <> String.Empty Then FechaRecibido.ToString()
|
|
If DdlEstatusOrdenServicio.SelectedValue <> String.Empty Then CveEstatusOrdenServicio = DdlEstatusOrdenServicio.SelectedValue.ToEntero
|
|
|
|
|
|
If ObjOS.GetOrdenesServicios(-1, CveCliente, Folio, CveUsuarioRecibio, CveEstatusOrdenServicio, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
|
If ObjOS.DtResultados.Rows.Count > 0 Then
|
|
LtlTotalRegistros.Text = ObjOS.DtResultados.Rows.Count.ToString.FormatoNumero(0)
|
|
GV.DataSource = ObjOS.DtResultados
|
|
Else
|
|
LtlTotalRegistros.Text = "0"
|
|
GV.DataSource = Nothing
|
|
Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
|
|
End If
|
|
End If
|
|
|
|
ObjOS.Dispose()
|
|
GV.DataBind()
|
|
|
|
UPDatos.Update()
|
|
|
|
TblBusqueda.Visible = True
|
|
End Sub
|
|
|
|
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(70)
|
|
End If
|
|
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Justify
|
|
|
|
Dim Liga As String = String.Empty
|
|
|
|
Liga = "<a class='Texto' href='javascript:Ir(""" & e.Row.DBCampo("CveOS") & """);'>"
|
|
|
|
'<div class='truncate' style='width:55px'>
|
|
e.Row.FCLiteral("LtlFolio").Text = String.Format("<div style='width:19px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Folio"))
|
|
e.Row.FCLiteral("LtlCliente").Text = String.Format("<div class='truncate' style='width:260px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Cliente"))
|
|
e.Row.FCLiteral("LtlCentroCosto").Text = String.Format("<div class='truncate' style='width:260px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("SubProyecto"))
|
|
e.Row.FCLiteral("LtlDescripcion").Text = String.Format("<div class='truncate' style='width:230px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("Descripcion"))
|
|
e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = String.Format("<div class='truncate' style='width:65px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("EstatusOrdenServicio"))
|
|
e.Row.FCLiteral("LtlFechaRecepcion").Text = String.Format("<div class='truncate' style='width:76px'>{0}{1}</a></div>", Liga, e.Row.DBCampo("FechaRecepcion").ToDate.ToShortDateString)
|
|
End If
|
|
End Sub
|
|
Private Sub CargaClientes()
|
|
Dim ObjClientes As New ClsClientes
|
|
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
|
DdlCliente.DataSource = ObjClientes.DtResultados
|
|
Else
|
|
DdlCliente.DataSource = Nothing
|
|
End If
|
|
ObjClientes.Dispose()
|
|
DdlCliente.DataBind()
|
|
End Sub
|
|
|
|
Private Sub CargaUsuarioRecibio()
|
|
DdlUsuarioRecibio.Items.Clear()
|
|
DdlUsuarioRecibio.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
DdlUsuarioRecibio.DataBind()
|
|
DdlUsuarioRecibio.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
Private Sub CargaEstatusOrdenServicio()
|
|
DdlEstatusOrdenServicio.Items.Clear()
|
|
DdlEstatusOrdenServicio.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
|
|
DdlEstatusOrdenServicio.DataBind()
|
|
DdlEstatusOrdenServicio.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
|
|
Private Sub CargaSucursales()
|
|
DdlSubProyecto.Items.Clear()
|
|
DdlSubProyecto.SelectedValue = Nothing
|
|
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1)
|
|
DdlSubProyecto.DataBind()
|
|
|
|
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
|
|
End Class
|