This commit is contained in:
2024-07-08 22:33:07 -07:00
3 changed files with 192 additions and 146 deletions

View File

@@ -42,8 +42,8 @@ Partial Class RepContratosCalendario
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString()
txtFechaF.Text = GetLastDayOfMonth(NowADS()).ToShortDateString()
InicializaCombos()
InicializaCalendar()
CargaDatos()
@@ -71,6 +71,9 @@ Partial Class RepContratosCalendario
End Sub
Public Shared Function GetLastDayOfMonth(ByVal dateTime As DateTime) As DateTime
Return New DateTime(dateTime.Year, dateTime.Month, DateTime.DaysInMonth(dateTime.Year, dateTime.Month))
End Function
Private Sub CargaCronograma(Optional TipoVista As Integer = -1)
If DtAvance IsNot Nothing Then
@@ -94,11 +97,14 @@ Partial Class RepContratosCalendario
Dim obj As New JObject(
New JProperty("category", Row("CodigoAF")),
New JProperty("fromDate", Row("FechaInicial").ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm").ToDateTime()),
New JProperty("toDate", Row("FechaFinal").ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm").ToDateTime()),
New JProperty("toDate", Row("FechaFinal").ToString().ToDateTime.ToString("dd/MM/yyyy HH:mm").ToDateTime()),
New JProperty("columnSettings", New JObject(
New JProperty("fill", String.Format("#{0:X6}", random.Next(16777216)))
)),
New JProperty("task", Row("NombreAF"))
New JProperty("unidad", Row("NombreAF")),
New JProperty("cveContrato", Row("CveContrato")),
New JProperty("contrato", Row("NumeroContrato")),
New JProperty("fechaFinalViaje", Row("FechaFinal").ToString().ToDateTime().ToString("dd/MM/yyyy HH:mm"))
)
jsonData.Add(obj)
strAF.AppendFormat("{0},", Row("CveAF"))
@@ -115,8 +121,12 @@ Partial Class RepContratosCalendario
)
jsonCategorias.Add(obj)
Next
Dim FechaI = txtFechaI.Text.ToDateTime()
Dim FechaF = txtFechaF.Text.ToDateTime()
RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()},{TipoVista});", "A1")
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")
UPPGantt.Update()
End If
End Sub