From 61ed328d5d9e445c870f5e18b7cb210a60570f6e Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 11 Apr 2024 20:03:31 -0700 Subject: [PATCH] --V&A mostrar diagrama de grantt --- Transportes/RepContratosCalendario.aspx | 1174 +++++++++++--------- Transportes/RepContratosCalendario.aspx.vb | 69 +- 2 files changed, 723 insertions(+), 520 deletions(-) diff --git a/Transportes/RepContratosCalendario.aspx b/Transportes/RepContratosCalendario.aspx index 685c6b7ea..6d83d15e6 100644 --- a/Transportes/RepContratosCalendario.aspx +++ b/Transportes/RepContratosCalendario.aspx @@ -1,460 +1,628 @@ -<%@ Page Title="Transportes V&A - Calendario" Language="VB" MasterPageFile="~/Site.master" - AutoEventWireup="false" CodeFile="RepContratosCalendario.aspx.vb" Inherits="RepContratosCalendario" %> - -<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %> - - - - - - - Calendario de Viajes - - - -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • -
    - - - - - <%--Calendario Tab--%> - - -
    -
    -
    - - -
    -
    -
    - -
    - - - - - -
    -
    -
    -
    - - -
    - -
    -
    -
    -
    -
    -

     

    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - <%--Contratos Tab--%> - - - <%-- Filtros --%> - - -
    - <%-- Filtro Visible - Consulta --%> -
    -
    - - -
    - -
    -
    - <%-- Fecha Inicial --%> - -
    -
    - - - - -
    - - - -
    - <%-- Fecha Final --%> - -
    -
    - - - - -
    - - - -
    - <%-- Cliente --%> - -
    - -
    - <%-- Estatus --%> - -
    - - -
    -
    -
    -
    - <%-- Filtro Oculto --%> - -
    -
    -
    - <%-- Contratos --%> - - - - - - - - - - - - - Fecha
    - Salida -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Fecha
    - Regreso -
    - - - -
    - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - <%-- Modal --%> - - -
    - - - - - - - -
    -
    - - +<%@ Page Title="Transportes V&A - Calendario" Language="VB" MasterPageFile="~/Site.master" + AutoEventWireup="false" CodeFile="RepContratosCalendario.aspx.vb" Inherits="RepContratosCalendario" %> + +<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %> + + + + + + + Calendario de Viajes + + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • +
    + + + +
    +
    + <%-- Filtros --%> + + +
    + <%-- Filtro Visible - Consulta --%> +
    +
    + + +
    +
    +
    + <%-- Fecha Inicial --%> + +
    +
    + + + + +
    + + +
    + <%-- Fecha Final --%> + +
    +
    + + + + +
    + + +
    + <%-- Cliente --%> + +
    + +
    + <%-- Estatus --%> + +
    + + +
    +
    +
    +
    + <%-- Filtro Oculto --%> + +
    +
    +
    +
    +
    +
    +
    + + <%--Calendario Tab--%> + + + +
    +
    +
    +
    +
    +
    +
    + +
    + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +

     

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + <%--Contratos Tab--%> + + + <%-- Contratos --%> + + + + + + + + + + + + + Fecha
    + Salida + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fecha
    + Regreso + +
    + + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + <%--Calendario Tab--%> + + +
    +
    +
    +
    +
    +

     

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + <%-- Modal --%> + + +
    + + + + + + + +
    +
    + + + + + - - - + + + +
    diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index 589ba314d..94c9eb166 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -5,9 +5,11 @@ Imports ADSNetLibrary.SIGAPI.Helpers Imports Extensiones.ModExtensiones Imports GemBox.Spreadsheet Imports Microsoft.Reporting.WebForms +Imports Newtonsoft.Json.Linq + Partial Class RepContratosCalendario - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "PROPIEDADES" Public Property DtAvance() As DataTable Get @@ -25,21 +27,18 @@ Partial Class RepContratosCalendario Set(value As String) ViewState("Contrato") = value End Set - End Property + End Property #End Region - + 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 InicializaCombos() InicializaCalendar() CargaDatos() - End If + End If InicializaCalendar() - End Sub Private Sub CargaDatos() Dim ObjContratos As New ClsContratos @@ -49,16 +48,56 @@ Partial Class RepContratosCalendario If CveCliente = 0 Then CveCliente = -1 If ObjContratos.GetContratosReporte(UsuarioActual.CveEmpresa, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveEstatus:=DdlEstatusConsulta.SelectedValue.ToEntero, CveTipoContrato:=34) Then - GvContratos.DataSource = ObjContratos.DtResultados + DtAvance = ObjContratos.DtResultados.Copy() End If - DtAvance = ObjContratos.DtResultados + GvContratos.DataSource = DtAvance ObjContratos.Dispose() GvContratos.DataBind() - UpTitulos.Update() + UpTitulos.Update() + + CargaCronograma() + End Sub + + Private Sub CargaCronograma() + If DtAvance IsNot Nothing Then + + For Each Row As DataRow In DtAvance.Rows + If String.IsNullOrEmpty(Row("NombreAF").ToString()) Then + Row("NombreAF") = "Unidad no asignada" + End If + Next + + Dim jsonData As New JArray() + Dim jsonCategorias As New JArray() + + Dim random = New Random() + + 'DATOS + For Each Row As DataRow In DtAvance.FiltraParametros("NombreAF <> ''").Rows + Dim obj As New JObject( + New JProperty("category", Row("NombreAF")), + 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("columnSettings", New JObject( + New JProperty("fill", String.Format("#{0:X6}", random.Next(16777216))) + )) + ) + jsonData.Add(obj) + Next + + 'CATEGORIAS + For Each Row As DataRow In DtAvance.FiltraParametros("NombreAF <> ''", "", {"NombreAF"}).Rows + Dim obj As New JObject( + New JProperty("category", Row("NombreAF")) + ) + jsonCategorias.Add(obj) + Next + + RegistraScript($"cargaDiagramaGrant({jsonData.ToString()},{jsonCategorias.ToString()});", "A1") + End If End Sub Private Sub InicializaCalendar() - RegistraScript("InitCalendar();") DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True End Sub @@ -158,10 +197,6 @@ Partial Class RepContratosCalendario UpModal.Update() RegistraScript("$('#ModalActualizar').modal('show');") End Sub - - Protected Sub Consultar(sender As Object, e As EventArgs) - - End Sub Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString) End Sub @@ -190,5 +225,5 @@ Partial Class RepContratosCalendario Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) CargaDatos() - End Sub + End Sub End Class