示例#1
0
        public static RoomInfo SetRoomInfoTb(Room room, long userID)
        {
            bool        exists     = false;
            RoomInfoDAL dal        = new RoomInfoDAL();
            string      roomInfoID = string.Empty;

            do
            {
                roomInfoID = Guid.NewGuid().ToString();
                exists     = dal.GetExistsByRoomInfoID(roomInfoID);
            } while (exists);

            RoomInfo roomInfo = new RoomInfo();

            roomInfo.RoomInfoID      = roomInfoID;
            room.RoomInfoID          = roomInfoID;
            roomInfo.RoomID          = room.RoomID;
            roomInfo.IsBenJi         = room.is_benji ? 1 : 0;
            roomInfo.IsWGJ           = room.is_wgj ? 1 : 0;
            roomInfo.IsXinQiJi       = room.is_xinqiji ? 1 : 0;
            roomInfo.IsSangXiaJi     = room.is_shangxiaji ? 1 : 0;
            roomInfo.CountPointsType = room.is_yikousan ? 1 : (room.is_lianz ? 3 : 0);
            roomInfo.RoomPeo         = room.room_peo;
            roomInfo.RoomNumber      = room.count;
            roomInfo.CreateDate      = DateTime.Now;
            roomInfo.CreateUserID    = userID;
            roomInfo.IsYuanQue       = room.IsYuanQue?1:0;
            roomInfo.QuickCard       = room.QuickCard ? 1 : 0;
            return(roomInfo);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="roomID">房间ID</param>
        /// <param name="roomNumber">创建的房间局数</param>
        /// <param name="roomType">房间类型</param>
        /// <param name="multiple">房间最高倍数</param>
        /// <param name="groupID">圈子ID</param>
        /// <param name="createUserID"></param>
        public DDZRoom(int roomID, int roomNumber, int roomType, int maxMultiple, int groupID, long createUserID)
        {
            RoomID       = roomID;
            RoomNumber   = roomNumber;
            RoomType     = roomType;
            MaxMultiple  = maxMultiple;
            GroupID      = groupID;
            CreateUserID = createUserID;
            CreateDate   = DateTime.Now;
            bool        exists     = false;
            string      roomInfoID = string.Empty;
            RoomInfoDAL dal        = new RoomInfoDAL();

            do
            {
                roomInfoID = Guid.NewGuid().ToString();
                exists     = dal.GetExistsByRoomInfoID(roomInfoID);
            } while (exists);
            RoomInfoID        = roomInfoID;
            CurrentRoomNumber = 1;
            CurrentMultiple   = 1;
        }