Beispiel #1
0
        /// <summary>
        /// 添加评审
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public override async Task InsertAsync(Review entity)
        {
            var matchInstance = await MatchInstanceRepository.GetAsync(entity.MatchInstanceId);

            //if (matchInstance.MatchInstanceStatus != MatchInstanceStatus.Reviewing)
            //{
            //    throw new UserFriendlyException("当前赛事尚未结束申报,无法建立评选活动");
            //}
            //验证数据是否有效

            //if (await Repository.CountAsync(o=>o.MatchInstanceId==entity.MatchInstanceId && o.MajorId==entity.MajorId && o.SubMajorId==entity.SubMajorId && o.ReviewType == entity.ReviewType) > 0)
            //{
            //
            //}
            //初始化评审数据
            await InitReview(entity);

            await base.InsertAsync(entity);
        }