Exemplo n.º 1
0
        /// <summary>
        /// 根据RuleId获取'获取优惠券规则'
        /// </summary>
        /// <param name="ruleId"></param>
        /// <returns></returns>
        public List <Tuple <int, Guid, string, string> > GetCouponGetRules(int ruleId)
        {
            List <Tuple <int, Guid, string, string> > result = null;

            try
            {
                result = dbScopeReadManager.Execute(conn => DALVipBaoYangPackage.SelectCouponGetRules(conn, ruleId));
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
            return(result ?? new List <Tuple <int, Guid, string, string> >());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取指定规则的获取优惠券规则
        /// </summary>
        /// <returns></returns>
        public List <Tuple <int, Guid, string, string> > GetCouponRules()
        {
            List <Tuple <int, Guid, string, string> > result = new List <Tuple <int, Guid, string, string> >();

            try
            {
                var xml = DalSimpleConfig.SelectConfig("VipBaoYangPackage");
                if (!string.IsNullOrEmpty(xml))
                {
                    var configInfo = XmlHelper.Deserialize <VipBaoYangPackageParentCouponConfig>(xml);
                    dbScopeReadManager.Execute(conn =>
                    {
                        result = DALVipBaoYangPackage.SelectCouponGetRules(conn, configInfo.ParentCouponId);
                    });
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
            return(result ?? new List <Tuple <int, Guid, string, string> >());
        }