Hello,
I am working on a partlist management page for the company. Basically partlist is a nested link between parts. for example;
Part A
. Part B
. Part C
. Part D
Part E
. Part A
.. Part B
.. Part C
.. Part D
. Part F
Right now I can achive this using 2 tables.
MID = Unique ID for each part
AID = Unique ID of assembly
Table 1: Assy
ID - MID
1 10 --> Part A
2 16 --> Part E
Table 2: Partlist
ID - AID - MID
1 1 33 --> Part B
2 1 56 --> Part C
3 1 28 --> Part D
4 2 10 --> Part A
5 2 62 --> Part F
Consider the case where I am doing a search to see if Part A has a partlist:
1) Look in [ASSY], does it contaion Part A (MID = 10) ? In this case YES
2) What is the ID of the assembly ? ID = 1
3) Look in Partlist and list the parts with AID = 1
This is straight forward for one level, consider part E.
1) Look in [ASSY], does it contain Part E (MID = 16) ? In this case YES
2) What is the ID of the assembly ? ID = 2
3) Look in [Partlist] and find the MID of the first part with AID = 2 (MID = 10)
4) Go back to [ASSY] and check if MID = 10 exists ? (YES)
5) If YES goto Step 1 with MID = 10
6) If NO find the next in [Partlist] where AID = 2
7) Continue until there are no parts with [AID = 2]
Basically with this you can have infinate many parts under infinete assemblies. But the problem is parts dont know which assembly they are under, same for assemblies, they dont know which assembly they are under.
With the above method, you enter your assemblies, and during an iteration they are called, but they dont know who is calling.
But I need to know which assembly a part is under. This is important because during the life of the part it can have different attributes under different assemblies,
such that Part B can be under 3 assemblies,
Under assembly 1 - Part B is painted blue
Under assembly 2 - Part B is painted red
Under assembly 3 - Part B is painted green
and this is the kind of info I need to track...
But in the iteration above, Part B doesnt know if it is being listed for ASSY 1, or 2 or 3 ....
I hope I made the problem clear, can anyone give me some adcive as to how I can go about tracking which assembly a part is linked to ?
(If you think there is a better place to post my question please send me an email: chako@operamail.com)
Thanks