473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

VB-WEB: How to maintain a simple member signup db for a club

3
Experts: Please advise this newbie (me) as to coding techniques that might answer the following quandry:

The overall object is to allow people in a club (in my case, the YMCA Adventure Guides (AG for short)) to sign up for various club activities. The interface I would like to present is one where the user would select an activity (ie, through a drop-down list), such as "Hiking in the woods", then optionally select a subgroup (circle) of the AG members whose attendance status the user wants to adjust. At this point, a grid would appear that shows:

- One row for each member of the AG (or selected circle).
- One column each for
- No response (default)
- NOT going
- IS going

Each cell in the displayed columns would be a mutually exclusive radio button. The user (such as a circle leader) would go down the list of names and enable the radio button for one of the three options next to each name. (Default would be "No resonse".) When all appropriate buttons are selected, the user would click "Update Headcount", and each user's attendance status would be written to the DB.

Since membership and activities can vary all the time, MY THINKING SO FAR (and I might not be thinking correctly) has been to maintain at least three tables to support the above operation:

ACTIVITY
activity_id
activity_name

MEMBER
member_id
circle_id
member_name

HEADCOUNT
headcount_id
activity_id
(FK) member_id
no_answer (bit)
not_going (bit)
is_going (bit)

The main problem that I'm trying to solve is how to display the interface described when:

- To display the default no_answer radio button, a HEADCOUNT record for the member (for the selected activity) MIGHT NOT EVEN EXIST YET. (Otherwise I'd have to add dummy (member-acitvity) records every time I add a member to the AG or a new activity.)
- When the not_going or is_going radio button is changed between the various options, I must be able to add a HEADCOUNT record for those that don't exist yet for some of the members (ie, those in the original "no response" state), or UPDATE a record that already exists for members who, say, have decided not to go to the activity but now want to go.

On other forums, people have given me high-level suggestions such as using nested datalists or stored procedures. Its also been suggested that I use an outer JOIN to assist with the display of names when no corresponding HEADCOUNT record exists for a member for an activity. But this advise is too high level. If you can provide me with more detailed techniques, I be most grateful!

Thanks.

-Kurt
Feb 10 '08 #1
4 1983
Shashi Sadasivan
1,435 Expert 1GB
Joining of the tables to get the required data all in one go is what I would be loking for.

Expand|Select|Wrap|Line Numbers
  1. Select activity.*, member.*, headcount.*
  2. from headcount inner join activity on headcount.activity_id = activity.activity_id
  3. Left outer join member on headcount.member_id = activity.member_id
  4. where headcount.member_id = @Id_of_logged_in Member
this will join headcount with activity, and show all the activites irrespective if the member is a part of it or not.

If the user wants to subscribe to one of those activites, check if the user exists in head count, and insert or update accordingly
Feb 11 '08 #2
keuler
3
Thanks Shashi. The select command will be useful. But what I'm most interested in is how to, as you write "check if the user exists in head count, and insert or update accordingly".

Hmmm. Just thinking about this for a moment: Would you recommend I write a stored procedure run, soon as the user selects the activity and circle, that would create HEADCOUNT records for those users for whom records haven't yet been made, and THEN implement an UDPATE command? (No need for SELECT, I think, since the user is really going into this gridview to make updates.)

Thanks!

-Kurt



Joining of the tables to get the required data all in one go is what I would be loking for.

Expand|Select|Wrap|Line Numbers
  1. Select activity.*, member.*, headcount.*
  2. from headcount inner join activity on headcount.activity_id = activity.activity_id
  3. Left outer join member on headcount.member_id = activity.member_id
  4. where headcount.member_id = @Id_of_logged_in Member
this will join headcount with activity, and show all the activites irrespective if the member is a part of it or not.

If the user wants to subscribe to one of those activites, check if the user exists in head count, and insert or update accordingly
Feb 11 '08 #3
Shashi Sadasivan
1,435 Expert 1GB
To update the selections, when a user submits the form,
foreach activity from the dataset, retrieve the record for that activity from headcount for that user.

if there are no rows, and the user selected to join it, then you need to insert a new record, else do nothing

if there was a record returned, then you need to edit the record and update it.
Feb 11 '08 #4
keuler
3
THanks again Shashi. I'm starting to understand.

So, would this be the general flow:

1) The user selects an activity.
2) The user (optionally) selects a subgroup of users (circle).
3) The user clicks a button called something like Retrieve Headcount Data.
4) That click triggers an stored procedure, and that stored procedure:
a) Checks for the existence of a user-activity record in HEADCOUNT for each user, and creates one if one doesn't exist. (Not sure how to do this yet, but that's later.)
b) Populates the gridview with an UPDATE command that is similar to the SELECT command you proposed earlier. (I don't need a SELECT command in any of this, right, if I assume the user is proceeding with the intent to modify data?)

Thanks!!!

-Kurt



To update the selections, when a user submits the form,
foreach activity from the dataset, retrieve the record for that activity from headcount for that user.

if there are no rows, and the user selected to join it, then you need to insert a new record, else do nothing

if there was a record returned, then you need to edit the record and update it.
Feb 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Arsalan | last post by:
Is there any advantage in C# over VB.NET ? Or the difference is only syntax ? Can anything done in C# which cannot be done in VB.NET?
72
by: Robin Tucker | last post by:
I need to find some documents/research for my manager about VB.NET v C# use. I've noticed that there are many more people using C# than VB.NET, that there seem to be more job vacancies specifying...
28
by: Andy | last post by:
Any good resources regarding benefitis by using C3 over VB? /Andy
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
2
by: D H | last post by:
Hi, Hi, I was looking for your opinion on VB.NET - its long-term prospects, etc. Sorry this is vague, but it's not meant to be a troll. It's a pro-VB.NET post actually. I haven't used VB or...
19
by: lonelyplanet | last post by:
Hi, I'm studying for 70-306 using the book "MCAD/MCSD Visual Basic .NET Windows Applications" published by McGraw Hill (ISBN: 0-07-212583-7). I found the book has no programming exercise...
12
by: Striker | last post by:
I have never used VB, so sorry for the novice questions. I have a very small app in vba that only uses excel as a place to put a button and some code that I need to move to VB. Now it seems...
97
by: Master Programmer | last post by:
Thinking of learning VB.NET? New programmer? Thinking of Moving over from VB 6.0? Read on friend, let me help you make a more informed decision......... Microsoft are a pathetic company,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.