Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Result SubmitTimeSheet(TimeSheet ts, Clarizen clarizen)
- {
- Result result = null;
- GenericEntity timeSheet = new GenericEntity();
- timeSheet.Id = new EntityId { TypeName = "Timesheet" };
- timeSheet.Values = new FieldValue[]{
- new FieldValue {FieldName = "WorkItem", Value = ts.stopwatch.workItem.Id},
- new FieldValue {FieldName = "ReportedBy", Value = ts.stopwatch.rescource.Id},
- new FieldValue {FieldName = "ReportedDate", Value = DateTime.Now},
- new FieldValue {FieldName = "Comment", Value = ts.notes},
- new FieldValue {FieldName = "Duration", Value = new Duration{Value = ts.time, Unit = DurationUnit.Days}}};
- CreateMessage timesheetMessage = new CreateMessage();
- timesheetMessage.Entity = timeSheet;
- result = clarizen.Execute(new BaseMessage[] { timesheetMessage })[0];
- if (result.Success)
- Console.WriteLine("Stopwatch marked complete!! " + result.Success.ToString());
- else
- Console.WriteLine("Stopwatch " + result.Error.Message.ToString());
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment