コード例 #1
0
ファイル: SLCardController.cs プロジェクト: piriys/SLEOC
        public ActionResult Comments(string encrypted)
        {
            encrypted = Helpers.XOR.Decrypt(encrypted, Helpers.Constants.XORAppKey);
            string scriptURL = HttpUtility.UrlDecode(encrypted);
            CardMosaicListModel model = new CardMosaicListModel();

            try
            {
                using (var client = new WebClient())
                {
                    string json = @client.DownloadString(scriptURL);
                    JObject cardInfo = JObject.Parse(json);
                    return PartialView();
                }
            }
            catch
            {
                return RedirectToAction("Error");
            }
        }
コード例 #2
0
ファイル: SLCardController.cs プロジェクト: piriys/SLEOC
 public ActionResult MosaicList(string encrypted)
 {
     encrypted = Helpers.XOR.Decrypt(encrypted, Helpers.Constants.XORAppKey);
     string scriptURL = HttpUtility.UrlDecode(encrypted);
     CardMosaicListModel model = new CardMosaicListModel();
     
     try
     {
         using (var client = new WebClient())
         {
             string json = @client.DownloadString(scriptURL);
             JObject cardInfo = JObject.Parse(json);
             string cardType = cardInfo["type"].ToString();
             if(cardType.ToLower() == "mosaiclist")
             {
                 model = cardInfo["parameters"].ToObject<CardMosaicListModel>();
                 return PartialView(model);
             }
             else
             {
                 return RedirectToAction("Error");
             }
         }
     }
     catch 
     {
         return RedirectToAction("Error");
     }
 }
コード例 #3
0
ファイル: CardController.cs プロジェクト: piriys/SLEOC
        public ActionResult MosaicList(CardMosaicListModel model)
        {
            model.Title = HttpUtility.HtmlDecode(model.Title);

            if (model.ImageURL.Count == 0)
            {
                model.ImageURL.Add(Url.Content("~/Content/images/defaultimage.png"));
                model.ImageURL.Add(Url.Content("~/Content/images/defaultimage.png"));
                model.ImageURL.Add(Url.Content("~/Content/images/defaultimage.png"));
            }

            for (int i = 0; i < model.Item.Count; i++)
            {
                model.Item[i] = HttpUtility.HtmlDecode(model.Item[i]);
            }

            for (int i = 0; i < model.Label.Count; i++)
            {
                model.Label[i] = HttpUtility.HtmlDecode(model.Label[i]);
            }

            model.LeftFooter = HttpUtility.HtmlDecode(model.LeftFooter);
            model.RightFooter = HttpUtility.HtmlDecode(model.RightFooter);

            return PartialView(model);
        }