Ejemplo n.º 1
0
        //正反方互换
        public bool ReplaceMatch(int knockoutMatchId, int memberId, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                t_event_knockout_match tmatch = _dbContext.Get <t_event_knockout_match>(knockoutMatchId);
                if (tmatch != null)
                {
                    _dbContext.Execute($"update t_event_knockout_match set congroupNum='{tmatch.progroupNum}',progroupNum=''{tmatch.congroupNum}',updatetime='{DateTime.Now}' where id={knockoutMatchId}");
                    flag = true;
                }
                else
                {
                    msg = "对垒信息有误";
                }
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("EventKnockoutMatchService.ReplaceMatch", ex);
            }
            return(flag);
        }
Ejemplo n.º 2
0
        //替换教室
        public bool ReplaceRoom(int knockoutMatchId, int roomId, int memberId, out string msg)
        {
            bool flag = false;

            msg = string.Empty;
            try
            {
                t_event_knockout_match tmatch = _dbContext.Get <t_event_knockout_match>(knockoutMatchId);
                if (tmatch != null)
                {
                    t_event_room room = _dbContext.Get <t_event_room>(roomId);
                    if (room != null && room.roomStatus == RoomStatusEm.闲置)
                    {
                        tmatch.roomId     = roomId;
                        tmatch.updatetime = DateTime.Now;
                        _dbContext.Update(tmatch);
                        flag = true;
                    }
                    else
                    {
                        msg = "教室信息有误";
                    }
                }
                else
                {
                    msg = "对垒信息有误";
                }
            }
            catch (Exception ex)
            {
                flag = false;
                msg  = "服务异常";
                LogUtils.LogError("EventKnockoutMatchService.ReplaceRoom", ex);
            }
            return(flag);
        }