Well, a problem I might face is I dont know what records exist when .. lets say you have this record
BudgetId BudgetName BudgetTotalAmount
111 Road-const 15,00,000
If you want to 'insert data for the next Project with BudgetId 111 you 'get'/retrieve all the project records
ProjectId ProjectName AllocatedAmount BudgetId
25 R-25 5,00,000 111
26 ABBS-56 2,00,000 111
27 ABBS-57 3,00,000 111
and then sum the Allocated amount - then you have the two amounts you need, yes ? .. if you have a list of these records, you can use LINQ to select by BudgetId 111 and sum AllocatedAmount