Option Explicit On Option Strict On Imports System.Data Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class AF_RepOrdenTrabajo Inherits ClsPaginas #Region " PROPIEDADES" Property DT_Cabeceras As DataTable Get If ViewState("DT_Cabeceras") Is Nothing Then Return New DataTable Else Return DirectCast(ViewState("DT_Cabeceras"), DataTable) End If End Get Set(value As DataTable) ViewState("DT_Cabeceras") = value End Set End Property Property DT_Datos As DataTable Get If ViewState("DT_Datos") Is Nothing Then Return New DataTable Else Return DirectCast(ViewState("DT_Datos"), DataTable) End If End Get Set(value As DataTable) ViewState("DT_Datos") = value End Set End Property #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then CargaCombos() CargaDatos() Dim FechaActual As Date = NowADS() 'TxtFechaF.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" TxtFechaF.Text = "" FechaActual = FechaActual.AddDays(-30) TxtFechaI.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" End If End Sub #Region " CARGA PARAMETROS " #End Region #Region " CARGA COMBOS " Protected Sub CargaCombos() CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) DdlAF.DataBind() DdlAF.Items.Insert(0, New ListItem("Todos", "-1")) Dim ObjAF As New ClsAF If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then DdlTipoServicio.DataSource = ObjAF.DtResultados Else DdlTipoServicio.DataSource = Nothing End If If ObjAF.GetOrdenesTrabajoEstatus(UsuarioActual.CveEmpresa) Then DdlOrdenesTrabajoEstatus.DataSource = ObjAF.DtResultados Else DdlOrdenesTrabajoEstatus.DataSource = Nothing End If ObjAF.Dispose() DdlTipoServicio.DataBind() DdlTipoServicio.Items.Insert(0, New ListItem("Todos", "-1")) DdlOrdenesTrabajoEstatus.DataBind() DdlOrdenesTrabajoEstatus.Items.Insert(0, New ListItem("Todos", "-1")) DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, -1).FiltraParametros("CveEstatusPersonal = 1") DdlPersonal.DataBind() DdlPersonal.Items.Insert(0, New ListItem("Todos", "-1")) UpFiltro.Update() End Sub #End Region #Region " CARGA DATOS " Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) CargaDatos() End Sub #End Region #Region " GV DATOS " Private Sub CargaDatos() Dim FechaInicio, FechaFin As Date Dim Folio As Integer = If(TxtFolio.Text.ToEntero > 0, TxtFolio.Text.ToEntero, -1) FechaInicio = TxtFechaI.Text.ToDate If DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero = 3 AndAlso TxtFechaF.Text.Trim.Length = 0 Then FechaFin = MaxFecha.AddDays(1) Else FechaFin = MaxFecha End If If TxtFechaF.Text.Length = 10 Then FechaFin = TxtFechaF.Text.ToDate End If Dim ObjAF As New ClsAF If ObjAF.GetOrdenesTrabajo(-1, DdlTipoServicio.SelectedValue.ToEntero, Folio, DdlAF.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then GvDatos.DataSource = ObjAF.DtResultados Else GvDatos.DataSource = Nothing End If ObjAF.Dispose() GvDatos.DataBind() UpDatos.Update() 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 End If End Sub #End Region Protected Sub LnkEliminarMetricaValor_Click(sender As Object, e As EventArgs) End Sub End Class