public async void Approve() { if (TextResource != null) { NetworkConnectionActive = true; var operation = TableOperation.InsertOrReplace(TextResource); TextResource.LastUpdatedDate = DateTime.Now; TextResource.Approved = true; TextResources.Remove(TextResource); await _table.ExecuteAsync(operation); TextResource = null; TextResourceCopy = null; NetworkConnectionActive = false; } }
public async void Save() { if (TextResource != null) { NetworkConnectionActive = true; var addChangedOperation = TableOperation.InsertOrReplace(TextResourceCopy); TextResourceCopy.CreationDate = DateTime.Now; TextResourceCopy.LastUpdatedDate = DateTime.Now; await _edits.ExecuteAsync(addChangedOperation); TextResource.Edits = true; TextResource.LastUpdatedDate = DateTime.Now; var replaceOperation = TableOperation.Replace(TextResource); await _table.ExecuteAsync(replaceOperation); TextResources.Remove(TextResource); TextResource = null; TextResourceCopy = null; NetworkConnectionActive = false; } }