UFN_ITINERARYITEMSTAFFRESOURCE_CONSTITUENTISVALID
Checks if a constituent is a valid staff or board member for an itinerary item staff resource.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ITINERARYITEMSTAFFRESOURCEID | uniqueidentifier | IN | |
@CONSTITUENTID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_ITINERARYITEMSTAFFRESOURCE_CONSTITUENTISVALID
(
@ITINERARYITEMSTAFFRESOURCEID uniqueidentifier,
@CONSTITUENTID uniqueidentifier
)
returns bit
as begin
declare @FILLEDBYCODE tinyint;
declare @UPPERBOUND datetime;
declare @LOWERBOUND datetime;
select @LOWERBOUND = ITINERARY.STARTDATETIME,
@UPPERBOUND = ITINERARY.ENDDATETIME,
@FILLEDBYCODE = ITINERARYITEMSTAFFRESOURCE.FILLEDBYCODE
from dbo.ITINERARYITEM
inner join dbo.ITINERARYITEMSTAFFRESOURCE
on ITINERARYITEMSTAFFRESOURCE.ITINERARYITEMID = ITINERARYITEM.ID
inner join dbo.ITINERARY
on ITINERARY.ID = ITINERARYITEM.ITINERARYID
where ITINERARYITEMSTAFFRESOURCE.ID = @ITINERARYITEMSTAFFRESOURCEID
return dbo.UFN_STAFFRESOURCE_CONSTITUENTISVALID(@CONSTITUENTID, @FILLEDBYCODE, @LOWERBOUND, @UPPERBOUND);
end