Esempio n. 1
0
        /// <summary>
        ///     批量添加投注
        /// </summary>
        /// <param name="prizebetting">投注信息集合</param>
        /// <returns>业务操作结果</returns>
        public OperationResult Add(IEnumerable <PrizeBetting> prizebettings)
        {
            int rcount = PrizeBettingRepository.Insert(prizebettings);

            if (rcount > 0)
            {
                return(new OperationResult(OperationResultType.Success, "批量奖单投注成功。"));
            }
            else
            {
                return(new OperationResult(OperationResultType.Warning, "批量奖单投注失败。"));
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     添加奖品
        /// </summary>
        /// <param name="prizebetting">奖品信息</param>
        /// <returns>业务操作结果</returns>
        public OperationResult Add(PrizeBetting prizebetting)
        {
            var entity = PrizeBettingRepository.Entities.SingleOrDefault(pb => pb.Member.Id == prizebetting.Member.Id && pb.PrizeOrder.Id == prizebetting.PrizeOrder.Id && !pb.IsDeleted);

            if (entity != null)
            {
                return(new OperationResult(OperationResultType.Warning, "您只能抽奖一次,请勿重复抽奖。", prizebetting));
            }
            int rcount = PrizeBettingRepository.Insert(prizebetting);

            if (rcount > 0)
            {
                return(new OperationResult(OperationResultType.Success, "奖单投注成功。", prizebetting));
            }
            else
            {
                return(new OperationResult(OperationResultType.Warning, "奖单投注失败。"));
            }
        }