VyA.2024.10.04

This commit is contained in:
rakcsle
2024-10-09 08:26:03 -07:00
parent ba6447027b
commit c6d6977d33
7 changed files with 434 additions and 12 deletions

View File

@@ -39,9 +39,17 @@ Partial Class RepContratosCalendario
End Property
#End Region
Public Property RCveEvento As Integer
Get
Return If(ViewState("RCveEvento") IsNot Nothing, ViewState("RCveEvento").ToString().ToEntero(), 0)
End Get
Set(value As Integer)
ViewState("RCveEvento") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
RCveEvento = 0
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString()
txtFechaF.Text = GetLastDayOfMonth(NowADS()).ToShortDateString()
InicializaCombos()
@@ -83,16 +91,16 @@ Partial Class RepContratosCalendario
Private Sub CargaCronograma(Optional TipoVista As Integer = -1)
If DtAvance IsNot Nothing Then
Dim separator As String = ""
Dim str As New StringBuilder()
str.AppendLine("datosGant=[")
Dim StrFiltro As String = ""
If DdlTipoUnidad.SelectedValue.ToEntero > 0 Then StrFiltro = " AND CveTipoActivoFijo = " & DdlTipoUnidad.SelectedValue
Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3) " & StrFiltro, Orderby:=" TipoActivoFijo ASC, CodigoNumeroOrden ASC", DistinctColumns:={"Codigo", "CveActivoFijo"})
'For Each Row As DataRow In DtAvance.Rows
' If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then
' Row("CodigoAF") = "Unidad no asignada"
' End If
'Next
Dim jsonData As New JArray()
Dim jsonCategorias As New JArray()
@@ -117,6 +125,16 @@ Partial Class RepContratosCalendario
)
jsonData.Add(obj)
strAF.AppendFormat("{0},", Row("CveAF"))
'uniad contrato y duracion
Dim unidad As String = $"{Row("CodigoAF")}-{Row("NombreAF")}"
Dim duracion As String = $"{Row("FechaInicial").ToString.ToDate.ToString("dd/MM/yyyy HH:mm")} - {Row("FechaFinal").ToString.ToDate.ToString("dd/MM/yyyy HH:mm")}"
str.AppendLine(String.Format("{0}{{id: {1}, text: ""{2}"", start_date: ""{3:yyyy/MM/dd HH:mm}"", end_date: ""{4:yyyy/MM/dd HH:mm}"", parent: {5}, progress:{6}, open: true, unidad: ""{7}"",duracion: ""{8}""}}",
separator, Row("CveContrato"), Row("NumeroContrato").ToString().Replace("\\", "\\\\").Replace("""", "\"""), Row("FechaInicial"), Row("FechaFinal"), 0, 100, unidad, duracion))
separator = ","
Next
If TipoVista = 1 Then 'solo con viajes
@@ -134,11 +152,45 @@ Partial Class RepContratosCalendario
Dim FechaF = txtFechaF.Text.ToDateTime()
Dim ScriptZoom = $"zoomAxis({FechaI.Year},{FechaI.Month - 1},{FechaI.Day},{FechaF.Year},{FechaF.Month - 1},{FechaF.Day});"
RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});{ScriptZoom}", "A1")
str.AppendLine("];loadGant();")
RegistraScript(str.ToString())
UPPGantt.Update()
UPGat.Update()
End If
End Sub
'Public Sub loadEvento()
' Dim separator As String = ""
' Dim str As New StringBuilder()
' str.AppendLine("datosGant=[")
' Using oieve As New ClsOIEventos()
' If oieve.GetEventos2(RCveEvento, UsuarioActual.CveEmpresa) AndAlso oieve.DtResultados.Rows.Count > 0 Then
' Dim drow As System.Data.DataRow = oieve.DtResultados.Rows(0)
' LblAsunto.Text = drow("Asunto").ToString()
' End If
' If oieve.GetTareaConHijos(RCveEvento, UsuarioActual.CveEmpresa) Then
' For Each dr As System.Data.DataRow In oieve.DtResultados.Select("Nivel > 0")
' str.AppendLine(String.Format("{0}{{id: {1}, text: ""{2}"", start_date: ""{3:yyyy/MM/dd}"", end_date: ""{4:yyyy/MM/dd}"", parent: {5}, progress:{6}, open: true }}",
' separator, dr("CveEvento"), dr("Asunto").ToString().Replace("\\", "\\\\").Replace("""", "\"""), dr("FechaInicio"), dr("FechaFin"), If(dr("Nivel").ToString().ToEntero() <= 1, 0, dr("CveEventoPadre").ToString().ToEntero()), dr("Avance").ToString().ToDecimal() / 100))
' separator = ","
' Next
' End If
' End Using
' str.AppendLine("];loadGant();")
' RegistraScript(str.ToString())
' UpContenido.Update()
' ' { id: 2, text: "Direccion: evaluación de mercado", start_date: "2020/04/29 00:00", end_date: "2020/05/02 00:00",/*duration: 3,*/ parent: 1, progress: 0.25 }
'End Sub
Private Sub InicializaCalendar()
RegistraScript("InitCalendar();")