Merge branch 'master' of http://192.168.10.111:8383/SIG
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
|
||||
@@ -20,25 +22,23 @@ Partial Class RepContratosCalendario
|
||||
|
||||
Public Property Contrato As String
|
||||
Get
|
||||
Return ViewState("Contrato").ToString()
|
||||
Return IfNull(ViewState("Contrato"), "").ToString()
|
||||
End Get
|
||||
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
|
||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).ToShortDateString
|
||||
txtFechaF.Text = DateTime.Now.AddDays(7).ToShortDateString
|
||||
|
||||
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
|
||||
@@ -48,15 +48,57 @@ 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()
|
||||
|
||||
CargaCronograma()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCronograma()
|
||||
If DtAvance IsNot Nothing Then
|
||||
|
||||
For Each Row As DataRow In DtAvance.Rows
|
||||
If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then
|
||||
Row("CodigoAF") = "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("CodigoAF <> ''").Rows
|
||||
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("columnSettings", New JObject(
|
||||
New JProperty("fill", String.Format("#{0:X6}", random.Next(16777216)))
|
||||
)),
|
||||
New JProperty("task", Row("NombreAF"))
|
||||
)
|
||||
jsonData.Add(obj)
|
||||
Next
|
||||
|
||||
'CATEGORIAS
|
||||
For Each Row As DataRow In DtAvance.FiltraParametros("CodigoAF <> ''", "", {"CodigoAF"}).Rows
|
||||
Dim obj As New JObject(
|
||||
New JProperty("category", Row("CodigoAF"))
|
||||
)
|
||||
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
|
||||
@@ -122,6 +164,7 @@ Partial Class RepContratosCalendario
|
||||
Dim ObjContratos As New ClsContratos
|
||||
ObjContratos.IniciaTransacSQL()
|
||||
|
||||
If Contrato.ToEntero <= 0 Then Contrato = CveContrato.Value
|
||||
If ObjContratos.UpdateContratos(Contrato.ToEntero, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", 10, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, CveContratosEstatus:=DdlEstatusContrato.SelectedValue.ToEntero, CveChofer:=DdlChofer.SelectedValue.ToEntero, CveChofer2:=DdlChofer2.SelectedValue.ToEntero, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveAF:=DdlAF.SelectedValue.ToEntero, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero) Then
|
||||
ObjContratos.Commit()
|
||||
Alert("Actualizado Correctamente.")
|
||||
@@ -155,10 +198,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
|
||||
@@ -185,4 +224,11 @@ Partial Class RepContratosCalendario
|
||||
ObjContratos.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Protected Sub RBTipoVista_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
InicializaCalendar()
|
||||
CargaCronograma()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user