Exemplo n.º 1
0
        public ActionResult EditBuySendPromotion(BuySendPromotionModel model, int pmId = -1)
        {
            BuySendPromotionInfo buySendPromotionInfo = AdminPromotions.AdminGetBuySendPromotionById(pmId);
            if (buySendPromotionInfo == null)
                return PromptView("买送促销不存在");
            if (buySendPromotionInfo.StoreId != WorkContext.StoreId)
                return PromptView("不能操作其它店铺的促销活动");

            if (ModelState.IsValid)
            {
                buySendPromotionInfo.StartTime = model.StartTime;
                buySendPromotionInfo.EndTime = model.EndTime;
                buySendPromotionInfo.UserRankLower = model.UserRankLower;
                buySendPromotionInfo.State = model.State;
                buySendPromotionInfo.Name = model.PromotionName;
                buySendPromotionInfo.Type = model.Type;
                buySendPromotionInfo.BuyCount = model.BuyCount;
                buySendPromotionInfo.SendCount = model.SendCount;

                AdminPromotions.UpdateBuySendPromotion(buySendPromotionInfo);
                AddStoreAdminLog("修改买送促销", "修改买送促销,买送促销ID为:" + pmId);
                return PromptView("买送促销修改成功");
            }

            LoadBuySendPromotion();
            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult AddBuySendPromotion(BuySendPromotionModel model)
        {
            if (ModelState.IsValid)
            {
                BuySendPromotionInfo buySendPromotionInfo = new BuySendPromotionInfo()
                {
                    StoreId = WorkContext.StoreId,
                    StartTime = model.StartTime,
                    EndTime = model.EndTime,
                    UserRankLower = model.UserRankLower,
                    State = model.State,
                    Name = model.PromotionName,
                    Type = model.Type,
                    BuyCount = model.BuyCount,
                    SendCount = model.SendCount
                };

                AdminPromotions.CreateBuySendPromotion(buySendPromotionInfo);
                AddStoreAdminLog("添加买送促销", "添加买送促销,买送促销为:" + model.PromotionName);
                return PromptView("买送促销添加成功");
            }

            LoadBuySendPromotion();
            return View(model);
        }
Exemplo n.º 3
0
        public ActionResult EditBuySendPromotion(int pmId = -1)
        {
            BuySendPromotionInfo buySendPromotionInfo = AdminPromotions.AdminGetBuySendPromotionById(pmId);
            if (buySendPromotionInfo == null)
                return PromptView("买送促销不存在");
            if (buySendPromotionInfo.StoreId != WorkContext.StoreId)
                return PromptView("不能操作其它店铺的促销活动");

            BuySendPromotionModel model = new BuySendPromotionModel();
            model.StartTime = buySendPromotionInfo.StartTime;
            model.EndTime = buySendPromotionInfo.EndTime;
            model.UserRankLower = buySendPromotionInfo.UserRankLower;
            model.State = buySendPromotionInfo.State;
            model.PromotionName = buySendPromotionInfo.Name;
            model.Type = buySendPromotionInfo.Type;
            model.BuyCount = buySendPromotionInfo.BuyCount;
            model.SendCount = buySendPromotionInfo.SendCount;

            LoadBuySendPromotion();
            return View(model);
        }
Exemplo n.º 4
0
 public ActionResult AddBuySendPromotion()
 {
     BuySendPromotionModel model = new BuySendPromotionModel();
     LoadBuySendPromotion();
     return View(model);
 }