예제 #1
0
        // will only allow one RequestEntity per user.
        public bool SetRequestEntity(int requestEntityId, int userId)
        {
            RequestEntity re = this.requestEntityRepository.Get(requestEntityId);
            AdminUser     u  = this.userTasks.GetAdminUser(userId);

            if (u != null)
            {
                foreach (RequestEntity e in this.requestEntityRepository.GetAll())
                {
                    u.RemoveRequestEntity(e);
                }
                if (re != null)
                {
                    u.AddRequestEntity(re);
                }
                return(true);
            }
            return(false);
        }