Added code to correct 16-bit applicability conversion to 32-bit applicability

This commit is contained in:
Rich 2014-03-04 02:03:42 +00:00
parent 8810301dde
commit 651266e7c8
3 changed files with 41 additions and 26 deletions

View File

@ -82,7 +82,10 @@ namespace DataLoader
// Process Procedures // Process Procedures
Item itm = null; Item itm = null;
if (convertProcedures || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved) if (convertProcedures || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.Approved)
{
ResetApplesToOranges();
itm = MigrateProcedures(cn, pth, docver, convertProcedures, docver.MyDocVersionInfo.ActiveFormat); itm = MigrateProcedures(cn, pth, docver, convertProcedures, docver.MyDocVersionInfo.ActiveFormat);
}
// Show any Missing Transtitons (i.e. Transitions which have not been processed) // Show any Missing Transtitons (i.e. Transitions which have not been processed)
lTime = DateTime.Now.Ticks - lTime; lTime = DateTime.Now.Ticks - lTime;
if (convertProcedures) if (convertProcedures)

View File

@ -208,7 +208,16 @@ namespace DataLoader
{ {
XmlNode unit = xSlave.SelectSingleNode("Config/Slave"); XmlNode unit = xSlave.SelectSingleNode("Config/Slave");
XmlAttribute oldindex = xSlave.CreateAttribute("oldindex"); XmlAttribute oldindex = xSlave.CreateAttribute("oldindex");
oldindex.InnerText = slave.Extension.ToUpper().Replace(".SL", ""); for (int x = 0; x < names.Count; x++)
{
if (unit.Attributes.GetNamedItem("Name").InnerText == names[x])
{
oldindex.InnerText = (x + 1).ToString();
break;
}
}
if(oldindex.InnerText == "")
oldindex.InnerText = slave.Extension.ToUpper().Replace(".SL", "");
unit.Attributes.SetNamedItem(oldindex); unit.Attributes.SetNamedItem(oldindex);
XmlAttribute index = xSlave.CreateAttribute("index"); XmlAttribute index = xSlave.CreateAttribute("index");
idx++; idx++;

View File

@ -5356,23 +5356,15 @@ CREATE FUNCTION [dbo].[ve_GetItemApplicability] (@ItemID int) RETURNS varchar(ma
WITH EXECUTE AS OWNER WITH EXECUTE AS OWNER
AS AS
BEGIN BEGIN
declare @apple varchar(max) declare @apple varchar(max)
select @apple = isnull(r2.value('@Applicability','varchar(max)'),'-1') select @apple = r2.value('@Applicability','varchar(max)')
from from
( (
select itemid,cast(config as xml) xconfig from items ii join contents cc on ii.contentid = cc.contentid select itemid,cast(config as xml) xconfig from items ii join contents cc on ii.contentid = cc.contentid
) t1 ) t1
outer apply xconfig.nodes('//MasterSlave') t2(r2) outer apply xconfig.nodes('//MasterSlave') t2(r2)
where itemid = @ItemID where itemid = @ItemID
if @apple = '-1' begin return @apple
set @apple = ''
select @apple = coalesce(@apple + ',','') + r2.value('@index','varchar(max)') from
(select cast(config as xml) xconfig from docversions
where versionid = dbo.vefn_GetVersionIDByItemID(@ItemID)) ah
cross apply xconfig.nodes('//Slave') t2(r2)
set @apple = substring(@apple,2,len(@apple))
end
return @apple
END END
GO GO
IF (@@Error = 0) PRINT 'ScalerFunction [vefn_GetItemApplicability] Succeeded' IF (@@Error = 0) PRINT 'ScalerFunction [vefn_GetItemApplicability] Succeeded'
@ -5410,7 +5402,7 @@ WITH EXECUTE AS OWNER
AS AS
BEGIN BEGIN
with Itemz([Relationship], [ItemID], [ContentID], [PreviousID]) as ( with Itemz([Relationship], [ItemID], [ContentID], [PreviousID]) as (
Select 1 [Relati@Parentsonship], [ItemID], [ContentID], [PreviousID] Select 1 [Relationship], [ItemID], [ContentID], [PreviousID]
FROM [Items] FROM [Items]
where [ItemID]=@ItemID where [ItemID]=@ItemID
Union All Union All
@ -5460,13 +5452,24 @@ WITH EXECUTE AS OWNER
AS AS
BEGIN BEGIN
declare @apple varchar(max) declare @apple varchar(max)
set @apple = '' select @apple = dbo.ve_getitemapplicability(@ItemID)
select @apple = @apple + ',' + cast(id as varchar(10)) if @apple is null
from [dbo].[vefn_ParentItems](@ItemID) begin
cross apply vefn_SplitInt([dbo].[ve_GetItemApplicability](itemid),',') declare @ParentID int
where [dbo].[ve_GetItemApplicability](itemid) != '-1' select @ParentID = dbo.ve_getparentitem(@ItemID)
group by id having count(*) = (select count(*) from [dbo].[vefn_ParentItems](@ItemID) where [dbo].[ve_GetItemApplicability](itemid) != '-1') if @parentid is not null
return substring(@apple,2,len(@apple)) set @apple = dbo.ve_GetItemDerivedApplicability(@ParentID)
else
begin
set @apple = ''
select @apple = coalesce(@apple + ',','') + r2.value('@index','varchar(max)') from
(select cast(config as xml) xconfig from docversions
where versionid = dbo.vefn_GetVersionIDByItemID(@ItemID)) ah
cross apply xconfig.nodes('//Slave') t2(r2)
set @apple = substring(@apple,2,len(@apple))
end
end
return @apple
END END
GO GO
-- Display the status of TableFunction creation -- Display the status of TableFunction creation