Пример #1
0
        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();
        }
Пример #2
0
        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;
        }
Пример #3
0
 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();
 }
Пример #4
0
        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;
        }
Пример #5
0
        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;
        }
Пример #6
0
        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;
        }
Пример #7
0
 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();
 }