search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Help, I can not load events

Asked by nacho Cartes
14 years ago.

hola, disculpen mi ingles, hablo espaol....

no logro que mi DayPilotScheduler1 muestre los eventos..... les adjunto el codigo para que me indiquen que estoy haciendo MAL.

Code HTML--------------------------------------------------------

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Grilla.aspx.vb" Inherits="Grilla" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Pgina sin ttulo</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<DayPilot:DayPilotScheduler
ID="DayPilotScheduler1"
runat="server"

DataStartField="fechadesde"
DataEndField="fechahasta"
DataTextField="idalquiler"
DataValueField="idc"
DataResourceField="idc"

CellGroupBy="Month"
CellDuration="1440"
StartDate="2010-08-01"
Days="31"

Width="100%"
EventHeight="20"
HeaderFontSize="8pt"
EventFontSize="8pt"
EventMoveHandling="CallBack" BackColor="#FFFFD5" BorderColor="#000000" CellSelectColor="#316AC5" CssClass="" DurationBarColor="Blue" EventBackColor="#FFFFFF" EventBorderColor="#000000" HeaderFontColor="0, 0, 0" HeaderHeight="17" HourBorderColor="#EAD098" HourNameBackColor="#ECE9D8" HourNameBorderColor="#ACA899" NonBusinessBackColor="#FF8080" ScrollX="0" ScrollY="0" WeekStarts="Auto" Layout="Auto" UseEventBoxes="ShortEventsOnly" ViewType="Resources" ContextMenuID="nacho">

</DayPilot:DayPilotScheduler>
<asp:Button ID="Button1" runat="server" Text="Button" /></div>
</form>
</body>
</html>

Code aspx.net------------------------------------------------------

Partial Class Grilla
Inherits System.Web.UI.Page
Public CN As Data.OleDb.OleDbConnection
Public CM As Data.OleDb.OleDbCommand
Public DR As Data.OleDb.OleDbDataReader
Public SQL As String


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (Not IsPostBack) Then
'CADENA de CONEXION--------------------
Dim STRconexion As String
STRconexion = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("alquileres.mdb") + ";Persist Security Info=False"
CN = New Data.OleDb.OleDbConnection(STRconexion)
CN.Open()
'--------------------------------------
loadResources()

DayPilotScheduler1.DataSource = dbGetEvents(DayPilotScheduler1.StartDate, DayPilotScheduler1.Days)
'DayPilotScheduler1.DataSource = dbGetEvents("03/08/2010", "2")
DayPilotScheduler1.DataBind()

Dim mayFirst As New DateTime(2010, 8, 1)
DayPilotScheduler1.SetScrollX(DateTime.Today)
End If
End Sub

Protected Sub DayPilotScheduler1_EventMove(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.EventMoveEventArgs) Handles DayPilotScheduler1.EventMove

Dim id As String = e.Value
Dim start As DateTime = e.NewStart
Dim [end] As DateTime = e.NewEnd
Dim resource As String = e.NewResource

DayPilotScheduler1.DataSource = dbGetEvents(DayPilotScheduler1.StartDate, DayPilotScheduler1.Days)
DayPilotScheduler1.DataBind()
DayPilotScheduler1.Update()
End Sub

Private Function dbGetEvents(ByVal start As DateTime, ByVal days As Integer) As Data.DataTable

SQL = "select [idalquiler], [idcabaa] as idc, [fechadesde], [fechahasta] from alquileres where idcabaa=11 and fechadesde between #08/01/2010# and #08/31/2010#"
Dim da As New Data.OleDb.OleDbDataAdapter(SQL, CN)
Dim dt As New Data.DataTable()
da.Fill(dt)
Return dt

End Function

Private Sub loadResources()
'Aca llenamos la columna debajo de DEMO con la Habitaciones.....
Dim da As New Data.OleDb.OleDbDataAdapter("SELECT [idcabaa] as IDC, [idsocio] as IDS FROM [alquileres] where idcabaa=11 and fechadesde between #08/01/2010# and #08/31/2010#", CN)
Dim dt As New Data.DataTable()
da.Fill(dt)

For Each r As Data.DataRow In dt.Rows
Dim IDC As Integer = Convert.ToInt32(r("idc"))
Dim IdS As Integer = Convert.ToInt32(r("ids"))

DayPilotScheduler1.Resources.Add(IDC, IdS)
Next
End Sub

End Class

------------------------------------------------------------------------------------------------------

Resultado

DEMO agosto 2010
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

11
11


cualquier comentario es bienvenido!!!
saludos
y muchas gracias

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.