public bool Refresh(string userGuid, List<UserRoom> values)
        {
            bool result = false;

            UserRoomHiberante hibernate = new UserRoomHiberante();
            result = hibernate.DeleteByUser(userGuid);
            if (result)
            {
                if (values != null)
                {
                    for (int i = 0; i < values.Count; i++)
                    {
                        result = hibernate.Insert(values[i]);
                        if (!result)
                        {
                            break;
                        }
                    }
                }
            }

            return result;
        }
        public List<Room> RefreshRooms(User value)
        {
            List<Room> results = null;

            RoomHibernate roomHibernate = new RoomHibernate();
            int total = 0;
            List<Room> rooms = roomHibernate.Query(1, int.MaxValue, ref total);
            if (value.Prerogative)
            {
                results = rooms;
            }
            else
            {
                UserRoomHiberante userRoomHiberante = new UserRoomHiberante();
                List<UserRoom> userRooms = userRoomHiberante.QueryByUser(1, int.MaxValue, ref total, value.Guid);
                if ((userRooms != null) && (userRooms.Count > 0))
                {
                    if ((rooms != null) && (rooms.Count > 0))
                    {
                        results = new List<Room>();
                        for (int i = 0; i < userRooms.Count; i++)
                        {
                            for (int j = 0; j < rooms.Count; j++)
                            {
                                if (string.Equals(userRooms[i].RoomId, rooms[j].Guid, StringComparison.CurrentCulture))
                                {
                                    results.Add(rooms[j]);
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            return results;
        }