Rate Class

Represents a definition of a time period and rates applicable for a resource during that period.
Inheritance Hierarchy
SystemObject
  Aspose.TasksRate

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.5
Syntax
public class Rate

The Rate type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleCostPerUse
Gets or sets the cost per use of a resource. This value retrieved from the current date if a rate table exists for a resource.
Public propertyCode exampleOvertimeRate
Gets or sets the overtime rate for a resource for the specified period.
Public propertyCode exampleOvertimeRateFormat
Gets or sets the units used by Microsoft Project to display the overtime rate.
Public propertyCode exampleRatesFrom
Gets or sets the date when a rate becomes effective.
Public propertyCode exampleRatesTo
Gets or sets the last date when a rate is effective.
Public propertyCode exampleRateTable
Gets or sets the unique identifier of a rate table for a resource.
Public propertyCode exampleStandardRate
Gets or sets the standard rate for a resource for the specified period.
Public propertyCode exampleStandardRateFormat
Gets or sets the units used by Microsoft Project to display the standard rate.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to work with resource rates.
var project = new Project(DataDir + "Project1.mpp");

var resource = project.Resources.Add("Resource 1");
resource.Set(Rsc.Type, ResourceType.Work);
resource.Set(Rsc.Work, project.GetDuration(2d, TimeUnitType.Hour));
resource.Set(Rsc.StandardRate, 20m);

var rate1 = resource.Rates.Add(new DateTime(2019, 1, 1, 8, 0, 0));
rate1.RateTable = RateType.A;
rate1.RatesFrom = new DateTime(2019, 1, 1, 8, 0, 0);
rate1.RatesTo = new DateTime(2019, 11, 11, 17, 0, 0);
rate1.StandardRate = 5m;
rate1.StandardRateFormat = RateFormatType.Hour;
rate1.OvertimeRate = 10m;
rate1.OvertimeRateFormat = RateFormatType.Hour;

var rate2 = resource.Rates.Add(new DateTime(2019, 11, 12, 8, 0, 0));
rate2.RatesTo = new DateTime(2019, 12, 31, 17, 0, 0);
rate2.StandardRate = 10m;
rate2.StandardRateFormat = RateFormatType.Hour;
rate2.CostPerUse = 2m;

// work with the project...
See Also