Beispiel #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();
        }
Beispiel #2
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;
        }
Beispiel #3
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;
        }
Beispiel #4
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();
 }