In one table iam having id,itemid,availableQuantity -Iam showing this details in grid.
In grid iam having another column Alloted Qty....So,If i enter data in alloted qty then
Click on save the data will be saved in one table (A) which is having all these fields and at the same time it should update remaining tables:
Such as B,C
then the trigger on storedprocedure i have to write so that while clicking save
in B table insert the same data but those column names are diff,Such as in A...
id,itemid,availableQuantity,allotedQty - A
No,id,Qty,Qtyalloted -B
In C Table (Main table),the fields are - we are having the same fields as in A but one extra field to know the CurrentQty (availableQty - Alloted Qty)
So,Based on the alloted Qty the currentQty Should be Updated
So While Inserting in A the data should be Updated in C
Intially both availableQty and currentQty are same ,But while inserting the data should be updated such as
If available qty is 14 , Alloted Qty In grid is 12
Initially in C id,itemid,availableQuantity, currentQty
then the data in C is initially
id -1
itemid-A
Available Qty-14
CurrentQty-14
Now from frontend 12 is given then the data in A :
So inserting the record in database such that
id,itemid,availableQuantity,allotedQty
1 A 14 12
In table B:
No,id,Qty,Qtyalloted
1 A 14 12
In Table C (i have to update the CurrentQty which is intially 14)
id -1
itemid-A
Orginal Qty-14
CurrentQty-14-12 =2
Thanks