Closed Preshen99 closed 1 year ago
Create Transaction Add _[Bind(Include = "table_columns")] to Action Result Parameter Create and Save Transaction first with db.Add and db.SaveChanges()_ Create the variables for the following:
Update and Save Client Table with the new data: db.Entry(client).State = EntityState.Modified and db.SaveChanges()
Edit Transaction Add _[Bind(Include = "table_columns")]_ to Action Result Parameter Create Variable for the Transaction Amount prior to being edited: decimal preAmount NOTE: Variable create before checking ModelState. This has not been tested within the ModelState. Create Variable for the following:
Create an IF Statement to check if Transaction Amounts are the same. Else Subtract Calculated Amount (No.2) from Client Balance Update and Save Client Table with the new data: db.Entry(client).State = EntityState.Modified and db.SaveChanges()
Delete Transaction Add _[Bind(Include = "table_columns")]_ to Action Result Parameter Create the variables for the following:
Update Client Table, Delete Transaction, Save Changes: db.Entry(client).State = EntityState.Modified , db.table_object.Remove(table_variable) , and db.SaveChanges()
Problem: Trying to update the ClientBalance in the Client DB was the hardest issue to try and resolve, currently not resolved either.
Issues Faced:
Solutions Tested:
Solution: