Stop or Resume an Assignment

Stop or Resume an Assignment

The Asn class exposes properties for reading and writing an assignment’s stop and resume date:

To see an assignment’s stop and resume dates in Microsoft Project:

  1. On the Task Usage screen, select Insert and then Column.
  2. Add the desired columns.

Getting an Assignment’s Stop and Resume Dates using Aspose.Tasks

If an assignment hasn’t been stopped, the stop and resume dates have the value NA. In the evaluation version of Aspose.Tasks, values equal to NA gets the value “1/1/2000”. In the licensed version, NA values equal DateTime.MinValue.

In the following example, an assignment’s stop and resume dates are displayed in a console window after the code’s traversed the assignments in the project.

 1Project project = new Project("New Project.mpp");
 2
 3// Print resource assignment's stop and resume dates
 4foreach (ResourceAssignment ra in project.ResourceAssignments)
 5{
 6    if (ra.Get(Asn.Stop).ToShortDateString() == "1/1/2000")
 7        Console.WriteLine("NA");
 8    else
 9        Console.WriteLine(ra.Get(Asn.Stop).ToShortDateString());
10
11    if (ra.Get(Asn.Resume).ToShortDateString() == "1/1/2000")
12        Console.WriteLine("NA");
13    else
14        Console.WriteLine(ra.Get(Asn.Resume).ToShortDateString());
15}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.