示例#1
0
        private void Load()
        {
            List <SelectListItem> advertPositionList = new List <SelectListItem>();

            advertPositionList.Add(new SelectListItem()
            {
                Text = "请选择广告位置", Value = "0"
            });
            foreach (AdvertPositionInfo advertPositionInfo in AdminAdverts.GetAllAdvertPosition())
            {
                advertPositionList.Add(new SelectListItem()
                {
                    Text = advertPositionInfo.Title, Value = advertPositionInfo.AdPosId.ToString()
                });
            }
            ViewData["advertPositionList"] = advertPositionList;

            string allowImgType = string.Empty;

            string[] imgTypeList = StringHelper.SplitString(BSPConfig.ShopConfig.UploadImgType, ",");
            foreach (string imgType in imgTypeList)
            {
                allowImgType += string.Format("{0},", imgType.ToLower());
            }
            allowImgType             = allowImgType.Replace(".", "");
            allowImgType             = allowImgType.TrimEnd(',');
            ViewData["allowImgType"] = allowImgType;
            ViewData["maxImgSize"]   = BSPConfig.ShopConfig.UploadImgSize;

            ViewData["referer"] = ShopUtils.GetAdminRefererCookie();
        }
示例#2
0
        /// <summary>
        /// 广告列表
        /// </summary>
        public ActionResult AdvertList(int adPosId = 0, int pageSize = 15, int pageNumber = 1)
        {
            PageModel pageModel = new PageModel(pageSize, pageNumber, AdminAdverts.AdminGetAdvertCount(adPosId));

            List <SelectListItem> advertPositionList = new List <SelectListItem>();

            advertPositionList.Add(new SelectListItem()
            {
                Text = "全部广告位置", Value = "0"
            });
            foreach (AdvertPositionInfo advertPositionInfo in AdminAdverts.GetAllAdvertPosition())
            {
                advertPositionList.Add(new SelectListItem()
                {
                    Text = advertPositionInfo.Title, Value = advertPositionInfo.AdPosId.ToString()
                });
            }

            AdvertListModel model = new AdvertListModel()
            {
                PageModel          = pageModel,
                AdvertList         = AdminAdverts.AdminGetAdvertList(pageModel.PageSize, pageModel.PageNumber, adPosId),
                AdPosId            = adPosId,
                AdvertPositionList = advertPositionList
            };

            ShopUtils.SetAdminRefererCookie(string.Format("{0}?adPosId={1}&pageNumber={2}&pageSize={3}", Url.Action("advertlist"), adPosId, pageModel.PageNumber, pageModel.PageSize));
            return(View(model));
        }
示例#3
0
        private void Load()
        {
            List <SelectListItem> itemList = new List <SelectListItem>();

            itemList.Add(new SelectListItem()
            {
                Text = "请选择广告位置", Value = "0"
            });
            foreach (AdvertPositionInfo advertPositionInfo in AdminAdverts.GetAllAdvertPosition())
            {
                itemList.Add(new SelectListItem()
                {
                    Text = advertPositionInfo.Title, Value = advertPositionInfo.AdPosId.ToString()
                });
            }
            ViewData["advertPositionList"] = itemList;
            ViewData["referer"]            = ShopUtils.GetAdminRefererCookie();
        }
示例#4
0
        private void Load()
        {
            List <SelectListItem> advertPositionList = new List <SelectListItem>();

            advertPositionList.Add(new SelectListItem()
            {
                Text = "请选择广告位置", Value = "0"
            });
            foreach (AdvertPositionInfo advertPositionInfo in AdminAdverts.GetAllAdvertPosition())
            {
                advertPositionList.Add(new SelectListItem()
                {
                    Text = advertPositionInfo.Title, Value = advertPositionInfo.AdPosId.ToString()
                });
            }
            ViewData["advertPositionList"] = advertPositionList;

            ViewData["allowImgType"] = BMAConfig.UploadConfig.UploadImgType.Replace(".", "");
            ViewData["maxImgSize"]   = BMAConfig.UploadConfig.UploadImgSize;
            ViewData["referer"]      = MallUtils.GetMallAdminRefererCookie();
        }