Пример #1
0
        public static void AddUpdatePublicKey(string Key)
        {
            using (DNNDataLayerDataContext dnnContext = new DNNDataLayerDataContext())
            {
                #region Update
                BraftonTable pk = dnnContext.BraftonTables.FirstOrDefault(x => x.Content == "1");

                if (pk != null)
                {
                    //pk.VideoPublicKey = TEST;
                    pk.VideoPublicKey        = Key;
                    MyGlobals.VideoPublicKey = Key;



                    dnnContext.SubmitChanges();
                    // MyGlobals.VideoFeedNumber = "pk is not NULL";


                    #endregion
                }
                else
                {
                    //Blog_Entry newBlogEntry = new Blog_Entry();
                    BraftonTable addPublicKey = new BraftonTable();

                    addPublicKey.VideoPublicKey = Key;

                    dnnContext.BraftonTables.InsertOnSubmit(addPublicKey);
                    dnnContext.SubmitChanges();
                    MyGlobals.VideoFeedNumber = 0;
                }
            }
        }
Пример #2
0
        public static void AddUpdateVideoBaseURL(string Key)//TODO still need to validate URL to see if it matches either of the 2 apis
        {
            using (DNNDataLayerDataContext dnnContext = new DNNDataLayerDataContext())
            {
                #region Update
                BraftonTable pk = dnnContext.BraftonTables.FirstOrDefault(x => x.Content == "1");

                if (pk != null)
                {
                    pk.VideoBaseUrl        = Key;
                    MyGlobals.VideoBaseURL = Key;
                    dnnContext.SubmitChanges();
                    #endregion
                }
                else
                {
                }
            }
        }
Пример #3
0
        public static void AddUpdateSecretKey(string Key)
        {
            using (DNNDataLayerDataContext dnnContext = new DNNDataLayerDataContext())
            {
                #region Update
                BraftonTable pk = dnnContext.BraftonTables.FirstOrDefault(x => x.Content == "1");

                if (pk != null)
                {
                    pk.VideoSecretKey        = Key;
                    MyGlobals.VideoSecretKey = Key;
                    dnnContext.SubmitChanges();
                    #endregion
                }
                else
                {
                }
            }
        }
Пример #4
0
        public static void PopGlobals()

        {
            using (DNNDataLayerDataContext dnnContext = new DNNDataLayerDataContext())
            {
                #region Fill Globals
                BraftonTable pk = dnnContext.BraftonTables.FirstOrDefault(x => x.Content == "1");

                if (pk != null)
                {
                    if (pk.Api != null)
                    {
                        api = pk.Api;
                    }
                    if (pk.BaseUrl != null)
                    {
                        baseUrl = pk.BaseUrl;
                    }
                    if (pk.DomainName != null)
                    {
                        DomainName = pk.DomainName;
                    }



                    if (pk.VideoPublicKey != null)
                    {
                        VideoPublicKey = pk.VideoPublicKey;
                    }
                    if (pk.VideoSecretKey != null)
                    {
                        VideoSecretKey = pk.VideoSecretKey;
                    }
                    if (pk.VideoFeedNumber != null)
                    {
                        VideoFeedNumber = pk.VideoFeedNumber;
                        VideoFeedText   = pk.VideoFeedNumber.ToString();
                    }
                    if (pk.VideoBaseUrl != null)
                    {
                        VideoBaseURL = pk.VideoBaseUrl;
                    }
                    if (pk.VideoPhotoURL != null)
                    {
                        VideoPhotoURL = pk.VideoPhotoURL;
                    }

                    //Decide whether photo or video
                    if (pk.VideoSecretKey != null)
                    {
                        ArtOrBlog = "video";
                    }

                    if (pk.Api != null)
                    {
                        ArtOrBlog = "articles";
                    }

                    if (pk.Api != null && pk.VideoSecretKey != null)
                    {
                        ArtOrBlog = "both";
                    }

                    #endregion
                }
            }
        }