コード例 #1
0
ファイル: SLCardController.cs プロジェクト: piriys/SLEOC
        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
ファイル: CardController.cs プロジェクト: piriys/SLEOC
        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);
        }