示例#1
0
        async public void GetIsSomeoneWaiting(string isWaiting)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                CloudConfigurationManager.GetSetting("StorageConnectionString"));
            CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
            CloudTable       varsTable   = tableClient.GetTableReference("varsTable");

            //varsTable.DeleteIfExists();

            //await varsTable.CreateIfNotExistsAsync();

            /*varsEntity customer1 = new varsEntity("isWaiting", "isWaiting");
             * customer1.value = isWaiting;
             *
             * // Create the TableOperation that inserts the customer entity.
             * TableOperation insertOperation = TableOperation.Insert(customer1);
             *
             * // Execute the insert operation.
             * await varsTable.ExecuteAsync(insertOperation);*/


            TableOperation retrieveOperation = TableOperation.Retrieve <varsEntity>("isWaiting", "isWaiting");

            TableResult retrievedResult = await varsTable.ExecuteAsync(retrieveOperation);

            varsEntity updateEntity = (varsEntity)retrievedResult.Result;

            updateEntity.value = isWaiting;

            TableOperation updateOperation = TableOperation.Replace(updateEntity);

            // Execute the operation.
            await varsTable.ExecuteAsync(updateOperation);
        }
示例#2
0
        async public void changeRakaat(string rakaat)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                CloudConfigurationManager.GetSetting("StorageConnectionString"));
            CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
            CloudTable       varsTable   = tableClient.GetTableReference("varsTable");

            //varsTable.DeleteIfExists();

            TableOperation retrieveOperation = TableOperation.Retrieve <varsEntity>("rakaat", "rakaat");

            TableResult retrievedResult = await varsTable.ExecuteAsync(retrieveOperation);

            varsEntity updateEntity = (varsEntity)retrievedResult.Result;

            updateEntity.value = rakaat;

            TableOperation updateOperation = TableOperation.Replace(updateEntity);

            // Execute the operation.
            await varsTable.ExecuteAsync(updateOperation);
        }