Beispiel #1
0
        /// <summary>
        /// 描述:正式数据表转介绍时间段验证
        /// <para>作    者:瞿琦</para>
        /// <para>创建时间:2018-10-29</para>
        /// </summary>
        /// <param name="beginDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <returns>无</returns>
        /// <exception cref="AMS.Core.BussinessException">
        /// 异常ID:11, 异常描述:此时间段内已存在转介绍的优惠设置
        /// </exception>
        private void ValidationCouponRule(DateTime beginDate, DateTime endDate)
        {
            var service = new CouponRuleService(this._schoolId);
            var result  = service.GetTypeByCouponRule(CouponType.Recommend);

            foreach (var item in result)
            {
                if ((item.BeginDate <= beginDate && beginDate <= item.EndDate) || (item.BeginDate <= endDate && endDate <= item.EndDate))
                {
                    throw new BussinessException(ModelType.Discount, 11);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 描述:审核终审通过
        /// <para>作    者:瞿琦</para>
        /// <para>创建时间:2018-10-29</para>
        /// </summary>
        /// <returns>无</returns>
        public override void ProcessAuditSuccess()
        {
            var couponRuleService = _tblAutCouponRuleRepository.GetAuditingCouponRule(base.TblAutAudit.AuditId);

            var tblAutCouponRule = couponRuleService.Select(x => new TblDctCouponRule
            {
                CouponRuleId   = x.CouponRuleId,
                SchoolId       = x.SchoolId,
                CouponRuleName = x.CouponRuleName,
                CouponType     = x.CouponType,
                FullAmount     = x.FullAmount,
                CouponAmount   = x.CouponAmount,
                MaxQuota       = x.MaxQuota,
                UseQuota       = 0,
                BeginDate      = x.BeginDate,
                EndDate        = x.EndDate,
                Remark         = x.Remark,
                CreateTime     = DateTime.Now,
                IsDisabled     = false
            }).ToList();

            //终审通过之后。
            CouponRuleService.OnAuditSuccess(tblAutCouponRule);
        }