Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can someone help me finish my c# code InsertTransaction() – Inserts a transactio

ID: 3834015 • Letter: C

Question

can someone help me finish my c# code

InsertTransaction() – Inserts a transaction into the DB. This insert inserts data about an insert or
a delete, including data affected and a timestamp. The GetGetDateTimeString() gets a
formatted string ready to be inserted into the table without additional formatting in the SQL
string.

// Insert a transaction for audit trail
public static int InsertTransaction(string userName, int qtyChange, Part p, string type)
{
// Declare an int to contain a count of records affected by operation
int records = 0;
// Declare and set sql statement string to insert data into the
// tblTransaction table - use GetDateTimeString() for the Date
  
// Execute insert - set records to count affected
  
// Return number of records affected
return records;
}

All Access Obje EEE tblTransactions EE tblParts fldMake fldName fld Price fldQuantity Click to Add fldID Search... $120.00 Chevrolet Radiator Tables $12.00 2 Chevrolet Fan Belt 40 EEE tbl Parts. 3 Chevrolet Tail Lamp Bulb $5.00 45 EEE tbITransactions Head Light $15.00 4 Chevrolet 30 25 $65.00 5 Chevrolet Battery $10.00 6 Chevrolet Air Filter

Explanation / Answer

using(TransactionScope tran = new TransactionScope()) { CallAMethodThatDoesSomeWork(); CallAMethodThatDoesSomeMoreWork(); tran.Complete(); }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote