Last post Apr 08, 2016 09:01 AM by Zhi Lv - MSFT
Apr 08, 2016 06:58 AM|longinos|LINK
I don't know if this is the right fórum
I have been strugling with the idea of knowing how to do this, for a long long time
I buy computer parts: hard dirves, motherboards, memory, etc. , and I insert them in the database as inventory,
then I sell the whole computer that consists of several ítems of the database inventory, that I had already inserted
The problem is to sell them as one unit or one kit,
So I sell one Product that is made of many ítems in the database,
How to make one product afect the ítems selected for that product ?
I am using c#, mvc 6, and ms sql
Apr 08, 2016 09:01 AM|Zhi Lv - MSFT|LINK
From your description, it seems that you want to update the inventory. If that is the case, I'm not suggest you configure relationship between them.
When buy the computer parts, you can call the insert or update method to update the computer parts inventory.
When sell the whole computer, you can get the computer configuration information, then according it update the inventory. I suggest you can create a stored procedure, and use transaction to do that (first, according the computer id to get the computer configuration
information, then update the computer parts inventory one by one).