public List<AccidentDTO>GetAccident(string Username) { Transaction trans = new Transaction(); List<AccidentDTO> accident; AccidentRDG accidentRDG = new AccidentRDG(trans); trans.BeginTransaction(); try { accident = accidentRDG.GetAccident(Username); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return accident; }
public void DeleteAccident(string Username) { Transaction trans = new Transaction(); AccidentRDG accidentRDG = new AccidentRDG(trans); trans.BeginTransaction(); try { accidentRDG.DeleteAccident(Username); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }