Last post Sep 06, 2017 06:51 PM by march11
Jun 19, 2013 01:52 AM|ASPcats|LINK
I've been thinking about redesigning the structure of my database, mostly in reguards to how clients and staff data is stored and what would be the most efficient and effective way of doing it. I'm using the CodeFirst method with VS 2012, SQL Server Management
Studio 2012, C#, MVC 4, .Net 4.5. Here's what I've been thinking so far:
Store all a user's personal data (User name, first name, last name etc) in a table called User Profile.
When I want to get a list of clients/staff I get a list of UserpPofiles where thier role is Staff or Client.
Problem: Seems inefficient and what happens if I want to store data only about Staff? Where would I put it?
In C# code have a UserProfile, Client and Staff class. The last 2 inherit from UserProfile so I don't have duplicate code. It also allows me to retrieve a list of clients or staff without checking thier role in a seperate table.
Problem: What do I do when create a user? The membership.CreateUserAndAccount( ... ) method only creates it in the UserProfile table as far as I know. So if I create a Staff entry say, what happens when I want that staff member to log in? Would the program
be able to find the staff member's password?
Sep 06, 2017 06:51 PM|march11|LINK
Okay, when you are in your design phase, its technically necessary to know the language you are using (C#) most languages will support the design of a project such as this.
Your considerations for design may also be impacted by who will be able to view the data. For example, are there staff managers that can view client profiles?
Maybe all profiles can go into the same table but add a flag of some sort that explains the profile type (S= staff, C= client) then you can filter on this value without creating another table to store additional data, unless that design has a more practical
reason like the volume of profile info to be stored.
You have many more issues to answer before you begin coding.
Do you have any written requirements for this project?