private void loadAdminTable() { AdminsTable.Clear(); RoomMember roomAdmins = new RoomMember(); roomAdmins.GetAllAdminMembersByRoomID(RoomID); Helper.Enums.RoomMemberLevel adminType; for (int i = 0; i < roomAdmins.RowCount; i++) { adminType=Helper.EnumUtil.ParseEnum<Helper.Enums.RoomMemberLevel>(roomAdmins.RoomMemberLevelID); AdminsTable.Rows.Add(roomAdmins.MemberID, roomAdmins.GetColumn("MemberName"), roomAdmins.RoomMemberLevelID, Helper.StringEnum.GetStringValue(adminType)); roomAdmins.MoveNext(); } }
public void closeRoom(int roomID, int adminID, string adminName) { RoomMember roomMember = new RoomMember(); if (!roomMember.HasExisitingMembersExceedCurrentMemberLevel(roomID, adminID)) { Room r = new Room(); if (r.LoadByPrimaryKey(roomID)) { r.RowStatusID = (byte)Helper.Enums.RowStatus.TemporaryDisabled; r.Save(); roomMember.OutRoomMembers(roomID); Clients.Group(roomID.ToString()).closeRoom(roomID, adminName); } } else { throw new UnauthorizedAccessException("لا يمكن غلق الغرفة فى وجود " + Helper.TypeConverter.ToString(roomMember.GetColumn("MemberName"))); } }
public int GetQueueOrder(int memberID, int roomID) { int value = 0; RoomMember member = new RoomMember(); member.LoadByPrimaryKey(memberID, roomID); RoomMember order = new RoomMember(); order.GetMaxQueueOrderByRoomID(roomID); if (member.IsColumnNull("QueueOrder")) { member.QueueOrder = Convert.ToInt32(order.GetColumn("MaxQueueOrder")) + 1; value = member.QueueOrder; } else member.SetColumnNull("QueueOrder"); member.Save(); return value; }