I have designed a winforms Application and I have written all the code except one thing has confused me. I am designing something to manage a shop. I have a table 'stock' with columns [ID,Name,Cost_px,Selling_px,Quantity]
, Another table 'sales' with columns [date,ID,Name,Quantity,px_sold,income]
. I have a form(ID,quantity,price_sold
) to enter sales and its connected to the 'sales' table.
What can I do so that Quantity in the 'stock' table is reduced automatically by the number of units sold.
eg. product ID=1, price_sold(one unit) = 20000, quantity = 8. this is entered into the 'sales' table, and quantity in the 'stock' table reduced by 8 automatically.
how can I do this.
Thank you.nice tyme.