--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 Extensiones.ModExtensiones
|
||||||
Imports GemBox.Spreadsheet
|
Imports GemBox.Spreadsheet
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
Imports Newtonsoft.Json.Linq
|
||||||
|
|
||||||
Partial Class RepContratosCalendario
|
Partial Class RepContratosCalendario
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
#Region "PROPIEDADES"
|
#Region "PROPIEDADES"
|
||||||
Public Property DtAvance() As DataTable
|
Public Property DtAvance() As DataTable
|
||||||
Get
|
Get
|
||||||
@@ -25,21 +27,18 @@ Partial Class RepContratosCalendario
|
|||||||
Set(value As String)
|
Set(value As String)
|
||||||
ViewState("Contrato") = value
|
ViewState("Contrato") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
|
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
|
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
|
||||||
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
|
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
|
||||||
InicializaCombos()
|
InicializaCombos()
|
||||||
InicializaCalendar()
|
InicializaCalendar()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End If
|
End If
|
||||||
InicializaCalendar()
|
InicializaCalendar()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjContratos As New ClsContratos
|
Dim ObjContratos As New ClsContratos
|
||||||
@@ -49,16 +48,56 @@ Partial Class RepContratosCalendario
|
|||||||
If CveCliente = 0 Then CveCliente = -1
|
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
|
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
|
End If
|
||||||
DtAvance = ObjContratos.DtResultados
|
GvContratos.DataSource = DtAvance
|
||||||
|
|
||||||
ObjContratos.Dispose()
|
ObjContratos.Dispose()
|
||||||
GvContratos.DataBind()
|
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
|
End Sub
|
||||||
Private Sub InicializaCalendar()
|
Private Sub InicializaCalendar()
|
||||||
|
|
||||||
RegistraScript("InitCalendar();")
|
RegistraScript("InitCalendar();")
|
||||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||||
End Sub
|
End Sub
|
||||||
@@ -158,10 +197,6 @@ Partial Class RepContratosCalendario
|
|||||||
UpModal.Update()
|
UpModal.Update()
|
||||||
RegistraScript("$('#ModalActualizar').modal('show');")
|
RegistraScript("$('#ModalActualizar').modal('show');")
|
||||||
End Sub
|
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
|
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||||
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
GvContratos.ExportToExcel("ReporteCompras" & NowADS().ToShortDateString)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -190,5 +225,5 @@ Partial Class RepContratosCalendario
|
|||||||
|
|
||||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user