Пример #1
0
        /// <summary>
        /// 更新活动状态
        /// </summary>
        public void UpdateStatus()
        {
            bool flag = false;
            //取出筹备中,进行中的促销
            List <Lebi_Promotion> models = B_Lebi_Promotion.GetList("Type_id_PromotionStatus in (240,241)", "");

            foreach (Lebi_Promotion model in models)
            {
                if (model.Type_id_PromotionStatus == 240)
                {
                    if (model.Time_Start <= System.DateTime.Now && model.Time_End >= System.DateTime.Now)
                    {
                        model.Type_id_PromotionStatus = 241;
                        flag = true;
                    }
                }
                if (model.Type_id_PromotionStatus == 241)
                {
                    if (model.Time_End <= System.DateTime.Now)
                    {
                        model.Type_id_PromotionStatus = 242;//过期
                        flag = true;
                    }
                }
                B_Lebi_Promotion.Update(model);
            }
            if (flag)
            {
                ShopCache.SetCurrentPromotionType();
            }
        }
Пример #2
0
        /// <summary>
        /// 返回促销规则
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static List <Lebi_Promotion> GetPromotion(int id)
        {
            List <Lebi_Promotion> models = B_Lebi_Promotion.GetList("Promotion_Type_id=" + id + "", "Sort desc");

            return(models);
        }