public String UpdatebyPutrefuse(CloudTable table, PutRefuse putrefuse) { RefuseEntity updateEntity = RetrieveRefuse(table, putrefuse); if (updateEntity != null) { DateTime nowDate = DateTime.Now; string time3 = "Time:" + nowDate; // Change the collection time updateEntity.Timecollected = time3; // Create the Replace TableOperation. TableOperation updateOperation = TableOperation.Replace(updateEntity); // Execute the operation. try { table.Execute(updateOperation); return("update executed sucessfully"); } catch (Exception e) { return("update not executed sucessfully"); //do something } } else { return("update not executed sucessfully"); } }
public RefuseEntity RetrieveRefuse(CloudTable table, PutRefuse putrefuse) { // Create a retrieve operation that takes a customer entity. TableOperation retrieveOperation = TableOperation.Retrieve <RefuseEntity>(putrefuse.id, putrefuse.pareaid); // Execute the operation. TableResult retrievedResult = table.Execute(retrieveOperation); // Assign the result to a CustomerEntity object. RefuseEntity refuseEntity = (RefuseEntity)retrievedResult.Result; return(refuseEntity); }