示例#1
0
        public ActionResult EditFullCutPromotion(FullCutPromotionModel model, int pmId = -1)
        {
            FullCutPromotionInfo fullCutPromotionInfo = AdminPromotions.AdminGetFullCutPromotionById(pmId);
            if (fullCutPromotionInfo == null)
                return PromptView("满减促销不存在");
            if (fullCutPromotionInfo.StoreId != WorkContext.StoreId)
                return PromptView("不能操作其它店铺的促销活动");

            if (ModelState.IsValid)
            {
                fullCutPromotionInfo.Name = model.PromotionName;
                fullCutPromotionInfo.Type = model.Type;
                fullCutPromotionInfo.StartTime = model.StartTime;
                fullCutPromotionInfo.EndTime = model.EndTime;
                fullCutPromotionInfo.UserRankLower = model.UserRankLower;
                fullCutPromotionInfo.State = model.State;
                fullCutPromotionInfo.LimitMoney1 = model.LimitMoney1;
                fullCutPromotionInfo.CutMoney1 = model.CutMoney1;
                fullCutPromotionInfo.LimitMoney2 = model.LimitMoney2;
                fullCutPromotionInfo.CutMoney2 = model.CutMoney2;
                fullCutPromotionInfo.LimitMoney3 = model.LimitMoney3;
                fullCutPromotionInfo.CutMoney3 = model.CutMoney3;

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

            LoadFullCutPromotion();
            return View(model);
        }
示例#2
0
        public ActionResult AddFullCutPromotion(FullCutPromotionModel model)
        {
            if (ModelState.IsValid)
            {
                FullCutPromotionInfo fullCutPromotionInfo = new FullCutPromotionInfo()
                {
                    StoreId = WorkContext.StoreId,
                    Name = model.PromotionName,
                    Type = model.Type,
                    StartTime = model.StartTime,
                    EndTime = model.EndTime,
                    UserRankLower = model.UserRankLower,
                    State = model.State,
                    LimitMoney1 = model.LimitMoney1,
                    CutMoney1 = model.CutMoney1,
                    LimitMoney2 = model.LimitMoney2,
                    CutMoney2 = model.CutMoney2,
                    LimitMoney3 = model.LimitMoney3,
                    CutMoney3 = model.CutMoney3
                };

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

            LoadFullCutPromotion();
            return View(model);
        }
示例#3
0
        public ActionResult EditFullCutPromotion(int pmId = -1)
        {
            FullCutPromotionInfo fullCutPromotionInfo = AdminPromotions.AdminGetFullCutPromotionById(pmId);
            if (fullCutPromotionInfo == null)
                return PromptView("满减促销活动不存在");
            if (fullCutPromotionInfo.StoreId != WorkContext.StoreId)
                return PromptView("不能操作其它店铺的促销活动");

            FullCutPromotionModel model = new FullCutPromotionModel();
            model.PromotionName = fullCutPromotionInfo.Name;
            model.Type = fullCutPromotionInfo.Type;
            model.StartTime = fullCutPromotionInfo.StartTime;
            model.EndTime = fullCutPromotionInfo.EndTime;
            model.UserRankLower = fullCutPromotionInfo.UserRankLower;
            model.State = fullCutPromotionInfo.State;
            model.LimitMoney1 = fullCutPromotionInfo.LimitMoney1;
            model.CutMoney1 = fullCutPromotionInfo.CutMoney1;
            model.LimitMoney2 = fullCutPromotionInfo.LimitMoney2;
            model.CutMoney2 = fullCutPromotionInfo.CutMoney2;
            model.LimitMoney3 = fullCutPromotionInfo.LimitMoney3;
            model.CutMoney3 = fullCutPromotionInfo.CutMoney3;

            LoadFullCutPromotion();

            return View(model);
        }
示例#4
0
 public ActionResult AddFullCutPromotion()
 {
     FullCutPromotionModel model = new FullCutPromotionModel();
     LoadFullCutPromotion();
     return View(model);
 }