--V&A mostrar diagrama de grantt
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user