Working with Resource Properties
Contents
[
Hide
Show
]The Resource class has a number of properties for getting and setting resource attributes:
- Name gets and sets a resource’s name (string).
- Id gets and sets a resource’s ID (integer).
- Uid gets and sets a resource’s UID (integer).
- Start gets and sets a resource’s start date (DateTime).
- Finish gets and sets a resource’s end date (DateTime).
Working with General Resource Properties
To view a resource’s general properties in Microsoft Project:
- From the View menu, select More Views and then Resource Sheet.
- From the Insert menu, select Column.
- Add the Start, Finish, ID and unique ID columns.
Setting General Resource Properties using Aspose.Tasks
The following code example demonstrates how to set general resource properties.
1// Add resources
2System::SharedPtr<Resource> rsc1 = project->get_Resources()->Add(u"Rsc");
3
4// Set resource properties, Resource properties are represented by static class Rsc
5rsc1->Set<System::Decimal>(Rsc::StandardRate(), static_cast<System::Decimal>(15));
6rsc1->Set<System::Decimal>(Rsc::OvertimeRate(), static_cast<System::Decimal>(20));