C2025-022-Remove-UCF-2
This commit is contained in:
@@ -14765,36 +14765,11 @@ IF (@@Error = 0) PRINT 'StoredProcedure [getJustFormat] Succeeded'
|
||||
ELSE PRINT 'StoredProcedure [getJustFormat] Error on Creation'
|
||||
go
|
||||
|
||||
|
||||
-- Remove getFormatNoUCF from DB (UCF) no longer used.
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getFormatNoUCF]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [getFormatNoUCF];
|
||||
GO
|
||||
CREATE PROCEDURE [dbo].[getFormatNoUCF]
|
||||
(
|
||||
@FormatID int
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
SELECT
|
||||
[FormatID],
|
||||
[ParentID],
|
||||
[Name],
|
||||
[Description],
|
||||
[Data],
|
||||
[Config],
|
||||
[GenMac],
|
||||
[DTS],
|
||||
[UserID],
|
||||
[LastChanged],
|
||||
(SELECT COUNT(*) FROM [Contents] WHERE [Contents].[FormatID]=[Formats].[FormatID]) [ContentCount],
|
||||
(SELECT COUNT(*) FROM [DocVersions] WHERE [DocVersions].[FormatID]=[Formats].[FormatID]) [DocVersionCount],
|
||||
(SELECT COUNT(*) FROM [Folders] WHERE [Folders].[FormatID]=[Formats].[FormatID]) [FolderCount],
|
||||
(SELECT COUNT(*) FROM [Formats] [Children] WHERE [Children].[ParentID]=[Formats].[FormatID]) [ChildCount]
|
||||
FROM [Formats]
|
||||
WHERE [FormatID]=@FormatID
|
||||
|
||||
RETURN
|
||||
GO
|
||||
-- Display the status of Proc creation
|
||||
IF (@@Error = 0) PRINT 'StoredProcedure [getFormatNoUCF] Succeeded'
|
||||
ELSE PRINT 'StoredProcedure [getFormatNoUCF] Error on Creation'
|
||||
@@ -14981,100 +14956,10 @@ IF (@@Error = 0) PRINT 'StoredProcedure [vefn_GetFolderMatchingFormatItems] Succ
|
||||
ELSE PRINT 'StoredProcedure [vefn_GetFolderMatchingFormatItems] Error on Creation'
|
||||
go
|
||||
|
||||
-- Remove vesp_ClearOverrideFormatsByFolder (UCF) from DB. No longer used.
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_ClearOverrideFormatsByFolder]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [vesp_ClearOverrideFormatsByFolder];
|
||||
GO
|
||||
CREATE PROCEDURE [dbo].[vesp_ClearOverrideFormatsByFolder](@FolderID int, @FormatID int, @NewFormatID int)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @ClearedContents TABLE
|
||||
(
|
||||
ContentID int
|
||||
)
|
||||
DECLARE @ClearedFolders TABLE
|
||||
(
|
||||
FolderID int
|
||||
)
|
||||
DECLARE @ClearedDocVersions TABLE
|
||||
(
|
||||
VersionID int
|
||||
)
|
||||
|
||||
insert into @ClearedContents
|
||||
select cc.ContentID from (select contentid from contents where formatid is not null) cc
|
||||
join vefn_GetFolderMatchingFormatItems(@FolderID, @FormatID, @NewFormatID) vi on vi.ContentID = cc.ContentID
|
||||
|
||||
-- update any folders & docversions that are using that formatid to clear them, i.e. so they inherit. To do this
|
||||
-- get lists of folders & docversions that have non-null format ids that should be null.
|
||||
|
||||
BEGIN
|
||||
With Folderz([FolderID], [FormatID]) as
|
||||
(
|
||||
select FF.FolderID, FF.FormatID from Folders FF
|
||||
Where FF.FolderID = @FolderID
|
||||
UNION ALL
|
||||
select FF.FolderID, FF.FormatID from Folders FF
|
||||
Join Folderz ZZ on FF.ParentID = ZZ.FolderID
|
||||
Where FF.FolderID != @FolderID and (FF.FormatID is null or FF.FormatID = @FormatID or FF.FormatID = @NewFormatID)
|
||||
)
|
||||
insert into @ClearedFolders
|
||||
select ZZ.FolderID
|
||||
from Folderz ZZ
|
||||
where ZZ.FormatID is not null and ZZ.FolderID != @FolderID -- don't include folder passed in, only do children (folder is done in code)
|
||||
OPTION (MAXRECURSION 10000)
|
||||
END
|
||||
|
||||
BEGIN
|
||||
With Folderz([FolderID]) as
|
||||
(
|
||||
select FF.FolderID from Folders FF
|
||||
Where FF.FolderID = @FolderID
|
||||
UNION ALL
|
||||
select FF.FolderID from Folders FF
|
||||
Join Folderz ZZ on FF.ParentID = ZZ.FolderID
|
||||
Where FF.FolderID != @FolderID and (FF.FormatID is null or FF.FormatID = @FormatID or FF.FormatID = @NewFormatID)
|
||||
)
|
||||
insert into @ClearedDocVersions
|
||||
select DV.VersionID
|
||||
from Folderz ZZ
|
||||
Left Join DocVersions DV ON DV.FolderID = ZZ.FolderID
|
||||
where VersionID is not null and DV.FormatID is not null and (DV.FormatID = @FormatID or DV.FormatID = @NewFormatID)
|
||||
OPTION (MAXRECURSION 10000)
|
||||
END
|
||||
update Folders set formatid = null where FolderID in (select FolderID from @ClearedFolders)
|
||||
update DocVersions set formatid = null where VersionID in (select VersionID from @ClearedDocVersions)
|
||||
|
||||
-- now update all of the contents that were found
|
||||
update contents set formatid = null where contentID in (select contentid from @ClearedContents)
|
||||
|
||||
select [ContentID],
|
||||
[Number],
|
||||
[Text],
|
||||
[Type],
|
||||
[FormatID],
|
||||
[Config],
|
||||
[DTS],
|
||||
[UserID],
|
||||
[LastChanged],
|
||||
(SELECT COUNT(*) FROM [Details] WHERE [Details].[ContentID]=[Contents].[ContentID]) [DetailCount],
|
||||
(SELECT COUNT(*) FROM [Entries] WHERE [Entries].[ContentID]=[Contents].[ContentID]) [EntryCount],
|
||||
(SELECT COUNT(*) FROM [Grids] WHERE [Grids].[ContentID]=[Contents].[ContentID]) [GridCount],
|
||||
(SELECT COUNT(*) FROM [Images] WHERE [Images].[ContentID]=[Contents].[ContentID]) [ImageCount],
|
||||
(SELECT COUNT(*) FROM [Items] WHERE [Items].[ContentID]=[Contents].[ContentID]) [ItemCount],
|
||||
(SELECT COUNT(*) FROM [Parts] WHERE [Parts].[ContentID]=[Contents].[ContentID]) [PartCount],
|
||||
(SELECT COUNT(*) FROM [RoUsages] WHERE [RoUsages].[ContentID]=[Contents].[ContentID]) [RoUsageCount],
|
||||
(SELECT COUNT(*) FROM [Transitions] WHERE [Transitions].[FromID]=[Contents].[ContentID]) [TransitionCount],
|
||||
(SELECT COUNT(*) FROM [ZContents] WHERE [ZContents].[ContentID]=[Contents].[ContentID]) [ZContentCount]
|
||||
FROM contents where contentid in (select ContentID from @ClearedContents)
|
||||
RETURN
|
||||
END
|
||||
|
||||
GO
|
||||
-- Display the status of Proc creation
|
||||
IF (@@Error = 0) PRINT 'Procedure Creation: vesp_ClearOverrideFormatsByFolder Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: vesp_ClearOverrideFormatsByFolder Error on Creation'
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vesp_ClearOverrideFormatsByDocVersion]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [vesp_ClearOverrideFormatsByDocVersion];
|
||||
|
@@ -44,8 +44,10 @@ using System.Runtime.InteropServices;
|
||||
// Revision DHH (day - no leading zero, two digit hour - military time
|
||||
//
|
||||
// ********* REMEMBER TO CHECK THE AssemblyConfiguration SETTING (ABOVE) ********
|
||||
[assembly: AssemblyVersion("2.2.2508.2815")]
|
||||
[assembly: AssemblyFileVersion("2.2.2508.2815")]
|
||||
[assembly: AssemblyVersion("2.2.2509.209")]
|
||||
[assembly: AssemblyFileVersion("2.2.2509.209")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -341,7 +341,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
private string _ReplaceWith;
|
||||
[Editor(typeof(RtfEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
//[Editor(typeof(RtfEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
|
||||
[XmlAttribute("ReplaceWith")]
|
||||
[DisplayName("With")]
|
||||
|
@@ -126,76 +126,6 @@ namespace VEPROMS.CSLA.Library
|
||||
XmlNodeList nl = XmlDoc.SelectNodes(xpath);
|
||||
return nl.Count > 0;
|
||||
}
|
||||
//private FormatConfig.ReplaceStrData _UCFandOrigReplaceStrData = null;
|
||||
//// This will return a complete list of ReplaceWords, combining those in the original plant format
|
||||
//// with the ones added by the user via User Control of Format (UCF)
|
||||
//public ReplaceStrData UCFandOrigReplaceStrData
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (_UCFandOrigReplaceStrData != null) return _UCFandOrigReplaceStrData;
|
||||
// _UCFandOrigReplaceStrData = GetMergedReplaceList(this);
|
||||
// return _UCFandOrigReplaceStrData;
|
||||
// }
|
||||
//}
|
||||
//private FormatConfig.ReplaceStrData GetMergedReplaceList(PlantFormat OriginalPlantFormat)
|
||||
//{
|
||||
// need to compare the original format list with the list as it is stored for working with property grid.
|
||||
// FormatConfig.ReplaceStrData retlist = new FormatConfig.ReplaceStrData(); // merged list
|
||||
// List<string> inoriglist = new List<string>(); // use this list to find new items in formatconfig (see below)
|
||||
// foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList)
|
||||
// {
|
||||
// In the format config list(UCF), find the 'ReplaceWord'.This is the 'key' for defining whether the
|
||||
|
||||
// replace word has been overwridden by UCF data.If it exists, use it:
|
||||
|
||||
// ReplaceStr usethisone = null;
|
||||
// bool deleted = false;
|
||||
// States for replacewords: 0 = no change, -1 deleted, 1 added, 2 modified
|
||||
|
||||
// if (FormatConfig != null)
|
||||
// {
|
||||
// foreach (ReplaceStr ucfrepstr in FormatConfig.PlantFormat.FormatData.ReplaceStrData)
|
||||
// {
|
||||
// if (ucfrepstr.ReplaceWord == origrepstr.ReplaceWord)
|
||||
// {
|
||||
// if (ucfrepstr.State == -1) deleted = true;
|
||||
// else usethisone = ucfrepstr;
|
||||
// ucfrepstr.State = 2;
|
||||
// inoriglist.Add(origrepstr.ReplaceWord);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (!deleted && usethisone == null)
|
||||
// {
|
||||
// usethisone = new ReplaceStr();
|
||||
// usethisone.Flag = (E_ReplaceFlags)origrepstr.Flag;
|
||||
// usethisone.State = 0; // no change
|
||||
// usethisone.ReplaceWith = origrepstr.ReplaceWith;
|
||||
// usethisone.ReplaceWord = origrepstr.ReplaceWord;
|
||||
// }
|
||||
// if (!deleted) retlist.Add(usethisone);
|
||||
// }
|
||||
// now add in any ucf only replacements, any that are not in the inoriglist
|
||||
|
||||
// if (FormatConfig != null)
|
||||
// {
|
||||
// foreach (ReplaceStr ucfrepstr in PlantFormat.FormatData.ReplaceStrData)
|
||||
// {
|
||||
// if (!inoriglist.Contains(ucfrepstr.ReplaceWord))
|
||||
// {
|
||||
// ReplaceStr newone = new ReplaceStr();
|
||||
// newone.Flag = (E_ReplaceFlags)ucfrepstr.Flag;
|
||||
// newone.State = 1;
|
||||
// newone.ReplaceWith = ucfrepstr.ReplaceWith;
|
||||
// newone.ReplaceWord = ucfrepstr.ReplaceWord;
|
||||
// retlist.Add(newone);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return (retlist);
|
||||
//}
|
||||
|
||||
//C2025-023 - Electronic Procedures - Modifications to PROMS
|
||||
// EPFormatFiles contains which Electronic Procedure Format files apply to this main format file.
|
||||
|
@@ -1,36 +0,0 @@
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Design;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.Design;
|
||||
using System;
|
||||
|
||||
|
||||
namespace Volian.Base.Library
|
||||
{
|
||||
// The RtfEditor inherits from the UITypeEditor and is used to edit Rtf fields. This provides the interface for fields in FormatConfig
|
||||
// and uses the frmRtfEdit to provide a mechanism to do basic editing of text with a subset of rtf command support.
|
||||
public class RtfEditor : UITypeEditor
|
||||
{
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
||||
{
|
||||
return UITypeEditorEditStyle.Modal;
|
||||
}
|
||||
public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
|
||||
{
|
||||
IWindowsFormsEditorService svc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
|
||||
string rw = value as string;
|
||||
if (svc != null && rw != null)
|
||||
{
|
||||
using (frmRtfEdit form = new frmRtfEdit())
|
||||
{
|
||||
form.Value = rw;
|
||||
if (svc.ShowDialog(form) == DialogResult.OK)
|
||||
{
|
||||
rw = form.Value; // update object
|
||||
}
|
||||
}
|
||||
}
|
||||
return rw;
|
||||
}
|
||||
}
|
||||
}
|
@@ -105,7 +105,6 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PropGridCollEditor.cs" />
|
||||
<Compile Include="RTBAPI.cs" />
|
||||
<Compile Include="RtfEditor.cs" />
|
||||
<Compile Include="RtfTools.cs" />
|
||||
<Compile Include="TmpFile.cs" />
|
||||
<Compile Include="ValidFileName.cs" />
|
||||
|
Reference in New Issue
Block a user