//赛事管理员 批量签到 public bool BatchSign(List <int> memberId, int eventId, EventSignTypeEm eventSignType, out string msg) { bool flag = false; msg = string.Empty; try { var sql = "update t_event_sign set eventSignStatus=@EventSignStatus,signtime=@SignTime where eventSignType=@EventSignType and memberId in @MemberId and eventId=@EventId and signDate=@SignDate "; var dy = new DynamicParameters(); dy.Add("MemberId", memberId.ToArray()); dy.Add("EventId", eventId); dy.Add("EventSignType", eventSignType); dy.Add("EventSignStatus", EventSignStatusEm.已签到); dy.Add("SignTime", DateTime.Now); dy.Add("SignDate", DateTime.Now.ToString("yyyy-MM-dd")); _dbContext.Execute(sql, dy); flag = true; } catch (Exception ex) { flag = false; msg = "服务异常"; LogUtils.LogError("EventSignService.BatchSign", ex); } return(flag); }
public ContentResult batchsign(List <int> memberId, int eventId, EventSignTypeEm eventSignType) { string msg = string.Empty; var flag = _eventSignService.BatchSign(memberId, eventId, eventSignType, out msg); return(Result <string>(flag, msg)); }
//选手/裁判获取签到信息 public SignResponse GetSign(int eventId, int memberId, EventSignTypeEm eventSignType) { SignResponse response = null; try { var sql = $@"select a.id,b.code EventCode,b.name EventName,a.signdate,a.eventSignStatus from t_event_sign a inner join t_event b on a.eventId=b.id where a.isdelete=0 and a.eventId=@EventId and a.memberId=@MemberId and a.signdate=@SignDate and a.isStop=@IsStop and a.eventSignType={(int)eventSignType}"; var dy = new DynamicParameters(); dy.Add("EventId", eventId); dy.Add("IsStop", false); dy.Add("MemberId", memberId); dy.Add("SignDate", DateTime.Now.ToShortDateString()); response = _dbContext.QueryFirstOrDefault <SignResponse>(sql, dy); } catch (Exception ex) { LogUtils.LogError("EventSignService.GetSign", ex); } return(response); }