Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I develop one Shoping application for Husband and Wife in Asp.net. In this application,first form is Login form,if husband or wife first login means,he/she create the shopinglistname.Example,husband login means ,he create shopinglist and add some items.then he logout.

Next,wife login means,she view the husband created shopinglist and add some items otherwise wife login means ,she create shopinglist and add some items.then she logout.Next,husband login means,he view the wife created shopinglist and add some items..How to create the shoplistname common for both husband and wife with based on login?...advance thanks.
Posted
Updated 1-Nov-12 20:01pm
v2
Comments
MT_ 2-Nov-12 1:49am    
Good application. Go ahead and develop. And when you face any issue, do post a "question".

You need to think in a normalized fashion to do this.
SQL
ShoppingList
      ID
      ... your other fields

Person (Table for anyone, both husbands and wives)
      ID
      ... your other fields

ShoppingListPeople
      ShoppingListID (Foreign Key to ShoppingList)
      PersonID   (Foreign Key to Person)


If you do this then you have achieved:
1) Normalized data
2) Now any number of people can be assigned to a given shopping list
 
Share this answer
 
I think you have to create Common unique Id for both Husband and wife
Ex
In Login table
Id, password, partnerId(for husband PartnerId is Husband&wife Common unique id and same for wife).

And
In shopinglist Table use PartnerId(foreign key ) so that Husband/Wife can view shopping list
 
Share this answer
 
along with HId and WId, u can keep a column CoupleId in database...assign this CoupleId to husband user record and wife user record. Then use HId and WId for login, but for shopping list, user CoupleId... :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900