RepServicioDomicilio base
This commit is contained in:
@@ -22,22 +22,60 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim FI As Date
|
||||
Dim FF As Date
|
||||
|
||||
If context.Request("U").ToEntero > 0 Then
|
||||
CveUsuario = context.Request("U").ToEntero
|
||||
CveEmpresa = context.Request("E").ToEntero
|
||||
FI = context.Request("start").ToDate
|
||||
If context.Request("METODO") IsNot Nothing Then
|
||||
|
||||
FF = context.Request("end").ToDate
|
||||
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then
|
||||
'Convierte el objeto de Eventos en JSON
|
||||
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
|
||||
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
|
||||
Select Case context.Request("METODO")
|
||||
Case "servicio_domicilio"
|
||||
|
||||
If context.Request("U").ToEntero > 0 Then
|
||||
|
||||
CveUsuario = context.Request("U").ToEntero
|
||||
CveEmpresa = context.Request("E").ToEntero
|
||||
FI = context.Request("start").ToDate
|
||||
FF = context.Request("end").ToDate
|
||||
|
||||
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF, CveOS:=-2) Then
|
||||
'Convierte el objeto de Eventos en JSON
|
||||
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
|
||||
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
|
||||
|
||||
context.Response.Write(sJSON)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Exit Select
|
||||
Case Else
|
||||
Exit Select
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
Else
|
||||
If context.Request("U").ToEntero > 0 Then
|
||||
CveUsuario = context.Request("U").ToEntero
|
||||
CveEmpresa = context.Request("E").ToEntero
|
||||
FI = context.Request("start").ToDate
|
||||
|
||||
FF = context.Request("end").ToDate
|
||||
If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then
|
||||
'Convierte el objeto de Eventos en JSON
|
||||
'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer
|
||||
Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events)
|
||||
|
||||
context.Response.Write(sJSON)
|
||||
End If
|
||||
|
||||
context.Response.Write(sJSON)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
|
||||
@@ -47,14 +85,15 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
End Property
|
||||
|
||||
|
||||
Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date) As Boolean
|
||||
Private Function GetEventos(CveUsuario As Integer, CveEmpresa As Integer, pFI As Date, pFF As Date, Optional CveOS As Integer = -1) As Boolean
|
||||
Dim ObjEventos As New ClsOIEventos
|
||||
Dim ErrorEventos = False
|
||||
Dim CveEmpresaCRM As Integer = 0
|
||||
If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuario, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF) Then
|
||||
If ObjEventos.GetEventos(-1, -1, -1, "-1", "-1", -1, CveUsuario, CveUsuario, -1, -1, -1, "-1", -1, -1, -1, -1, CveOS, -1, -1, -1, -1, -1, CveUsuario, CveUsuario, CveUsuario, CveEmpresa, pFI, pFF) Then
|
||||
|
||||
If ObjEventos.DtResultados.Rows.Count > 0 Then
|
||||
events = New List(Of CalendarEvent)
|
||||
|
||||
Try
|
||||
For Each dr As DataRow In ObjEventos.DtResultados.Rows
|
||||
Dim cevent As CalendarEvent = New CalendarEvent()
|
||||
|
||||
Reference in New Issue
Block a user