As a starting point to adding RSVP module to the kit:
I am making some minor changes to the DB Schema as follows:
<code>
DROP TABLE Attendance
GO
CREATE TABLE [Attendance] (
[event_mumber] [int] NOT NULL,
[member_number] [int] NOT NULL
) ON [PRIMARY]
ALTER TABLE [Attendance] ADD
CONSTRAINT [PK_Attendance] PRIMARY KEY CLUSTERED
(
[event_number],
[member_number]
) ON [PRIMARY]
GO
Alter TABLE [MemberInfo] ADD
{
[member_number] [int] not null
}
GO
Alter TABLE [Events] ADD
{
[event_number] [int] not null
}
GO
DROP TABLE CLUBCONTROL
GO
CREATE TABLE [ClubControl] (
[next_event_mumber] [int] NOT NULL,
[next_member_number] [int] NOT NULL,
[next_location_number] [int] NOT NULL,
) ON [PRIMARY]
</code>
What I am looking to accomplish for starters is.. .when creating a New Event, Location or a New Membership enrollment, I would like to have a stored proc or a modification to the datasource where it would go and get the next value for the given field.
The next step would be to populate the Attendance Table when on the events_view.aspx page a button would allow the person to RSVP hence adding a new row to the Attendance Table and that would be shown just below the Events Details.
I have started the mods but am no where near finished as the idea has to translate to Code and Stored Procs, so I am still trying to figure out where I would put these calls.
Why do you need to add new keys to the tables? The events table already has an id, the users already have ID's from the membership system. Use these keys and simplify your code. Your attendance table would then look like:
CREATE TABLE [Attendance] (
[eventid] [int] NOT NULL,
[member [uniqueidentifier] NOT NULL
) ON [PRIMARY]
You then don't need the stored procs, as you can use the keys already available on the tables. The uniqueidentifer is a guid, but as your only using it for lookups, it should not be a problem.
You then just need code to do an insertion into this table when the user clicks on RSVP. The display of members should be pretty easy, you can just join this table with the member_info table to get a list of names.
I tried to use the pre-existing field and setup foriegn keys based on them, if I remember I ran into some issues where I could not do updates by using them.
If you can elaborate a little I would certainly go that route, I like the idea of linkage tables so I can set the cardinality between Events/Members and Attendance.
I am working on the Forums now almost done and will tackle the Attendance next.
I.'m sure this is not exactly what you are looking for, but below is how I got the MemberID into a table. Who knows, perhaps it could be of any help.
Grtz,
Lex
<code>
Dim user As MembershipUser = Membership.GetUser()
TextBox2.Text = user.ProviderUserKey.ToString()
Dim errort
As String
Dim myConnection
As New SqlConnection(ConfigurationManager.ConnectionStrings("ClubSiteDB").ConnectionString)
Dim com As
New SqlCommand()
Try
myConnection.Open()
com.Connection = myConnection
com.CommandText =
"INSERT INTO Cursus (Cursus, UserIdCursus) Values (@Cursus, @UserIdCursus)"
aabruzzese
Contributor
2806 Points
759 Posts
Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 08, 2006 02:59 AM|LINK
Hi folks,
As a starting point to adding RSVP module to the kit:
I am making some minor changes to the DB Schema as follows:
<code>
DROP TABLE Attendance
GO
CREATE TABLE [Attendance] (
[event_mumber] [int] NOT NULL,
[member_number] [int] NOT NULL
) ON [PRIMARY]
ALTER TABLE [Attendance] ADD
CONSTRAINT [PK_Attendance] PRIMARY KEY CLUSTERED
(
[event_number],
[member_number]
) ON [PRIMARY]
GO
Alter TABLE [MemberInfo] ADD
{
[member_number] [int] not null
}
GO
Alter TABLE [Events] ADD
{
[event_number] [int] not null
}
GO
DROP TABLE CLUBCONTROL
GO
CREATE TABLE [ClubControl] (
[next_event_mumber] [int] NOT NULL,
[next_member_number] [int] NOT NULL,
[next_location_number] [int] NOT NULL,
) ON [PRIMARY]
</code>
What I am looking to accomplish for starters is.. .when creating a New Event, Location or a New Membership enrollment, I would like to have a stored proc or a modification to the datasource where it would go and get the next value for the given field.
The next step would be to populate the Attendance Table when on the events_view.aspx page a button would allow the person to RSVP hence adding a new row to the Attendance Table and that would be shown just below the Events Details.
I have started the mods but am no where near finished as the idea has to translate to Code and Stored Procs, so I am still trying to figure out where I would put these calls.
you can see the basic idea on my own server...
http://67.164.255.166:8029/default.aspx
Check the events_view page to see what I mean, remember the actual function is not running yet but it is mocked up.
samsp
Participant
1680 Points
330 Posts
Microsoft
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 13, 2006 05:05 PM|LINK
Why do you need to add new keys to the tables? The events table already has an id, the users already have ID's from the membership system. Use these keys and simplify your code. Your attendance table would then look like:
CREATE TABLE [Attendance] (
[eventid] [int] NOT NULL,
[member [uniqueidentifier] NOT NULL
) ON [PRIMARY]
You then don't need the stored procs, as you can use the keys already available on the tables. The uniqueidentifer is a guid, but as your only using it for lookups, it should not be a problem.
You then just need code to do an insertion into this table when the user clicks on RSVP. The display of members should be pretty easy, you can just join this table with the member_info table to get a list of names.
sam
aabruzzese
Contributor
2806 Points
759 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 14, 2006 12:56 PM|LINK
Hi Sam,
I tried to use the pre-existing field and setup foriegn keys based on them, if I remember I ran into some issues where I could not do updates by using them.
If you can elaborate a little I would certainly go that route, I like the idea of linkage tables so I can set the cardinality between Events/Members and Attendance.
I am working on the Forums now almost done and will tackle the Attendance next.
etrelin
Member
10 Points
2 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 14, 2006 02:07 PM|LINK
I like your website Forums,will please give me the programm?
etrelin@126.com
aabruzzese
Contributor
2806 Points
759 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 15, 2006 05:09 AM|LINK
Hello etrelin,
I will be sharing those mods when I am completely finished coding them, for now I am still tweaking and building the last couple of pages.
I based it on the ITCN forum, they have an old obsolete Freeware version which I am canabalizing and making it .NET 2.0 compatible.
aabruzzese
Contributor
2806 Points
759 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 19, 2006 04:59 AM|LINK
Hey so how do I pull the GUID to do my db insert ?
<code>
If Page User.Identity.IsAuthenticated Then
Member.???? = Membership.GetUser().ProviderUserKey
End If
</code>
What should I declare Member as at the top of my Page Script ?
aabruzzese
Contributor
2806 Points
759 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 19, 2006 05:48 AM|LINK
Never mind,
Did a little digging and found what I needed.
Dim memUser As MembershipUser = Membership.GetUser()
Dim uid As Guid = memUser.ProviderUserKey
lexy
Participant
1668 Points
441 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 19, 2006 08:16 AM|LINK
Hi Angelo,
I.'m sure this is not exactly what you are looking for, but below is how I got the MemberID into a table. Who knows, perhaps it could be of any help.
Grtz,
Lex
<code>
Dim user As MembershipUser = Membership.GetUser()TextBox2.Text = user.ProviderUserKey.ToString()
Dim errort As String Dim myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("ClubSiteDB").ConnectionString) Dim com As New SqlCommand() TrymyConnection.Open()
com.Connection = myConnection
com.CommandText =
"INSERT INTO Cursus (Cursus, UserIdCursus) Values (@Cursus, @UserIdCursus)"com.Parameters.Add(
"@Cursus", SqlDbType.VarChar, 99).Value = TextBox1.Textcom.Parameters.Add(
"@UserIdCursus", SqlDbType.VarChar, 99).Value = TextBox2.Textcom.ExecuteNonQuery()
Catch ex As Exceptionerrort = ex.Message
FinallymyConnection.Close()
com.Dispose()
End Try End Sub<code>
aabruzzese
Contributor
2806 Points
759 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 19, 2006 01:05 PM|LINK
Hi Lexy,
Thanks that confirms what I typed earleir.
Hey give me your email addy, I will package up the pages I have so far and also give you an SQL script to create the forums.
aabruzzese
Contributor
2806 Points
759 Posts
Re: Expanding the Club Starter Kit .. working to add RSVP to EVENTS
Mar 19, 2006 03:49 PM|LINK
Well I do have a rough version of the RSVP Module Working, am now adding the retrieval of the AVATAR for each user in the DATALIST.