--zoom a a diagrama segun filtros de fechas

This commit is contained in:
2024-07-08 14:40:33 -07:00
parent c82c104123
commit 4f5aec24f1
2 changed files with 28 additions and 22 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.ToShortDateString
txtFechaF.Text = DateTime.Now.AddMonths(1).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,13 +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("unidad", Row("NombreAF")),
New JProperty("cveContrato", Row("CveContrato")),
New JProperty("contrato", Row("NumeroContrato"))
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"))
@@ -117,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