Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically providing textboxes for input

Status
Not open for further replies.

david7777777777

Programmer
Sep 26, 2001
417
US
Disclaimer: I am not asking for anyone to write my code for me, I am seeking only advice, opinions, and hopefully a learned lesson or two I can avoid. I can dream....

I'm working with a MS-SQL 2000 database on Windows 2000 Server and building an ASP.Net application using Visual Studio .Net. This application will be used by our employees to enter client - to - employee relationships. Basically the employees in each department will enter every client (customer) they work with and list each employee who is responsible for working with each client.

The database:

tblClients
ClientID (PK)

tblClientTeams
TeamID (PK)
ClientID
TeamMember1
TeamMember2
TeamMember3

I know that each client team will have exactly 1 client and 3 employees: no problem. But each department has a different number of these client teams that need to be entered via a web form.

Here's my problem: I need to figure out how to dynamically provide a user-defined number of [input textboxes] when the employees go to enter the client team info for their department, since each department has a different number of entries to make. I looked at how UPS provides 5 additional textboxes for tracking multiple packages but I couldn't find any helpful info in their client-side code, obviously.

I hope I've explained this sufficiently. I'm just looking for someone to point me in the right direction, whether that is a website resource, some logical process thoughts, a question, or a good slap upside the head. Thanks.



 
Here's the first solution I just thought of, but I'm sure it's a rather clunky way to do it...

1. Create 5 different input pages, named appropriately: One with one textbox, one with two textboxes, and so on up to 5.

2. Create a "prompt" page where the user would select a number from 1 to 5 from a drop-down list. Prompt: "How many entries do yu need to make? Select a number from the list."

3. The selection from the drop-down list calls the appropriate page, which is pre-built with the same number of input textboxes as the value the user selected from the drop-down box.

Am I going in the right direction? Can you tell I'm a beginner developer? ;-)
 
I have a few suggetions that may make any future changes to company policy or exceptions to the general rules easier to implement if you need to do anything at all.

First off try to make everything as dynamic as possible then scale down to fit your needs/time constraints whatever.

tblClients
ClientID (PK)
...other needed fields

tblClientTeams
TeamID (PK)
ClientID (FK)
DeptID (FK)
TeamDesc
...other needed fields

tblDepartments
DeptID (pk)
Desc
...other needed fields

tblMembers
MemberID (PK)
Desc
Login
Pass
...other needed fields

tblTeamMembers
MemberID (FK)(PK)
TeamID (FK)(PK)

Now what I have created enables you to have as many team members as you want for any given team. Each team is assigned to a single department and client. (You may want to do the same thing to client that I did to Member so you can have multiple clients per project)

As for entering data you basically have a form for each table. The first one could be 'department', then 'member', then 'team'. In the Team form have a datagrid or a list of sorts that shows current team members. Have an Ad Team member button that allows you to assign a member to that team. That member should now show up in the member list which is driven from the tblTeamMembers table.

There are alot of different ways to do up an interface for this. It's up to you to decide how you want the achieve the interface.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Awesome Mark, thanks. I understand and agree with your direction here. As it turns out, I only need to manage these entities:

1. Client Teams
2. Clients
3. Client team members (employees)

I don't need to involve Departments as far as I can tell, but please correct me if I am missing something here. I basically just need to show which Client Team Members (employees) are on a particular Client Team.

I also have a security requirement for this application, and it appears you already anticipated that by including the "Login" and PWD" fields in the tblMembers table. The requirment is that team members can only view & edit this client team data for their own team. So I've got to create a way to restrict their access based on team membership. I was going to handle this using NTFS permissions since I am very experienced in that area, but I'd love to hear if you have a better suggestion for restricting access. Is this what the logins in the Members table will do for me? Thanks.
 
Ok so just get rid of the tblDepartments table. Keep the rest of them for the reasons noted above.

As far as the login goes I would lean towards a forms authentication method rather than Windows or NTFS. Why? Well with forms authentication it is quite simple to have users login from anywhere in the world.

With the Login method I have sugested you could simply check to see what team/s the logged in user belongs to and load only data from that team. My take on it is to give the user access to what they have permission to view rather than to deny them access to what they don't have permissions for.

For more info on Forms Authentication check it out in the VS help files. There are some great tutorials to get you started in there.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top