Esempio n. 1
0
        public static StickyHtmlEntity  GetAdsHtml(string TableName, string PartitionName, string RowName)
        {
            StickyHtmlEntity Style = new StickyHtmlEntity();

            CloudStorageAccount storageAccount = CreateConexion();

            // Create the table client.
            CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

            // Create the CloudTable object that represents the "people" table.
            CloudTable table = tableClient.GetTableReference(TableName);

            // Create a retrieve operation that takes a customer entity.
            TableOperation retrieveOperation = TableOperation.Retrieve <StickyHtmlEntity>(PartitionName, RowName);

            // Execute the retrieve operation.
            TableResult retrievedResult = table.Execute(retrieveOperation);

            // Print the phone number of the result.
            if (retrievedResult.Result != null)
            {
                Style = (StickyHtmlEntity)retrievedResult.Result;
            }
            return(Style);
        }
Esempio n. 2
0
        public static void InsertAdsHtml(string tableName, string html, string PartitionName, string styleName)
        {
            try
            {
                CloudStorageAccount storageAccount   = CreateConexion();
                CloudTableClient    cloudTableClient = storageAccount.CreateCloudTableClient();

                // Retrieve a reference to the table.
                CloudTable table = cloudTableClient.GetTableReference(tableName);

                // Create the table if it doesn't exist.
                table.CreateIfNotExists();

                // Create a new customer entity.
                StickyHtmlEntity Style = new StickyHtmlEntity(PartitionName, styleName);
                Style.Html = html;

                // Create the TableOperation object that inserts the customer entity.
                TableOperation insertOperation = TableOperation.Insert(Style);

                // Execute the insert operation.
                table.Execute(insertOperation);
            }
            catch (Exception e)
            {
                //Todo
            }
        }
Esempio n. 3
0
        public void GetStickyHtml(StickyConfig config)
        {
            // Obtenerlo de configuracion
            string TableName       = "Styles";
            string PartitionName   = "StickyAds";
            string RowNameAdsDiv   = "AdsDiv";
            string RowNameCloseDiv = "CloseDiv";

            StickyHtmlEntity styleAdsDiv   = TableManager.GetAdsHtml(TableName, PartitionName, RowNameAdsDiv);
            StickyHtmlEntity styleCloseDiv = TableManager.GetAdsHtml(TableName, PartitionName, RowNameCloseDiv);

            config.AdsHtml   = string.Format(styleAdsDiv.Html, config.JsId);
            config.CloseHtml = string.Format(styleCloseDiv.Html, config.JsId);
        }