UFN_EVENTCONFLICT_GETEVENTINFOFORLIST
Gets the event information for events that created this conflict.
Return
Return Type |
---|
table |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@EVENTCONFLICTID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_EVENTCONFLICT_GETEVENTINFOFORLIST
(
@EVENTCONFLICTID uniqueidentifier
)
returns @EVENTINFO table
(
RECORDID uniqueidentifier,
PAGEID uniqueidentifier,
PROGRAMID uniqueidentifier,
NAME nvarchar(100),
STARTDATE datetime,
ENDDATE datetime,
STARTTIME UDT_HOURMINUTE,
ENDTIME UDT_HOURMINUTE,
TIMESPANDISPLAY nvarchar(25),
LOCATIONS nvarchar(500),
RESOURCES nvarchar(500),
STAFFRESOURCES nvarchar(500),
ISLOCATIONCONFLICT bit,
ISRESOURCECONFLICT bit,
ISSTAFFRESOURCECONFLICT bit,
LOCATIONSINCONFLICT nvarchar(500),
RESOURCESINCONFLICT nvarchar(500),
STAFFRESOURCESINCONFLICT nvarchar(500),
RECORDTYPE tinyint,
DISTINCTLOCATIONSINCONFLICT nvarchar(500),
DISTINCTRESOURCESINCONFLICT nvarchar(500),
DISTINCTSTAFFRESOURCESINCONFLICT nvarchar(500)
)
as begin
-- get the information we need about the conflict
declare @START datetime;
declare @END datetime;
declare @LOCATIONS xml;
declare @RESOURCES xml;
declare @STAFFRESOURCES xml;
select @START = EVENTCONFLICT.STARTDATETIME,
@END = EVENTCONFLICT.ENDDATETIME,
@LOCATIONS = dbo.UFN_EVENTCONFLICT_GETLOCATIONS_TOITEMLISTXML(@EVENTCONFLICTID),
@RESOURCES = dbo.UFN_EVENTCONFLICT_GETRESOURCES_TOITEMLISTXML(@EVENTCONFLICTID),
@STAFFRESOURCES = dbo.UFN_EVENTCONFLICT_GETSTAFFRESOURCES_TOITEMLISTXML(@EVENTCONFLICTID)
from EVENTCONFLICT
where EVENTCONFLICT.ID = @EVENTCONFLICTID
--Call the other function
insert into @EVENTINFO
(RECORDID,
PAGEID,
PROGRAMID,
NAME,
STARTDATE,
ENDDATE,
STARTTIME,
ENDTIME,
TIMESPANDISPLAY,
LOCATIONS,
RESOURCES,
STAFFRESOURCES,
ISLOCATIONCONFLICT,
ISRESOURCECONFLICT,
ISSTAFFRESOURCECONFLICT,
LOCATIONSINCONFLICT,
RESOURCESINCONFLICT,
STAFFRESOURCESINCONFLICT,
RECORDTYPE,
DISTINCTLOCATIONSINCONFLICT,
DISTINCTRESOURCESINCONFLICT,
DISTINCTSTAFFRESOURCESINCONFLICT)
select RECORDID,
PAGEID,
PROGRAMID,
NAME,
STARTDATE,
ENDDATE,
STARTTIME,
ENDTIME,
TIMESPANDISPLAY,
LOCATIONS,
RESOURCES,
STAFFRESOURCES,
ISLOCATIONCONFLICT,
ISRESOURCECONFLICT,
ISSTAFFRESOURCECONFLICT,
LOCATIONSINCONFLICT,
RESOURCESINCONFLICT,
STAFFRESOURCESINCONFLICT,
RECORDTYPE,
DISTINCTLOCATIONSINCONFLICT,
DISTINCTRESOURCESINCONFLICT,
DISTINCTSTAFFRESOURCESINCONFLICT
from dbo.UFN_EVENTCONFLICT_GETEVENTINFO(@START, @END, @LOCATIONS, @RESOURCES, @STAFFRESOURCES, null, null, null, null, null);
return;
end