Imports System.Data Imports Extensiones Imports System.Linq Imports Microsoft.Reporting.WebForms Imports System.Data.OleDb Partial Class OI_SubidasADS Inherits ClsPaginas Private Property Datos As DataTable Get If ViewState("Datos") Is Nothing Then Return New DataTable Else Return DirectCast(ViewState("Datos"), DataTable) End If End Get Set(value As DataTable) ViewState("Datos") = value End Set End Property Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then TxtFechaI.Text = Now.AddDays(-30).ToString("dd/MM/yyyy") TxtFechaFin.Text = Now.ToString("dd/MM/yyyy") If UsuarioActual.CveRol = 1 Then CargaDatosSubidasPendientes() ActualizarGV() End If CargaDatosSubidasPendientes() End If End Sub Public Sub CargaDatosSubidasPendientes() Dim ObjDesarrollo As New ClsDesarrollo If ObjDesarrollo.DesarrolloSubidaRepGet(TxtFechaI.Text.ToDate, TxtFechaFin.Text.ToDate, DdlOpcion.SelectedValue.ToEntero) Then Datos = ObjDesarrollo.DtResultados Datos.Columns.Add("ListaSubida") Datos.Columns.Add("Comprometido") Datos.AcceptChanges() Else Datos = Nothing End If If ObjDesarrollo.DesarrolloSubidaGet(-1, -1, "-1", -1) Then Dim ComprometidosEnum = From row In ObjDesarrollo.DtResultados.FiltraParametros("CveSubidaCom > 0").AsEnumerable() Select row.Field(Of String)("Comprometido") Distinct LblComprometidos.Text = $"Comprometidos:
" For Each itemC In ComprometidosEnum LblComprometidos.Text = LblComprometidos.Text & itemC.ToString & "
" Next LblComprometidos.Text = LblComprometidos.Text & "
" For Each Drow As DataRow In Datos.Rows Dim DTSubidas As New DataTable 'Dim ListaSubida As String = $"Mostrar subida
" Dim ListaSubida As String = $"Mostrar subida
TipoArchivoDBTablaCampoTipoRelacionProcedimientoScript
" DTSubidas = ObjDesarrollo.DtResultados.FiltraParametros($"CveDesarrollo = {Drow("CveDesarrollo").ToString }") For Each dRow2 As DataRow In DTSubidas.Rows If dRow2("CveSubidaCom").ToString.Length > 0 Then ListaSubida = ListaSubida & $"" Drow("Comprometido") = "1" Else ListaSubida = ListaSubida & $"" If Drow("Comprometido").ToString = "" Then Drow("Comprometido") = "0" End If End If Next ListaSubida = ListaSubida & "
TipoArchivoDBTablaCampoTipoRelacionProcedimientoScript
{dRow2("SubidaTipo").ToString }{dRow2("Subida").ToString}{dRow2("DB").ToString}{dRow2("Tabla").ToString}{dRow2("Campo").ToString}{dRow2("TipoDato").ToString}{dRow2("LlaveForanea").ToString}{dRow2("Procedimiento").ToString} { If(dRow2("Script").ToString.Trim.Length > 0, "", "") }
{dRow2("SubidaTipo").ToString }{dRow2("Subida").ToString}{dRow2("DB").ToString}{dRow2("Tabla").ToString}{dRow2("Campo").ToString}{dRow2("TipoDato").ToString}{dRow2("LlaveForanea").ToString}{dRow2("Procedimiento").ToString} { If(dRow2("Script").ToString.Trim.Length > 0, "", "") }
" Drow("Listasubida") = ListaSubida Next End If GvDatos.DataSource = Datos GvDatos.DataBind() UPDatos.Update() End Sub Private Sub ActualizarGV() GvDatos.DataSource = Datos GvDatos.DataBind() UPDatos.Update() End Sub Private Sub BtnGaurdar_Click(sender As Object, e As EventArgs) Handles BtnGaurdar.Click Dim ObjDesarrollo As New ClsDesarrollo For Each GvRow As GridViewRow In GvDatos.Rows Dim ChkCompletado As CheckBox = GvRow.FCCheckBox("ChkCompletado") If Not ChkCompletado Is Nothing And GvRow.DataKey("Actualizable").ToEntero = 1 Then If ChkCompletado.Checked Then If Not ObjDesarrollo.DesarrolloAddUpdate(GvRow.DataKey("CveDesarrollo").ToEntero, GvRow.DataKey("Desarrollo"), GvRow.DataKey("CveEvento").ToEntero, GvRow.DataKey("CveUsuarioResponsable").ToEntero, GvRow.DataKey("CveUsuarioPruebas"), GvRow.DataKey("CveModulo").ToEntero, GvRow.DataKey("Descripcion"), GvRow.DataKey("CveUsuarioAsignado").ToEntero, Nothing, -1, 5, -1, UsuarioActual.CveUsuario) Then Alert("Se presento un error al actulizar los estados") Exit For End If End If End If Next ObjDesarrollo.Dispose() CargaDatosSubidasPendientes() ActualizarGV() End Sub Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DataKey("Actualizable").ToEntero = 1 And e.Row.DataKey("CveDesarrolloEstado").ToEntero = 4 Then e.Row.FCCheckBox("ChkCompletado").Enabled = True Else e.Row.FCCheckBox("ChkCompletado").Visible = False 'e.Row.FCCheckBox("ChkCompletado").Checked = True End If End If End Sub Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click CargaDatosSubidasPendientes() End Sub End Class