[dbo].[XmlExportOfficeIndustrialInformation]
CREATE PROCEDURE [dbo].[XmlExportOfficeIndustrialInformation]
@inOrderID int,
@inXmlInterfaceID int,
@outStatusCode int output,
@outErrorCode int output
as
set nocount on;
set @outStatusCode = 0;
set @outErrorCode = 0;
declare @ERROR_CODE_INVALID_ORDER int;
set @ERROR_CODE_INVALID_ORDER = 2048;
declare @STATUS_CODE_PROCESSED int;
set @STATUS_CODE_PROCESSED = 1;
declare @STATUS_CODE_ERROR int;
set @STATUS_CODE_ERROR = 0;
declare @theValidOrderFlag bit;
exec @theValidOrderFlag = dbo.ValidateOrderID @inOrderID;
if ( 0 = @theValidOrderFlag )
begin
set @outErrorCode = @ERROR_CODE_INVALID_ORDER;
set @outStatusCode = @STATUS_CODE_ERROR;
end
else
begin
select
1 as tag,
null as parent,
[OrderOfficeIndustrialInfo!1!ProjectManager!element] = dbo.FormatFirstNameLastName( ProjectManagerSysuser.FIRSTNAME, ProjectManagerSysuser.LASTNAME ),
[OrderOfficeIndustrialInfo!1!JobStartDate!element] = OfficeIndustrialOrder.JobStartDate,
[OrderOfficeIndustrialInfo!1!JobEndDate!element] = OfficeIndustrialOrder.JobEndDate,
[OrderOfficeIndustrialInfo!1!HeadCount!element] = OfficeIndustrialOrder.HeadCount,
[OrderOfficeIndustrialInfo!1!ClientNote!element] = OfficeIndustrialOrder.ClientNote,
[OrderOfficeIndustrialInfo!1!OperationalNote!element] = OfficeIndustrialOrder.OperationalNote
from OfficeIndustrialOrder
left outer join Sysuser as ProjectManagerSysuser on ( ProjectManagerSysuser.SysUserID = OfficeIndustrialOrder.ProjectManager )
where OfficeIndustrialOrder.OrderFID = @inOrderID
for xml explicit;
set @outStatusCode = @STATUS_CODE_PROCESSED;
end
GO
GRANT EXECUTE ON [dbo].[XmlExportOfficeIndustrialInformation] TO [MssExec]
GO