//替换对垒位置 public bool ReplaceMatch(int cyclingMatchId, int memberId, out string msg) { bool flag = false; msg = string.Empty; try { t_event_cycling_match tmatch = _dbContext.Get <t_event_cycling_match>(cyclingMatchId); if (tmatch != null) { _dbContext.Execute($"update t_event_cycling_match set congroupNum='{tmatch.progroupNum}',progroupNum='{tmatch.congroupNum}',updatetime='{DateTime.Now}' where id={cyclingMatchId}"); flag = true; } else { msg = "对垒信息有误"; } } catch (Exception ex) { flag = false; msg = "服务异常"; LogUtils.LogError("EventCyclingMatchService.ReplaceMatch", ex); } return(flag); }
//替换裁判 public bool ReplaceReferee(int cyclingMatchId, int refereeId, int memberId, out string msg) { bool flag = false; msg = string.Empty; try { t_event_cycling_match tmatchreferee = _dbContext.Get <t_event_cycling_match>(cyclingMatchId); if (tmatchreferee != null) { t_event_referee_signup referee = _dbContext.Select <t_event_referee_signup>(c => c.memberId == refereeId && c.eventId == tmatchreferee.eventId).FirstOrDefault(); if (referee != null) { tmatchreferee.refereeId = refereeId; tmatchreferee.updatetime = DateTime.Now; _dbContext.Update(tmatchreferee); flag = true; } else { msg = "裁判信息有误"; } } else { msg = "需要被替换的裁判信息有误"; } } catch (Exception ex) { flag = false; msg = "服务异常"; LogUtils.LogError("EventCyclingMatchService.ReplaceReferee", ex); } return(flag); }
//替换教室 public bool ReplaceRoom(int cyclingMatchId, int roomId, int memberId, out string msg) { bool flag = false; msg = string.Empty; try { t_event_cycling_match tmatch = _dbContext.Get <t_event_cycling_match>(cyclingMatchId); 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("EventCyclingMatchService.ReplaceRoom", ex); } return(flag); }