locked
One item made of several items RRS feed

  • Question

  • User-780198206 posted

    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

    Friday, April 8, 2016 6:58 AM

Answers

  • User-271186128 posted

    Hi longinos,

    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).

    Best regards,
    Dillion

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 8, 2016 9:01 AM