Esempio n. 1
0
        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");
            }
        }
Esempio n. 2
0
 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");
     }
 }
Esempio n. 3
0
        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);
        }