コード例 #1
0
        public ActionResult EditFullSendPromotion(FullSendPromotionModel model, int pmId = -1)
        {
            FullSendPromotionInfo fullSendPromotionInfo = AdminPromotions.AdminGetFullSendPromotionById(pmId);
            if (fullSendPromotionInfo == null)
                return PromptView("满赠促销活动不存在");
            if (fullSendPromotionInfo.StoreId != WorkContext.StoreId)
                return PromptView("不能操作其它店铺的促销活动");

            if (ModelState.IsValid)
            {
                fullSendPromotionInfo.Name = model.PromotionName;
                fullSendPromotionInfo.StartTime = model.StartTime;
                fullSendPromotionInfo.EndTime = model.EndTime;
                fullSendPromotionInfo.UserRankLower = model.UserRankLower;
                fullSendPromotionInfo.State = model.State;
                fullSendPromotionInfo.LimitMoney = model.LimitMoney;
                fullSendPromotionInfo.AddMoney = model.AddMoney;


                AdminPromotions.UpdateFullSendPromotion(fullSendPromotionInfo);
                AddStoreAdminLog("修改满赠促销活动", "修改满赠促销活动,满赠促销活动ID为:" + pmId);
                return PromptView("满赠促销活动修改成功");
            }

            LoadFullSendPromotion();
            return View(model);
        }
コード例 #2
0
        public ActionResult AddFullSendPromotion(FullSendPromotionModel model)
        {
            if (ModelState.IsValid)
            {
                FullSendPromotionInfo fullSendPromotionInfo = new FullSendPromotionInfo()
                {
                    StoreId = WorkContext.StoreId,
                    Name = model.PromotionName,
                    StartTime = model.StartTime,
                    EndTime = model.EndTime,
                    UserRankLower = model.UserRankLower,
                    State = model.State,
                    LimitMoney = model.LimitMoney,
                    AddMoney = model.AddMoney
                };

                AdminPromotions.CreateFullSendPromotion(fullSendPromotionInfo);
                AddStoreAdminLog("添加满赠促销活动", "添加满赠促销活动,满赠促销活动为:" + model.PromotionName);
                return PromptView("满赠促销活动添加成功");
            }

            LoadFullSendPromotion();
            return View(model);
        }
コード例 #3
0
        public ActionResult EditFullSendPromotion(int pmId = -1)
        {
            FullSendPromotionInfo fullSendPromotionInfo = AdminPromotions.AdminGetFullSendPromotionById(pmId);
            if (fullSendPromotionInfo == null)
                return PromptView("满赠促销活动不存在");
            if (fullSendPromotionInfo.StoreId != WorkContext.StoreId)
                return PromptView("不能操作其它店铺的促销活动");

            FullSendPromotionModel model = new FullSendPromotionModel();
            model.PromotionName = fullSendPromotionInfo.Name;
            model.StartTime = fullSendPromotionInfo.StartTime;
            model.EndTime = fullSendPromotionInfo.EndTime;
            model.UserRankLower = fullSendPromotionInfo.UserRankLower;
            model.State = fullSendPromotionInfo.State;
            model.LimitMoney = fullSendPromotionInfo.LimitMoney;
            model.AddMoney = fullSendPromotionInfo.AddMoney;

            LoadFullSendPromotion();

            return View(model);
        }
コード例 #4
0
 public ActionResult AddFullSendPromotion()
 {
     FullSendPromotionModel model = new FullSendPromotionModel();
     LoadFullSendPromotion();
     return View(model);
 }