123 lines
5.8 KiB
VB.net
123 lines
5.8 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
|
|
Partial Class OS_RepOrdenesServicios
|
|
Inherits ClsPaginas
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
|
|
ViewState("Orden") = ""
|
|
CargaCombos()
|
|
|
|
If Request("CveUsuarioTecnico") IsNot Nothing AndAlso IsNumeric(Request("CveUsuarioTecnico")) AndAlso Request("CveUsuarioTecnico").ToEntero > 0 Then
|
|
ViewState("CveUsuarioTecnico") = Request("CveUsuarioTecnico")
|
|
DdlTecnico.SelectedValueExist(ViewState("CveUsuarioTecnico"))
|
|
Else
|
|
ViewState("CveUsuarioTecnico") = -1
|
|
End If
|
|
|
|
CargaDatos()
|
|
OrdenaDatos()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaCombos()
|
|
'CargaClientes
|
|
DdlClientes.DataSource() = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
|
DdlClientes.DataBind()
|
|
DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
'CargaSubProyectos
|
|
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, Estatus:=1)
|
|
DdlSubProyecto.DataBind()
|
|
|
|
'CargaUsuarios
|
|
DdlUsuarioRecibio.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
DdlUsuarioRecibio.DataBind()
|
|
DdlUsuarioRecibio.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
'CargaEstatus
|
|
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
|
|
DdlEstatusOS.DataBind()
|
|
DdlEstatusOS.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
'CargaTecnico
|
|
DdlTecnico.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
DdlTecnico.DataBind()
|
|
DdlTecnico.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
End Sub
|
|
|
|
Public Sub CargaDatos()
|
|
Dim ObjOrdenesServicios As New ClsOS()
|
|
|
|
Dim FechaI, FechaF, FechaTerminado As String
|
|
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
|
|
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
|
|
FechaTerminado = If(IsDate(TxtFechaTerminado.Text.Trim()), TxtFechaTerminado.Text.Trim(), "-1")
|
|
|
|
If ObjOrdenesServicios.GetRepOrdenesServicio(FechaI, FechaF, FechaTerminado, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlUsuarioRecibio.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
Dim Filtro As String = ""
|
|
Select Case DdlFacturado.SelectedValue
|
|
Case "1"
|
|
'FACTURADAS
|
|
Filtro = "NoFacturar > 0 AND NoFacturar = NoFacturados"
|
|
Case "2"
|
|
'POR FACTURAR
|
|
Filtro = "NoFacturar <> NoFacturados"
|
|
Case "3"
|
|
'SIN FACTURA
|
|
Filtro = "NoFacturar = 0 AND NoFacturados = 0"
|
|
End Select
|
|
GvDatos.DataSource = ObjOrdenesServicios.DtResultados.FiltraParametros(Filtro)
|
|
Else
|
|
GvDatos.DataSource = Nothing
|
|
End If
|
|
ObjOrdenesServicios.Dispose()
|
|
GvDatos.DataBind()
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(50)
|
|
e.Row.Cells(1).Width = Unit.Pixel(200)
|
|
e.Row.Cells(2).Width = Unit.Pixel(130)
|
|
'e.Row.Cells(3).Width = Unit.Pixel(100)
|
|
e.Row.Cells(4).Width = Unit.Pixel(100)
|
|
e.Row.Cells(5).Width = Unit.Pixel(100)
|
|
'e.Row.Cells(6).Width = Unit.Pixel(100)
|
|
End If
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
|
|
e.Row.FCLiteral("LtlFolio").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLiteral("LtlFolio").Text & "</a>"
|
|
e.Row.FCLabel("LtlCliente").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLabel("LtlCliente").Text & "</a>"
|
|
e.Row.FCLiteral("LtlFechaRecepcion").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLiteral("LtlFechaRecepcion").Text & "</a>"
|
|
e.Row.FCLabel("LtlDescripcion").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLabel("LtlDescripcion").Text & "</a>"
|
|
e.Row.FCLabel("LtlUsuarioRecibio").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLabel("LtlUsuarioRecibio").Text & "</a>"
|
|
e.Row.FCLiteral("LtlEstatusOrdenServicio").Text = "<a class=""Texto"" href=""/OS/OrdenesServicios.aspx?CveOS=" & e.Row.DBCampo("CveOS") & """>" & e.Row.FCLiteral("LtlEstatusOrdenServicio").Text & "</a>"
|
|
End If
|
|
End Sub
|
|
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
|
|
GvDatos.ExportToExcel("RepOrdenesServicio_" & Now.ToShortDateString)
|
|
End Sub
|
|
|
|
#Region "O R D E N A M I E N T O"
|
|
Private Sub OrdenaDatos()
|
|
If (GvDatos.Rows.Count > 0) Then
|
|
GvDatos.UseAccessibleHeader = True
|
|
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
|
|
RegistraScript("OrdenarGV();")
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
UpDatos.Update()
|
|
End Sub
|
|
End Class
|