This commit is contained in:
@@ -86,14 +86,8 @@ Partial Class RH_Organigrama
|
||||
CveEmpresaFiltro = UsuarioActual.CveEmpresa
|
||||
NivelOrg = If(rgx.IsMatch(txtNivel.Text), txtNivel.Text.ToEntero, NivelOrg)
|
||||
txtNivel.Text = ""
|
||||
DdlSupervisorOrganigrama.SelectedIndex = 0
|
||||
ScriptManager.RegisterClientScriptBlock(Me, [GetType], "mykey", "drawChart()", True) 'ejecutamos la funcion de js para que haga la consulta de los registros
|
||||
End Sub
|
||||
'DdlSupervisorOrganigrama.SelectedIndex = 0
|
||||
|
||||
#End Region
|
||||
|
||||
<WebMethod()>
|
||||
Public Shared Function FetchData() As List(Of Object)
|
||||
Dim ObjRH As New ClsRH
|
||||
Dim DtTemporal As New DataTable
|
||||
Dim chartData As New List(Of Object)()
|
||||
@@ -110,8 +104,33 @@ Partial Class RH_Organigrama
|
||||
chartData.Add(New Object() {headerEmpleado, If(nombreEmpleado = nombreSuperior, "", nombreSuperior), puesto})
|
||||
Next
|
||||
End If
|
||||
Dim str As String = (New Script.Serialization.JavaScriptSerializer()).Serialize(chartData)
|
||||
LblJson.Text = str
|
||||
'ScriptManager.RegisterClientScriptBlock(Me, [GetType], "mykey", "drawChart()", True) 'ejecutamos la funcion de js para que haga la consulta de los registros
|
||||
End Sub
|
||||
|
||||
Return chartData
|
||||
#End Region
|
||||
|
||||
<WebMethod()>
|
||||
Public Shared Function FetchData() As String
|
||||
Dim ObjRH As New ClsRH
|
||||
Dim DtTemporal As New DataTable
|
||||
Dim chartData As New List(Of Object)()
|
||||
|
||||
If ObjRH.GetOrganigrama(CveEmpresaFiltro, CveCabecera, NivelOrg) Then
|
||||
DtTemporal = ObjRH.DtResultados.Copy
|
||||
|
||||
For Each renglon As DataRow In DtTemporal.Rows
|
||||
Dim nombreEmpleado As String = renglon("nombreEmpleado").ToString
|
||||
Dim nombreSuperior As String = renglon("nombreSuperior").ToString
|
||||
Dim puesto As String = renglon("puesto").ToString
|
||||
Dim headerEmpleado As String = String.Format("{{{2}v{2}:{2}{0}{2},{2}f{2}:{2}{0}<div style='color:#32A1CF;font-size:10px;font-style:italic'>{1}</div>{2}}}", nombreEmpleado, puesto, ControlChars.Quote) 'este es el JSON que da formato a los subtitulos se hace en String y la funcion lo hace JSON
|
||||
|
||||
chartData.Add(New Object() {headerEmpleado, If(nombreEmpleado = nombreSuperior, "", nombreSuperior), puesto})
|
||||
Next
|
||||
End If
|
||||
Dim str As String = (New Script.Serialization.JavaScriptSerializer()).Serialize(chartData)
|
||||
Return str
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user