Ejemplo n.º 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            btnCancel.Click += btnCancel_Click;
            btnSave.Click   += btnSave_Click;

            dic = new Dictionary <string, string>();
            List <AppRunImgInfo> list = APPHelper.GetAppRunImg();

            if (!(list == null || list.Count == 0))
            {
                foreach (AppRunImgInfo a in list)
                {
                    dic.Add(a.phoneType, a.imgSrc);
                }
            }
            if (!this.Page.IsPostBack)
            {
                if (dic.ContainsKey("Android720_1280"))
                {
                    Android720_1280hid.Value = Android720_1280.ImageUrl = dic["Android720_1280"];
                }
                if (dic.ContainsKey("iOS750_1334"))
                {
                    iOS750_1334hid.Value = iOS750_1334.ImageUrl = dic["iOS750_1334"];
                }
                if (dic.ContainsKey("iOS640_960"))
                {
                    iOS640_960hid.Value = iOS640_960.ImageUrl = dic["iOS640_960"];
                }
                if (dic.ContainsKey("iOS1242_2208"))
                {
                    iOS1242_2208hid.Value = iOS1242_2208.ImageUrl = dic["iOS1242_2208"];
                }
            }
        }
Ejemplo n.º 2
0
        public IHttpActionResult AppBanner(string accessToken, int channel, int platform, string ver)
        {
            Logger.WriterLogger("Site.AppBanner, Params: " + string.Format("accessToken={0}&channel={1}&platform={2}&ver={3}", accessToken, channel, platform, ver), LoggerType.Info);

            // 保存访问信息
            base.SaveVisitInfo("", channel, platform, ver);

            // 验证令牌
            int accessTookenCode = VerifyAccessToken(accessToken);

            if (accessTookenCode > 0)
            {
                return(base.JsonFaultResult(new CommonException(accessTookenCode).GetMessage(), "Site.AppBanner"));
            }

            List <AppBannerListItem> items = new List <AppBannerListItem>();

            List <AppRunImgInfo> list = APPHelper.GetAppRunImg();

            if (!(list == null || list.Count == 0))
            {
                AppBannerListItem item = null;

                foreach (AppRunImgInfo current in list)
                {
                    item = new AppBannerListItem();

                    item.DeviceType = current.phoneType;
                    item.BannerUrl  = Util.AppendImageHost(current.imgSrc);

                    items.Add(item);
                }
            }

            StandardResult <ListResult <AppBannerListItem> > result = new StandardResult <ListResult <AppBannerListItem> >()
            {
                code = 0,
                msg  = "",
                data = new ListResult <AppBannerListItem>()
                {
                    TotalNumOfRecords = items.Count,
                    Results           = items
                }
            };

            return(base.JsonActionResult(result));
        }