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

            try
            {
                using (var client = new WebClient())
                {
                    string json = @client.DownloadString(scriptURL);
                    JObject cardInfo = JObject.Parse(json);
                    string cardType = cardInfo["type"].ToString();
                    if (cardType.ToLower() == "hybrid")
                    {
                        model = cardInfo["parameters"].ToObject<CardHybridModel>();
                        return PartialView(model);
                    }
                    else
                    {
                        return RedirectToAction("Error");
                    }
                }
            }
            catch
            {
                return RedirectToAction("Error");
            }
        }
コード例 #2
0
ファイル: CardController.cs プロジェクト: piriys/SLEOC
        public ActionResult Hybrid(CardHybridModel model)
        {
            if (String.IsNullOrEmpty(model.ImageURL))
            {
                model.ImageURL = Url.Content("~/Content/images/defaultimage.png");
            }

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

            return PartialView(model);
        }