Ejemplo n.º 1
0
        public ActionResult Video(CardVideoModel model)
        {
            model.Video = HttpUtility.HtmlDecode(model.Video);
            model.LeftFooter = HttpUtility.HtmlDecode(model.LeftFooter);
            model.RightFooter = HttpUtility.HtmlDecode(model.RightFooter);

            return PartialView(model);
        }
Ejemplo n.º 2
0
        public ActionResult Video(string encrypted)
        {
            encrypted = Helpers.XOR.Decrypt(encrypted, Helpers.Constants.XORAppKey);
            string scriptURL = HttpUtility.UrlDecode(encrypted);
            CardVideoModel model = new CardVideoModel();

            try
            {
                using (var client = new WebClient())
                {
                    string json = @client.DownloadString(scriptURL);
                    JObject cardInfo = JObject.Parse(json);
                    string cardType = cardInfo["type"].ToString();
                    if (cardType.ToLower() == "video")
                    {
                        model = cardInfo["parameters"].ToObject<CardVideoModel>();
                        return PartialView(model);
                    }
                    else
                    {
                        return RedirectToAction("Error");
                    }
                }
            }
            catch
            {
                return RedirectToAction("Error");
            }
        }