Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Result stopMyStopwatch(Clarizen clarizen, User User, Stopwatch stopwatch)
- {
- //create project entity
- GenericEntity stopwatchEnt = new GenericEntity();
- stopwatchEnt.Id = new EntityId() { TypeName = "Stopwatch", Value = stopwatch.Id };
- //get the state field
- FieldValue stateField = new FieldValue();
- stateField.FieldName = "State";
- //add the user as manager
- stateField.Value = "Paused";
- //set the values
- stopwatchEnt.Values = new FieldValue[] { stateField };
- UpdateMessage updateWatch = new UpdateMessage();
- updateWatch.Entity = stopwatchEnt;
- //get result
- Result result3 = clarizen.Execute(new BaseMessage[] { updateWatch })[0];
- if (result3.Success)
- {
- Console.WriteLine("Stopwatch marked complete!! " + result3.Success.ToString());
- }
- else
- {
- Console.WriteLine("Stopwatch " + result3.Error.Message.ToString());
- }
- return result3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement