public void CreateUser(string UserName,string Password,string DeviceID) { Transaction trans = new Transaction(); PersonRDG personRDG = new PersonRDG(trans); trans.BeginTransaction(); try { personRDG.MakePerson(UserName, Password, MakeDeviceObjct(DeviceID)); personRDG.CreateUser(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }
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 DeviceRDG(Transaction trans) { this.trans = trans; cmd = new SqlCommand(); }
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(); }
public PersonDTO GetThisUser(string UserName) { Transaction trans = new Transaction(); PersonDTO user; PersonRDG personRDG = new PersonRDG(trans); trans.BeginTransaction(); try { user = personRDG.GetUserID(UserName); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return user; }
public List<PersonDTO> GetAllUsers() { Transaction trans = new Transaction(); List<PersonDTO> users; PersonRDG personRDG = new PersonRDG(trans); trans.BeginTransaction(); try { users = personRDG.GetAllUsersID(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return users; }
public List<DeviceDTO> GetAllDeviceID() { Transaction trans = new Transaction(); List<DeviceDTO> devices; DeviceRDG deviceRDG = new DeviceRDG(trans); trans.BeginTransaction(); try { devices = deviceRDG.GetAllDeviceID(); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); return devices; }
public void DeleteUser(string Username) { Transaction trans = new Transaction(); PersonRDG personRDG = new PersonRDG(trans); trans.BeginTransaction(); try { personRDG.DeleteUser(Username); } catch (Exception e) { trans.Rollback(); throw e; } trans.Commit(); }
public PersonRDG(Transaction trans) { this.trans = trans; cmd = new SqlCommand(); }
public AccidentRDG(Transaction trans) { this.trans = trans; cmd = new SqlCommand(); }