Load Multiple user data

i am student and newbie dhtmlx. I doing my final year project. Title is “CRM”

i using dhtmlxscheduler and dhtmlxconnector for my Events or appointment function. Everything working fine,just only facing a problem.

1)i dunno how to load & save current user ID to SQL(**all sample is using asp MVC,but i design with asp.net with VB).

Can somebody give some tutorial or samples? because i already suffering and confusing 1 month for this problem.
<Schedulerconnector.ashx>

[code]Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Configuration
Imports dhtmlxConnectors
Imports System.Web.Services

<WebService([Namespace]:=“http://tempuri.org/”)> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class schedulerConnector
Inherits dhtmlxRequestHandler

Public Overloads Overrides Function CreateConnector(ByVal context As HttpContext) As IdhtmlxConnector
    Return New dhtmlxSchedulerConnector("Events", "EventID",

dhtmlxDatabaseAdapterType.SqlServer2005, ConfigurationManager.ConnectionStrings(“Samplesdatabase”).ConnectionString,
“FromDate”, “ToDate”,“Subject as text, Details as details, Tags”)
End Function

End Class[/code]

<Calendar.aspx>

[code]<%@ Page Language=“vb” AutoEventWireup=“false” CodeBehind=“Calendar.aspx.vb” Inherits=“geng_8_vb.Calendar” %>

Index html, body { height:100%; padding:0px; margin:0px; }
 
 
[/code]

why no people can help?

Hello,
1)i dunno how to load & save current user ID to SQL(**all sample is using asp MVC,but i design with asp.net with VB).

Do you have column for user id in your Events table?
if so, you need to add it to connector configuration, eg
“Subject as text, Details as details, Tags, UserID”

Also you’ll have to attach BeforeProcessing event handler, to add current user id to newly added event

If you need to load different subsets of event for different users, you may attach appropriate rule to data request
connector.Request.Rules.Add(new FieldRule((TableField)“UserID”, Operator.Equals, currUserId))
in VB it will look like following, i think
connector.Request.Rules.Add(New FieldRule(DirectCast(“UserID”, TableField), [Operator].Equals, currUserId))

Where
“UserID” - column for events user,
currUserId - id of the logged in user

very thanks for helps, but i think i not very understand with ur explanation. i will try my best.
Yes…My table got userid column, just dunno how to save it n handle the save button

izit add the new rules in my schedulerconnector.ashx?

Aliaksandr
You are my hope~~~

hi,
check the following code

[code]Public Overrides Function CreateConnector(context As HttpContext) As IdhtmlxConnector
Dim UserID As Integer = 0

'somehow get user id- from query string, cookies, membership or some other way
If context.Request.QueryString("UserID") IsNot Nothing Then
	UserID = Convert.ToInt32(context.Request.QueryString("UserID"))
End If

Dim connector As New dhtmlxSchedulerConnector(  "Events", _
	"EventID", _
	dhtmlxDatabaseAdapterType.SqlServer2005, _
	ConfigurationManager.ConnectionStrings("Samplesdatabase").ConnectionString, _
	"FromDate", "ToDate", _
	"Subject as text, Details as details, Tags, UserID")'added user id to configuration

'attach handler
connector.Request.Rules.Add(New FieldRule(CType("UserID", TableField), [Operator].Equals, UserID))
'get by UserID
connector.BeforeDataActionProcessing += New EventHandler(Of DataActionProcessingEventArgs)(AddressOf connector_BeforeDataActionProcessing)

Return connector

End Function

Private Sub connector_BeforeDataActionProcessing(sender As Object, e As DataActionProcessingEventArgs)
If (e.DataAction.ActionType = ActionType.Inserted OrElse e.DataAction.ActionType = ActionType.Updated) AndAlso Not e.DataAction.Data.ContainsKey(CType(“UserID”, TableField)) Then
Dim UserID As Integer = 0
If HttpContext.Current.Request.QueryString(“UserID”) IsNot Nothing Then
UserID = Convert.ToInt32(HttpContext.Current.Request.QueryString(“UserID”))
End If
'add UserID to new or updated field
e.DataAction.Data.Add(CType(“UserID”, TableField), UserID.ToString())
End If
End Sub[/code]

just insert into my scheduler.ashx,right?

i will try ~~~love u ~~

Final questions~when debugging this error is come out~
why?

Billion advance thanks

Hi,
looks like instead of connector.BeforeDataActionProcessing += New EventHandler(Of DataActionProcessingEventArgs)(AddressOf connector_BeforeDataActionProcessing) there should be AddHandler connector.BeforeProcessing, AddressOf connector_BeforeDataActionProcessing

if my "userID"save in ASPNETDB.mdf? is work ?