Ejemplo n.º 1
0
        public ActionResult EditAdvertPosition(int adPosId = -1)
        {
            AdvertPositionInfo advertPositionInfo = AdminAdverts.GetAdvertPositionById(adPosId);
            if (advertPositionInfo == null)
                return PromptView("广告位置不存在");

            AdvertPositionModel model = new AdvertPositionModel();
            model.Title = advertPositionInfo.Title;
            model.Description = advertPositionInfo.Description;

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
Ejemplo n.º 2
0
        public ActionResult AddAdvertPosition(AdvertPositionModel model)
        {
            if (ModelState.IsValid)
            {
                AdvertPositionInfo advertPositionInfo = new AdvertPositionInfo()
                {
                    Title = model.Title,
                    Description = model.Description ?? ""
                };

                AdminAdverts.CreateAdvertPosition(advertPositionInfo);
                AddMallAdminLog("添加广告位置", "添加广告位置,广告位置为:" + model.Title);
                return PromptView("广告位置添加成功");
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
Ejemplo n.º 3
0
        public ActionResult EditAdvertPosition(AdvertPositionModel model, int adPosId = -1)
        {
            AdvertPositionInfo advertPositionInfo = AdminAdverts.GetAdvertPositionById(adPosId);
            if (advertPositionInfo == null)
                return PromptView("广告位置不存在");

            if (ModelState.IsValid)
            {
                advertPositionInfo.Title = model.Title;
                advertPositionInfo.Description = model.Description ?? "";

                AdminAdverts.UpdateAdvertPosition(advertPositionInfo);
                AddMallAdminLog("修改广告位置", "修改广告位置,广告位置ID为:" + adPosId);
                return PromptView("广告位置修改成功");
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
Ejemplo n.º 4
0
 public ActionResult AddAdvertPosition()
 {
     AdvertPositionModel model = new AdvertPositionModel();
     ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
     return View(model);
 }