Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 1-Nov-12 20:46pm
Edited 1-Nov-12 21:01pm
v2
Comments
Milind Thakkar at 2-Nov-12 1:49am
   
Good application. Go ahead and develop. And when you face any issue, do post a "question".
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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... Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You need to think in a normalized fashion to do this.
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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 BillWoodruff 170
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100