示例#1
0
        public ActionResult HybridMosaic(string encrypted)
        {
            encrypted = Helpers.XOR.Decrypt(encrypted, Helpers.Constants.XORAppKey);
            string scriptURL = HttpUtility.UrlDecode(encrypted);
            CardHybridMosaicModel model = new CardHybridMosaicModel();

            try
            {
                using (var client = new WebClient())
                {
                    string json = @client.DownloadString(scriptURL);
                    JObject cardInfo = JObject.Parse(json);
                    string cardType = cardInfo["type"].ToString();
                    if (cardType.ToLower() == "hybridmosaic")
                    {
                        model = cardInfo["parameters"].ToObject<CardHybridMosaicModel>();
                        return PartialView(model);
                    }
                    else
                    {
                        return RedirectToAction("Error");
                    }
                }
            }
            catch
            {
                return RedirectToAction("Error");
            }
        }
示例#2
0
        public ActionResult HybridMosaic(CardHybridMosaicModel model)
        {
            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"));
            }

            model.Description = HttpUtility.HtmlDecode(model.Description);

            return PartialView(model);
        }