How to add an allocation to a resource.
One you have a reference to a resource, call the AddSlot method to add an allocation.
var r: TssResource; a: TssResourceAllocation; begin r := RAC.FindResource('My Resource'); if Assigned(r) then begin RAC.BeginUpdate; try // add an allocation 1 hour long starting Now a := r.AddSlot(Now, Now + EncodeTime(1, 0, 0, 0); // check not nil, in case the allocation could not be added if Assigned(a) then // use the returned reference to the new allocation // in this example, we'll store the record ID in the Tag a.Tag := IntToStr(AllocationRecordID); finally RAC.EndUpdate; end; end; end;
Note: It is important to test that AddSlot did not return nil. If the time span is already occupied, AddSlot will not add a new allocation and will return nil.
- Screen Shots
- FAQ & Getting Started
- User Comments
- Support Forum
- Change History
|What People Say|
This is a great component. I've been using it for a year. It's well written, performance is top notch, and the couple of time I've asked for support, I've gotten it right away from the author.