diff --git a/PROMS/Formats/fmtall/BASEall.xml b/PROMS/Formats/fmtall/BASEall.xml index 8ca3756e..bfdff426 100644 Binary files a/PROMS/Formats/fmtall/BASEall.xml and b/PROMS/Formats/fmtall/BASEall.xml differ diff --git a/PROMS/VEPROMS User Interface/App.config b/PROMS/VEPROMS User Interface/App.config index 6a31a77c..6e792fea 100644 --- a/PROMS/VEPROMS User Interface/App.config +++ b/PROMS/VEPROMS User Interface/App.config @@ -199,4 +199,4 @@ - + \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index 1b594eaa..e4cb25c4 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -14765,40 +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' -GO IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_GetItemsMatchingFormatItems]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1) DROP FUNCTION [vefn_GetItemsMatchingFormatItems]; @@ -14981,100 +14952,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]; diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs index 022d7469..91dd38c4 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs +++ b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs @@ -410,17 +410,5 @@ namespace VEPROMS.Properties { this["VisioPath"] = value; } } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int UCFImportOpt { - get { - return ((int)(this["UCFImportOpt"])); - } - set { - this["UCFImportOpt"] = value; - } - } } } diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.settings b/PROMS/VEPROMS User Interface/Properties/Settings.settings index 193c02ad..761fa632 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.settings +++ b/PROMS/VEPROMS User Interface/Properties/Settings.settings @@ -80,11 +80,9 @@ True - False - False @@ -103,8 +101,5 @@ - - 0 - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj b/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj index a6e13435..9022df4b 100644 --- a/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj +++ b/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj @@ -242,12 +242,6 @@ dlgTransitionReport.cs - - Form - - - dlgUCFDetail.cs - Form @@ -302,12 +296,6 @@ frmSI.cs - - Form - - - frmUCF.cs - Form @@ -378,9 +366,6 @@ dlgSetChangeBarStartDate.cs - - dlgUCFDetail.cs - frmAnnotationsCleanup.cs @@ -402,9 +387,6 @@ frmSI.cs - - frmUCF.cs - Designer frmVEPROMS.cs @@ -603,8 +585,6 @@ - - diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index c50a1019..b914dad9 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1309,7 +1309,7 @@ namespace VEPROMS pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; if (si.IsApproved == 1) { - dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (E_UCFImportOptions)0, selectedSlave); // "true tell export to convert ROs and Transitions to text + dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave)); // "true tell export to convert ROs and Transitions to text dlg.DocReplace = frm.DocReplace; // this tells approval to prepare an export file with resolved transitions and ROs, word sections are saved with resolved ROs during approval PDF creation and saved in DocReplace System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); dlg.ExportItem(xd, pi, "procedure"); diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/VEPROMS User Interface/dlgExportImport.cs index 2b089bb0..399ea4f6 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImport.cs @@ -75,9 +75,8 @@ namespace VEPROMS xa.InnerText = value; return xa; } - public dlgExportImport(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, E_UCFImportOptions frset, int unitIndex = 0) + public dlgExportImport(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int unitIndex = 0) { - UCFImportDefaultFromSettings = frset; MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing _MyMode = mode; MyFolder = folderInfo; @@ -97,9 +96,8 @@ namespace VEPROMS FormClosed += RemoveUnit_OnClose; } } - public dlgExportImport(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS, E_UCFImportOptions frset, int unitIndex = 0) + public dlgExportImport(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS, int unitIndex = 0) { - UCFImportDefaultFromSettings = frset; MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing _MyMode = mode; MyDocVersion = docVersionInfo; @@ -120,9 +118,8 @@ namespace VEPROMS FormClosed += RemoveUnit_OnClose; } } - public dlgExportImport(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS, E_UCFImportOptions frset, int unitIndex = 0) + public dlgExportImport(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS, int unitIndex = 0) { - UCFImportDefaultFromSettings = frset; MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing _MyMode = mode; MyProcedure = procedureInfo; @@ -723,28 +720,9 @@ namespace VEPROMS ImportProcedureNew(xd); isImported = true; } - if (isImported && UCFImportCase == E_UCFImportOptions.LoadForSetOnly) UpdateFormatForUCFInSet(); return true;// Import Suceeded } - private void UpdateFormatForUCFInSet() - { - // this gets called if the UCFImportCase == LoadForSetOnly, i.e. only items in this PROCEDURE Set whose formats point to a - // UCF format should point to the updated (copied) UCF format. - if (renamedUCFFormatId == null) return; - foreach (int key in renamedUCFFormatId.Keys) - { - using (ContentInfoList cil = ContentInfoList.FixFormatIDAfterImport(MyDocVersion.VersionID.ToString(), renamedUCFFormatId[key], key)) - { - foreach (ContentInfo ci in cil) - { - using (Content c = ci.Get()) - { - ContentInfo.Refresh(c); - } - } - } - } - } + // Added Error Handling to assure that Change Manager is turned-on regardless of success or failure of the import // B2019-046: improved error handling (added return value & error message) private bool TryToLoadImportDataDocument() @@ -1024,8 +1002,6 @@ namespace VEPROMS c.Save(); } } - private E_UCFImportOptions UCFImportDefaultFromSettings; - private E_UCFImportOptions UCFImportCase = E_UCFImportOptions.LoadOnlyImported; Dictionary existingCopyFCName = new Dictionary(); // note that this is used when importing a folder or a procedure (procedure was added for UCF changes) private bool LoadFormats(XmlDocument xd, string xmlpath) @@ -1067,7 +1043,6 @@ namespace VEPROMS { existingFC.Add(exFI.Config); importedFC.Add(config); - conflictingUCFdata = true; fname.Add(name); } else @@ -1076,22 +1051,6 @@ namespace VEPROMS } } - // there is a difference in UCF data, see if user wants sections to use the existing or new ucf data: - if (conflictingUCFdata) - { - // Bring up dialog to allow user to choose how the UCF data is handled: - // Importing of a procedure(s) (names of UCF exist in current DB and in exported DB) - //Case 0 - ignore (don't bring in new UCF) - //Case 1 - bringing in new UCF and not using it - //Case 2 - bringing in new UCF and only using it for imported data - //Case 3 - bringing in new UCF and using it across the board - //Case 4 - bringing in new UCF and using it for the current procedure set (not applicable for procedure sets) - UCFImportCase = UCFImportDefaultFromSettings; // from the options/settings - dlgUCFImportOptions ucfoptDlg = new dlgUCFImportOptions(fname, existingFC, importedFC, UCFImportCase, xmlpath); - DialogResult dr = ucfoptDlg.ShowDialog(); - if (dr != DialogResult.OK) return false; - UCFImportCase = ucfoptDlg.UCFImportOptionsCase; // may be reset from dialog. - } // first see if any of the imported formats have different data. If so, foreach (XmlNode nd in nl) { @@ -1143,102 +1102,12 @@ namespace VEPROMS // various cases listed above: if (existingFormat.ContainsKey(name)) { - // if case 0 and this ucf already exists, ignore it: - if (UCFImportCase == E_UCFImportOptions.Ignore) continue; - // if case 1, 2, 4 and the name exists, make a 'copy' of the newly imported format: - // need to add this format - name must be unique so add 'COPY(x) of 'original name'' where x is unique number: - if (UCFImportCase == E_UCFImportOptions.LoadNotUsed || UCFImportCase == E_UCFImportOptions.LoadOnlyImported || UCFImportCase == E_UCFImportOptions.LoadForSetOnly) - { - int count = (fil.Where(fi => fi.Name.EndsWith(name))).Count(); - if (count > 0) - { - string origname = name; - name = string.Format("Copy {0} of {1}", count.ToString(), name); - if (UCFImportCase == E_UCFImportOptions.LoadOnlyImported || UCFImportCase == E_UCFImportOptions.LoadForSetOnly) - { - if (renamedUCFFormatName == null) renamedUCFFormatName = new Dictionary(); - renamedUCFFormatName.Add(origname, name); - } - } - } - // if case 3, take the existing config data and create in a record whose name is Old(x) of 'original name' (the record - // creation gets done below). Then modify the existing record to have the config data. The result is that any - // sections that used this UCF throughout the database will have the new config data. - if (UCFImportCase == E_UCFImportOptions.LoadUseAll) - { - string savname = name; - int count = (fil.Where(fi => fi.Name.EndsWith(name))).Count(); - if (count > 0) - { - name = string.Format("Old {0} of {1}", count.ToString(), name); - } - // update the 'old' record by getting the original config data. - string savdesc = null; - DateTime savdts = DateTime.Now; - string savuid = null; - int savpar = 0; - string savconfig = null; - using (Format origRecord = Format.Get(existingFormat[savname])) - { - savdesc = origRecord.Description; - savdts = origRecord.DTS; - savuid = origRecord.UserID; - savpar = origRecord.ParentID; - savconfig = origRecord.Config; - origRecord.Name = savname; - origRecord.Description = description; - origRecord.DTS = dts; - origRecord.UserID = userid; - origRecord.MyParent = pformat; - origRecord.Config = config; - origRecord.Save(); - description = savdesc; - dts = savdts; - userid = savuid; - pformat = Format.Get(savpar); - config = savconfig; - - } - } } - if (UCFImportCase == 0) // ignore it - { - importedFormat.Add(formatid, name); - } - else - { - Format rec = Format.MakeFormat(pformat, name, description, null, null, dts, userid); - rec.Config = config; - rec.Save(); - if (UCFImportCase == E_UCFImportOptions.LoadNotUsed || UCFImportCase == E_UCFImportOptions.LoadUseAll) // don't reset format id (case 1 don't use it, case 3 copies new data into original record - importedFormat.Add(formatid, name); - else if (UCFImportCase == E_UCFImportOptions.LoadOnlyImported || UCFImportCase == E_UCFImportOptions.LoadForSetOnly) // case 2 uses it for any items imported, case 4 uses it for any sections within current set - { - existingFormat.Add(name, rec.FormatID); // change to original name? - importedFormat.Add(rec.FormatID, name); - // get format id for the original named format - if (UCFImportCase == E_UCFImportOptions.LoadForSetOnly && renamedUCFFormatName != null) - { - int origformatid = -1; - foreach (var kvp in renamedUCFFormatName) - { - if (kvp.Value == name) - { - origformatid = existingFormat[kvp.Key]; - break; - } - } - if (origformatid != -1) - { - if (renamedUCFFormatId == null) renamedUCFFormatId = new Dictionary(); - renamedUCFFormatId.Add(rec.FormatID, origformatid); - } - } - } - } + importedFormat.Add(formatid, name); + } FormatInfoList.Reset(); return true; diff --git a/PROMS/VEPROMS User Interface/dlgExportImportEP.cs b/PROMS/VEPROMS User Interface/dlgExportImportEP.cs index 07151940..5730bbe5 100644 --- a/PROMS/VEPROMS User Interface/dlgExportImportEP.cs +++ b/PROMS/VEPROMS User Interface/dlgExportImportEP.cs @@ -21,7 +21,7 @@ namespace VEPROMS private static Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]"); - public dlgExportImportEP(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, folderInfo, myFrmVEPROMS, (E_UCFImportOptions)0, unitIndex) + public dlgExportImportEP(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, folderInfo, myFrmVEPROMS, ( unitIndex)) { _AnnotationType = AnnotationTypeInfo.Get(annotationTypeId); _ExportBothConvertedandNot = true; @@ -29,7 +29,7 @@ namespace VEPROMS FormClosed += OnClose; Text = $"{mode} Electronic Procedure ({_AnnotationType.Name}) Dialog for {folderInfo.Name}"; } - public dlgExportImportEP(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, docVersionInfo, myFrmVEPROMS, (E_UCFImportOptions)0, unitIndex) + public dlgExportImportEP(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, docVersionInfo, myFrmVEPROMS, (unitIndex)) { _AnnotationType = AnnotationTypeInfo.Get(annotationTypeId); _ExportBothConvertedandNot = true; @@ -37,7 +37,7 @@ namespace VEPROMS FormClosed += OnClose; Text = $"{mode} Electronic Procedure ({_AnnotationType.Name}) Dialog for {docVersionInfo.Name} of {docVersionInfo.MyFolder.Name}"; } - public dlgExportImportEP(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, procedureInfo, myFrmVEPROMS, (E_UCFImportOptions)0, unitIndex) + public dlgExportImportEP(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, procedureInfo, myFrmVEPROMS, (unitIndex)) { _AnnotationType = AnnotationTypeInfo.Get(annotationTypeId); _ExportBothConvertedandNot = true; diff --git a/PROMS/VEPROMS User Interface/dlgUCFDetail.Designer.cs b/PROMS/VEPROMS User Interface/dlgUCFDetail.Designer.cs deleted file mode 100644 index c6ee262b..00000000 --- a/PROMS/VEPROMS User Interface/dlgUCFDetail.Designer.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace VEPROMS -{ - partial class dlgUCFDetail - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.wbBrDet = new System.Windows.Forms.WebBrowser(); - this.SuspendLayout(); - // - // wbBrDet - // - this.wbBrDet.Dock = System.Windows.Forms.DockStyle.Fill; - this.wbBrDet.Location = new System.Drawing.Point(0, 0); - this.wbBrDet.MinimumSize = new System.Drawing.Size(20, 20); - this.wbBrDet.Name = "wbBrDet"; - this.wbBrDet.Size = new System.Drawing.Size(897, 445); - this.wbBrDet.TabIndex = 0; - // - // dlgUCFDetail - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(897, 445); - this.Controls.Add(this.wbBrDet); - this.Name = "dlgUCFDetail"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "User Control of Format Details"; - this.Load += new System.EventHandler(this.dlgUCFDetail_Load); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.WebBrowser wbBrDet; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgUCFDetail.cs b/PROMS/VEPROMS User Interface/dlgUCFDetail.cs deleted file mode 100644 index 18fa64f4..00000000 --- a/PROMS/VEPROMS User Interface/dlgUCFDetail.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using System.Xml; -using System.IO; -using System.Xml.Xsl; - -namespace VEPROMS -{ - public partial class dlgUCFDetail : Form - { - private string MyFormatConfig; - private string UCFName; - private string Description; - // This brings up the dialog for displaying the details of what is contained in this User Control of Format - // as defined by the formatConfig. It uses XSL to display the xml. The XSL can be found in UCFDetails.xsl. - // The result is displayed in a web browser control on the dialog. - public dlgUCFDetail(string formatConfig, string name, string desc) - { - MyFormatConfig = formatConfig; - UCFName = name; - Description = desc; - InitializeComponent(); - } - private void AddAttribute(XmlNode xn, string name, object value) - { - XmlAttribute xa = xn.OwnerDocument.CreateAttribute(name); - xa.Value = value.ToString(); - xn.Attributes.Append(xa); - } - private void dlgUCFDetail_Load(object sender, EventArgs e) - { - try - { - //need to add the UCF name & description to this: - XmlDocument xd = new XmlDocument(); - xd.LoadXml(MyFormatConfig); - XmlNodeList xnl = xd.GetElementsByTagName("FormatConfig"); - if (xnl != null && xnl.Count > 0) - { - AddAttribute(xnl[0], "Name", UCFName); - AddAttribute(xnl[0], "Description", Description); - } - - string sXSLSummary = System.IO.File.ReadAllText(Application.StartupPath + "\\" + "UCFDetails.xsl"); - StringWriter sw = new StringWriter(); - StringWriter xsw = new StringWriter(); - using (XmlReader xrt = XmlReader.Create(new StringReader(sXSLSummary))) - { - XmlTextWriter tx = new XmlTextWriter(xsw); - xd.WriteTo(tx); - string tmp = sw.ToString(); - tmp = xd.InnerXml; - using (XmlReader xri = XmlReader.Create(new StringReader(tmp))) - { - using (XmlWriter xwo = XmlWriter.Create(sw)) - { - XslCompiledTransform xsl = new XslCompiledTransform(); - xsl.Load(xrt); - xsl.Transform(xri, xwo); // Perform Transform - } - this.wbBrDet.DocumentText = sw.ToString(); - } - } - } - catch (Exception ex) - { - MessageBox.Show("Problem occurred displaying the details.", "UCF Warning", MessageBoxButtons.OK); - } - } - } -} diff --git a/PROMS/VEPROMS User Interface/dlgUCFDetail.resx b/PROMS/VEPROMS User Interface/dlgUCFDetail.resx deleted file mode 100644 index 7080a7d1..00000000 --- a/PROMS/VEPROMS User Interface/dlgUCFDetail.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmFolderProperties.cs b/PROMS/VEPROMS User Interface/frmFolderProperties.cs index e0d3a6e7..b15ad4b1 100644 --- a/PROMS/VEPROMS User Interface/frmFolderProperties.cs +++ b/PROMS/VEPROMS User Interface/frmFolderProperties.cs @@ -128,7 +128,7 @@ namespace VEPROMS private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null; private StageInfoList myStageInfoList = null; private LocalStageInfoList myLocalStageInfoList = null; - private int? _cmbxformatOriginal = null; + private void frmFolderProperties_Load(object sender, EventArgs e) { _Initializing = true; @@ -149,7 +149,7 @@ namespace VEPROMS ppCmbxFormat.DisplayMember = "FullName"; ppCmbxFormat.ValueMember = "FullName"; ppCmbxFormat.DataSource = FormatUtility.GetFilteredFormatList(FormatInfoList.SortedFormatInfoList); - if (_FolderConfig != null && _FolderConfig.MyFolder != null) _cmbxformatOriginal = _FolderConfig.MyFolder.FormatID; + if (_FolderConfig.FormatSelection != null) { ppCmbxFormat.SelectedValue = _FolderConfig.FormatSelection; @@ -337,24 +337,7 @@ namespace VEPROMS btnAnnoTypeUndo.PerformClick(); //if (btnAnnoTypeSave.Enabled) return; folderConfigBindingSource.EndEdit(); - // if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change: - if (_FolderConfig.MyFolder.FormatID != _cmbxformatOriginal) - { - // clean up & then refresh the configs - using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByFolder(_FolderConfig.MyFolder.FolderID, _cmbxformatOriginal, _FolderConfig.MyFolder.FormatID)) - { - foreach (ContentInfo ci in cil) - { - using (Content c = ci.Get()) - { - // first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen - // and if configs aren't done first, the screen refresh, if based on config data, will not be correct. - foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig(); - ContentInfo.Refresh(c); - } - } - } - } + // Save Default settings for User // // Save whether we should display the default values on this property page diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 3c168a16..9d19bf66 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -120,7 +120,7 @@ namespace VEPROMS PlantFormat pf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat; CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList; CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList; - int maxindx = pf.FormatData.ProcData.CheckOffUCF ? pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex : pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; + int maxindx = pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; // C2020-003 use the _CheckOffIndex dictionary to get and save the index of the selected checkoff from the sorted checkoff list // B2020-039: Added the check for a valid selected index so that crash doesn't occur if (ppGpbxSignoffCheckoff.Enabled && (chkoffList != null && maxindx > 1) @@ -796,7 +796,7 @@ namespace VEPROMS CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList; if (chkoffList != null) chkoffList.Sort(CompareCheckoffUsingOrderBy); // C2020-003 sort the checkoff list via the Index and/or OrderBy elements CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList; - int maxindx = pf.FormatData.ProcData.CheckOffUCF ? pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex : pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; + int maxindx = pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; // B2019-013: was crashing on indexer of checkofflist. If there were UCF checkoffs but none in original format, the indexer // was failing for index of 0 (indexer code went through index attribute of xml and was returning null even though there // were items in list). diff --git a/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs b/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs index 51e952ec..077d4430 100644 --- a/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs @@ -1211,7 +1211,6 @@ namespace VEPROMS this.cbUCFLForSetOnly.Size = new System.Drawing.Size(105, 19); this.cbUCFLForSetOnly.TabIndex = 5; this.cbUCFLForSetOnly.Text = "Load For Set Only"; - this.cbUCFLForSetOnly.CheckedChanged += new System.EventHandler(this.cbUCFLForSetOnly_CheckedChanged); // // cbUCFLUseAll // @@ -1227,7 +1226,6 @@ namespace VEPROMS this.cbUCFLUseAll.Size = new System.Drawing.Size(105, 19); this.cbUCFLUseAll.TabIndex = 4; this.cbUCFLUseAll.Text = "Load Use All"; - this.cbUCFLUseAll.CheckedChanged += new System.EventHandler(this.cbUCFLUseAll_CheckedChanged); // // cbUCFLOnlyImport // @@ -1243,7 +1241,6 @@ namespace VEPROMS this.cbUCFLOnlyImport.Size = new System.Drawing.Size(105, 19); this.cbUCFLOnlyImport.TabIndex = 3; this.cbUCFLOnlyImport.Text = "Load Only Imported"; - this.cbUCFLOnlyImport.CheckedChanged += new System.EventHandler(this.cbUCFLOnlyImport_CheckedChanged); // // cbUCFLNotUsed // @@ -1259,7 +1256,6 @@ namespace VEPROMS this.cbUCFLNotUsed.Size = new System.Drawing.Size(88, 19); this.cbUCFLNotUsed.TabIndex = 2; this.cbUCFLNotUsed.Text = "Load Not Used"; - this.cbUCFLNotUsed.CheckedChanged += new System.EventHandler(this.cbUCFLNotUsed_CheckedChanged); // // cbUCFIgnore // @@ -1275,7 +1271,6 @@ namespace VEPROMS this.cbUCFIgnore.Size = new System.Drawing.Size(67, 19); this.cbUCFIgnore.TabIndex = 1; this.cbUCFIgnore.Text = "Ignore"; - this.cbUCFIgnore.CheckedChanged += new System.EventHandler(this.cbUCFIgnore_CheckedChanged); // // btnReset // diff --git a/PROMS/VEPROMS User Interface/frmSysOptions.cs b/PROMS/VEPROMS User Interface/frmSysOptions.cs index 19de065e..10c695f5 100644 --- a/PROMS/VEPROMS User Interface/frmSysOptions.cs +++ b/PROMS/VEPROMS User Interface/frmSysOptions.cs @@ -75,24 +75,6 @@ namespace VEPROMS cbEnhancedDocumentSync.Checked = Settings.Default.SyncEnhancedDocuments; cbSeparateWindows.Checked = Settings.Default.SeparateWindows; txbxVisioPath.Text = Settings.Default.VisioPath; - switch (Settings.Default.UCFImportOpt) // see dlgExportImport for descripton of these options. - { - case 0: - cbUCFIgnore.Checked = true; - break; - case 1: - cbUCFLNotUsed.Checked = true; - break; - case 2: - cbUCFLOnlyImport.Checked = true; - break; - case 3: - cbUCFLUseAll.Checked = true; - break; - case 4: - cbUCFLForSetOnly.Checked = true; - break; - } //CSM - C2024-031 - Getting User Settings //and set checkboxes based on what they are set to @@ -118,6 +100,7 @@ namespace VEPROMS Settings.Default.PastePlainText = cbPastePlainText.Checked; } } + private void cbPasteNoReturns_CheckedChanged(object sender, EventArgs e) { if (!_initializing) @@ -193,7 +176,6 @@ namespace VEPROMS private bool ss_SyncEnhancedDocuments; private bool ss_SeparateWindows; private string ss_VisioPath; - private int ss_UCFImportOpt; private void SaveStartingSettings() { @@ -210,7 +192,6 @@ namespace VEPROMS ss_SyncEnhancedDocuments = Settings.Default.SyncEnhancedDocuments; ss_SeparateWindows = Settings.Default.SeparateWindows; ss_VisioPath = Settings.Default.VisioPath; - ss_UCFImportOpt = Settings.Default.UCFImportOpt; } private void RestoreStartingSettings() // used with the cancel button @@ -227,7 +208,6 @@ namespace VEPROMS Settings.Default.SyncEnhancedDocuments = ss_SyncEnhancedDocuments; Settings.Default.SeparateWindows = ss_SeparateWindows; Settings.Default.VisioPath = ss_VisioPath; - Settings.Default.UCFImportOpt = ss_UCFImportOpt; } @@ -315,45 +295,7 @@ namespace VEPROMS Settings.Default.VisioPath = txbxVisioPath.Text; } - private void cbUCFIgnore_CheckedChanged(object sender, EventArgs e) - { - if (!_initializing) - { - Settings.Default.UCFImportOpt = 0; - } - } - private void cbUCFLNotUsed_CheckedChanged(object sender, EventArgs e) - { - if (!_initializing) - { - Settings.Default.UCFImportOpt = 1; - } - } - - private void cbUCFLOnlyImport_CheckedChanged(object sender, EventArgs e) - { - if (!_initializing) - { - Settings.Default.UCFImportOpt = 2; - } - } - - private void cbUCFLUseAll_CheckedChanged(object sender, EventArgs e) - { - if (!_initializing) - { - Settings.Default.UCFImportOpt = 3; - } - } - - private void cbUCFLForSetOnly_CheckedChanged(object sender, EventArgs e) - { - if (!_initializing) - { - Settings.Default.UCFImportOpt = 4; - } - } private void cbOTRemember_CheckedChanged(object sender, EventArgs e) { cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbShwRplWrdsColor.Checked; diff --git a/PROMS/VEPROMS User Interface/frmUCF.cs b/PROMS/VEPROMS User Interface/frmUCF.cs deleted file mode 100644 index 18327290..00000000 --- a/PROMS/VEPROMS User Interface/frmUCF.cs +++ /dev/null @@ -1,1015 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Xml; -using System.IO; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; -using System.Text.RegularExpressions; -using System.Xml.Xsl; - - -namespace VEPROMS -{ - // frmUCF is the main form for User Control of Format. It is accessible by Administrator & Set Administrator from the V button Administration - // menu. It uses the FormatConfig structure whose data is stored in the Config field of the Formats table. It uses XmlSerialization to - // store/retrieve the data from the database field and uses a Windows Property Grid to present the data, the data is tied to the - // Property Grid by setting the SelectedObject of the Property Grid to the FormatConfig. FormatConfig objects use TypeConverter(typeof(ExpandableObjectConverter)) on the - // fields to allow for accessing the data structures below the FormatConfig level (by default, fields are shown in the grid, Browsable(false) does - // not show the fields. NOTE that collection data uses the PropGridCollEditor, see that file for further information (in Volian.Base.Library) - // - public partial class frmUCF : Form - { - private bool _UcfForRepWords = false; - public bool UcfForRepWords // flags that UCF has changes to replace words - use for Reset button enabling - { - get { return _UcfForRepWords; } - set { _UcfForRepWords = value; } - } - private FormatConfig MyFormatConfig = new FormatConfig(); - private PlantFormat OriginalPlantFormat; - private FormatInfo OriginalFormatInfo; - public frmUCF() - { - InitializeComponent(); - } - private bool _Initializing = false; - private void frmUCF_Load(object sender, EventArgs e) - { - _Initializing = true; - PlantFormat.DoingUCFCheckOffs = true; - PlantFormat.DoingUCFCheckOffsUse = MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF ?? false; - cbxFormatList.DataSource = null; - cbxFormatList.DisplayMember = "FullName"; - cbxFormatList.ValueMember = "FullName"; - cbxFormatList.DataSource = FormatInfoList.GetFormatInfoListUsed(); - cbxFormatList.SelectedIndex = -1; - MyFormatConfig = new FormatConfig(); - PG.SelectedObject = MyFormatConfig; - PG.Enabled = false; - PG.SelectedGridItemChanged += PG_SelectedGridItemChanged; - PG.PropertyValueChanged += PG_PropertyValueChanged; - btnSaveAs.Enabled = false; - btnSaveClose.Enabled = false; - btnSave.Enabled = false; - btnReset.Enabled = false; - btnDelete.Enabled = false; - _Initializing = false; - } - void PG_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) - { - if (SelectedGridField.EndsWith("Flags:UCF CheckOffs")) - { - // when changing whether the UCF format has the UCF checkoffs (there is a list of checkoffs/headers in the base format, when this - // flag is true, they get added to the list from the starting format), refresh the checkoff header & checkoff lists - if ((bool)e.OldValue != MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF) - { - // refresh the checkoff data in myformatconfig. Need to clear the checkoff header list & checkoff list before - // getting new data. - PlantFormat.DoingUCFCheckOffsUse = (bool)MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF; - GetUCFCheckOffDataForUCFGrid((bool)MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF); - PG.Refresh(); - } - } - else if (SelectedGridField.EndsWith(" Name")) // B2019-012: don't allow removal of '_UCF' from name. - { - if ((string)e.OldValue != MyFormatConfig.Name) - { - if (((string)e.OldValue).EndsWith("_UCF") && !MyFormatConfig.Name.EndsWith("_UCF")) - { - MessageBox.Show(this, "Cannot remove '_UCF' from User Controlled Format name", "UCF Name", MessageBoxButtons.OK); - MyFormatConfig.Name = MyFormatConfig.Name + ("_UCF"); - PG.Refresh(); - } - } - } - } - private string SelectedGridField = "Identification: Name"; // first field sectioned upon creation of form - void PG_SelectedGridItemChanged(object sender, SelectedGridItemChangedEventArgs e) - { - if (_Initializing || _formatListIndexChanging) return; - - // refresh the summary data textbox data to show summary of what is in this UCF. This occurs when move off of a field which - // actually 'stores' the change. - FormatConfig tmpfc = GetChangesUCFForSave(); - string scf = tmpfc.ConvertToString(); - scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", ""); - SetUCFSummary(scf); - - // see if data has changed, and if so, enable the Reset button. - // Upon selection of a grid item, see if the grid item has data associated with it & if so, see if there has been - // a change. Code needs added here for any value listed on the main property grid, i.e. not part of a collection, or - // if the collection is reset in its entirety (replace words is an example of this). - bool enabled = false; - btnReset.Text = "Reset"; - string previousSelectedGridField = SelectedGridField; - SelectedGridField = LabelPath(PG.SelectedGridItem); - // remove the following line before release: - lblPGItem.Text = SelectedGridField; - - if (previousSelectedGridField.EndsWith("Identification: Name") && !SelectedGridField.EndsWith("Identification: Name")) SetButtonSaveAsEnabled(); - if (previousSelectedGridField.EndsWith("Data:Plant Format:Step Settings:Replace Words List")) - { - // if moving off of the replace words, see if any changes exist so that Reset List button is enabled: - FormatConfig.ReplaceStrData rps = GetChangedReplaceListForSave(); - UcfForRepWords = (rps != null && rps.Count > 0); - } - if (SelectedGridField.EndsWith("Identification: Name")) enabled = false; - else if (SelectedGridField.EndsWith("Data:Plant Format")) enabled = false; - else if (SelectedGridField.EndsWith("Data:Plant Format:Section Type Settings")) enabled = false; - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings")) enabled = false; - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags")) enabled = false; - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Compress Steps")) - { - if (MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != null && MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps) - { - btnReset.Text = "Reset to " + OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps; - enabled = true; - } - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Partial Step Compression")) - { - if (MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != null && MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression) - { - btnReset.Text = "Reset to " + OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression; - enabled = true; - } - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:UCF CheckOffs")) - { - if (MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF != null && MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF != OriginalPlantFormat.FormatData.ProcData.CheckOffUCF) - { - btnReset.Text = "Reset to " + OriginalPlantFormat.FormatData.ProcData.CheckOffUCF; - enabled = true; - } - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Replace Words List")) - { - if (UcfForRepWords) // flags that ucf data exists for replace words. - { - btnReset.Text = "Reset List"; - enabled = true; - } - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:CheckOff XOffset")) - { - if (MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != null && MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != 0) // flags that ucf data exists for replace words. - { - btnReset.Text = "Reset to 0"; - enabled = true; - } - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Step List")) enabled = false; - else enabled = false; - - btnReset.Enabled = enabled; - } - // remove the following method for release: - private string LabelPath(GridItem gi) - { - return (gi.Parent == null ? "" : LabelPath(gi.Parent) + ":" + gi.Label); - } - private void btnSaveClose_Click(object sender, EventArgs e) - { - // get a FormatConfig structure that only has differences from the original format. This is what gets saved. - FormatConfig tmpForSave = GetChangesUCFForSave(); - string scf = tmpForSave.ConvertToString(); - scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", ""); - int fmtid = OriginalPlantFormat.MyFormat is Format ? (OriginalPlantFormat.MyFormat as Format).FormatID : (OriginalPlantFormat.MyFormat as FormatInfo).FormatID; - // for now, tell the user that changes don't take affect until reentry. This was done since the 'refresh' of FormatConfig was not - // working. - using (Format fmt = Format.Get(fmtid)) - { - FormatInfo fi = FormatInfo.GetFormatNoUCFByFormatID(OriginalFormatInfo.FormatID); - if (fi.Data == "") - { - fmt.Data = ""; - fmt.GenMac = ""; - } - fmt.Config = scf; - fmt.Name = MyFormatConfig.Name; - fmt.Description = MyFormatConfig.Description; - fmt.Save(true); - MessageBox.Show(this, "Restart PROMS to have format changes take effect.", "", MessageBoxButtons.OK); - } - OriginalPlantFormat.FormatData.ProcData.CheckOffData.ClearCheckOffAndHeaderLists(); - PlantFormat.IgnoreUCF = false; - PlantFormat.DoingUCFCheckOffs = false; - } - private void btnCancel_Click(object sender, EventArgs e) - { - if (OriginalPlantFormat != null) OriginalPlantFormat.FormatData.ProcData.CheckOffData.ClearCheckOffAndHeaderLists(); - PlantFormat.IgnoreUCF = false; - PlantFormat.DoingUCFCheckOffs = false; - } - private bool _formatListIndexChanging = false; // don't change other selections when changing this index - private void cbxFormatList_SelectedIndexChanged(object sender, EventArgs e) - { - if (_Initializing) return; - if (cbxFormatList.SelectedIndex > -1) - { - _formatListIndexChanging = true; - FormatInfoList fl = FormatInfoList.GetFormatInfoListUsed(); - // Get the format data, the query in GetFormatInfoListUsed may have null for data/genmac which causes a - // problem when reading the 'parent' data for UCF saved as formats. - int i = -1; - FormatInfo finfo = cbxFormatList.SelectedItem as FormatInfo; - if (finfo == null) finfo = fl[cbxFormatList.SelectedIndex]; - OriginalFormatInfo = FormatInfo.Get(finfo.FormatID); - OriginalPlantFormat = OriginalFormatInfo.PlantFormat; - - // get original data when accessing the plant format data (not UCF because it UCF data is being modified): - PlantFormat.IgnoreUCF = true; - int formatid = OriginalPlantFormat.MyFormat is Format ? (OriginalPlantFormat.MyFormat as Format).FormatID : (OriginalPlantFormat.MyFormat as FormatInfo).FormatID; - FormatInfo fi = FormatInfo.Get(formatid); - // if this has config data it is a UCF format, the MyFormatConfig has the config data & see if doing additional checkoffs. - // Also, put out the summary of the changes if it is a 'UCF' and if no differences just state that. - btnDetails.Visible = true; - lblSummary.Visible = true; - tbUCFSummary.Visible = true; - if (fi.Config != null && fi.Config != "") - { - MyFormatConfig = FormatConfig.Get(fi.Config); - PlantFormat.DoingUCFCheckOffsUse = MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF ?? false; - btnSaveClose.Enabled = true; // UCF formats can be modified and saved. - btnSave.Enabled = true; - SetUCFSummary(fi.Config); - } - else - { - MyFormatConfig = new FormatConfig(); - btnSaveClose.Enabled = false; - btnSave.Enabled = false; - tbUCFSummary.Text = "No differences from original"; - } - // initialize the data based on the selected format with any changes from the FormatConfig. - GetUCFDataForUCFGrid(); - PG.Enabled = true; - PG.SelectedObject = MyFormatConfig; - btnSaveAs.Enabled = false; - SetDeleteOrResetAllButton(); - - // set derived from if there is a parent: - if (OriginalFormatInfo.MyParent.FormatID == 1) - { - lblDerFrom.Visible = false; - lblDerivedFrom.Visible = false; - } - else - { - // get to top parent format: - FormatInfo p = OriginalFormatInfo; - while (p.MyParent.FormatID != 1) p = p.MyParent; - lblDerFrom.Visible = true; - lblDerivedFrom.Visible = true; - lblDerivedFrom.Text = p.Name.Replace("_UCF", "") + "->" + OriginalFormatInfo.MyParent.Name.Replace("_UCF", "") + ":" + OriginalFormatInfo.MyParent.Description; - } - _formatListIndexChanging = false; - } - - } - - private void SetUCFSummary(string formatConfig) - { - try - { - string sXSLSummary = System.IO.File.ReadAllText(Application.StartupPath + "\\" + "UCFSummary.xsl"); - StringWriter sw = new StringWriter(); - using (XmlReader xrt = XmlReader.Create(new StringReader(sXSLSummary))) - { - using (XmlReader xri = XmlReader.Create(new StringReader(formatConfig))) - { - using (XmlWriter xwo = XmlWriter.Create(sw)) - { - XslCompiledTransform xsl = new XslCompiledTransform(); - xsl.Load(xrt); - xsl.Transform(xri, null, sw); - } - if (sw == null || sw.ToString() == "") - tbUCFSummary.Text = "No differences from original"; - else - tbUCFSummary.Text = sw.ToString(); - } - } - } - catch (Exception ex) - { - MessageBox.Show(ex.Message, "Error getting summary for UCF differences", MessageBoxButtons.OK); - } - } - // The SaveAs Button should only be enabled if the user has given this format change a unique 'Name'. - private void SetButtonSaveAsEnabled() - { - btnSaveAs.Enabled = false; - if (MyFormatConfig.Name == null || MyFormatConfig.Name == "") return; - // See if Name has been changed: - if (MyFormatConfig.Name == OriginalFormatInfo.Name) return; - - // See if the Name is unique - foreach (FormatInfo fi in FormatInfoList.SortedFormatInfoList) - { - if (MyFormatConfig.Name == fi.Name && MyFormatConfig.Name != savDBFormatConfig.Name) - { - MessageBox.Show("A format with Name " + MyFormatConfig.Name + " already exists. Name must be unique. Change the name before a Save As can be done."); - } - } - btnSaveAs.Enabled = true; - return; - } - // If the selected format is a UCF 'Save As', then possibly allow delete (if not used). Otherwise, if selected format - // has Config data, i.e. UCF data, then change button text to 'Revert to Original'. In both cases, enable button, otherwise it is disabled. - private void SetDeleteOrResetAllButton() - { - btnDelete.Enabled = false; - // See if UCF Save As, i.e. Data/Genmac are null and that the format is not used. - FormatInfo fi = FormatInfo.GetFormatNoUCFByFormatID(OriginalFormatInfo.FormatID); - if (fi.Data == "") - { - if (OriginalFormatInfo.ChildFormatCount == 0 && OriginalFormatInfo.FormatContentCount == 0 && OriginalFormatInfo.FormatDocVersionCount == 0 && OriginalFormatInfo.FormatFolderCount == 0) - { - btnDelete.Enabled = true; - btnDelete.Text = "Delete"; - } - } - else - { - if (OriginalFormatInfo.Config != null && OriginalFormatInfo.Config != "") - { - btnDelete.Enabled = true; - btnDelete.Text = "Revert to Original"; - } - } - } - // GetChangeUCFForSave compares UCF data in FormatConfig to the original PlantFormat data to see if there - // are changes that need to be saved to the database. - private FormatConfig savDBFormatConfig; - private FormatConfig GetChangesUCFForSave() - { - FormatConfig changesOnly = new FormatConfig(); - - // Flags - if (MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != null && MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps) - changesOnly.PlantFormat.FormatData.Flags.CompressSteps = MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps; - if (MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != null && MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression) - changesOnly.PlantFormat.FormatData.Flags.PartialStepCompression = MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression; - if (MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF != null && MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF == true) // save if true (original format is always false) - changesOnly.PlantFormat.FormatData.Flags.CheckOffUCF = MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF; - - // CheckOff Headers - if (MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList != null) changesOnly.PlantFormat.FormatData.CheckOffHeaderList = GetChangeCheckOffHeaderListForSave(); - - // CheckOffs - if (MyFormatConfig.PlantFormat.FormatData.CheckOffList != null) changesOnly.PlantFormat.FormatData.CheckOffList = GetChangeCheckOffListForSave(); - - // Checkoff xoffset adjustment - if (MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != null && MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != 0) // save if not zero (original format is always zero) - changesOnly.PlantFormat.FormatData.CheckOffXOffAdj = MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj; - - // steps - if (MyFormatConfig.PlantFormat.FormatData.StepData != null) changesOnly.PlantFormat.FormatData.StepData = GetChangeStepListForSave(); - - // replace words - just store them all, if there are differences... can't handle deleted unless doing this. - if (MyFormatConfig.PlantFormat.FormatData.ReplaceStrData != null) changesOnly.PlantFormat.FormatData.ReplaceStrData = GetChangedReplaceListForSave(); - - // docstyles - FormatConfig.DocStyles retds = new FormatConfig.DocStyles(); - foreach (DocStyle dsorig in OriginalPlantFormat.DocStyles.DocStyleList) - { - if (!dsorig.Inactive && dsorig.IsStepSection) - { - FormatConfig.DocStyle ds = new FormatConfig.DocStyle(); - ds.Index = dsorig.Index.ToString(); - ds.Name = dsorig.Name; - if (ds.Layout == null) ds.Layout = new FormatConfig.Layout(); - // See if in the FormatConfig, use it - FormatConfig.DocStyle found = null; - if (MyFormatConfig.PlantFormat.DocStyles != null) - { - foreach (FormatConfig.DocStyle fcds in MyFormatConfig.PlantFormat.DocStyles) - { - float? difl = Math.Abs((float)((fcds.Layout.LeftMargin * 72) - dsorig.Layout.LeftMargin)); - float? difp = Math.Abs((float)((fcds.Layout.PageLength * 72) - dsorig.Layout.PageLength)); - if (fcds.Index == dsorig.Index.ToString() && (difl > 1 || difp > 1)) - { - found = fcds; - break; - } - } - } - if (found != null) // save it values are different. - { - if ((found.Layout.LeftMargin * 72) != dsorig.Layout.LeftMargin) ds.Layout.LeftMargin = found.Layout.LeftMargin * 72; - else ds.Layout.LeftMargin = null; - if ((found.Layout.PageLength * 72) != dsorig.Layout.PageLength) ds.Layout.PageLength = found.Layout.PageLength * 72; - else ds.Layout.PageLength = null; - retds.Add(ds); - } - } - } - if (retds.Count > 0) changesOnly.PlantFormat.DocStyles = retds; - return changesOnly; - } - // Check for differences in the checkoffheaderlist & checkofflist. Only Active flag is used: - private FormatConfig.CheckOffHeaderList GetChangeCheckOffHeaderListForSave() - { - FormatConfig.CheckOffHeaderList cohlist = new FormatConfig.CheckOffHeaderList(); - foreach (FormatConfig.CheckOffHeader coh in MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList) - { - if (!(bool)coh.Active) cohlist.Add(coh); - } - return cohlist; - } - private FormatConfig.CheckOffList GetChangeCheckOffListForSave() - { - FormatConfig.CheckOffList colist = new FormatConfig.CheckOffList(); - foreach (FormatConfig.CheckOff co in MyFormatConfig.PlantFormat.FormatData.CheckOffList) - { - if (!(bool)co.Active) colist.Add(co); - } - return colist; - } - // Check for differences in the StepDataList between UCF and original data for saving of data to database: - private FormatConfig.StepData GetChangeStepListForSave() - { - FormatConfig.StepData sdlist = new FormatConfig.StepData(); - foreach (StepData sdorig in OriginalPlantFormat.FormatData.StepDataList) - { - if (!sdorig.Inactive) - { - // find this step in the config data: - foreach (FormatConfig.Step fcstp in MyFormatConfig.PlantFormat.FormatData.StepData) - { - if (fcstp.Index == sdorig.Index.ToString()) - { - // see if data is different and if so, add it to the return list: - System.Drawing.FontConverter cvt = new System.Drawing.FontConverter(); - string origFont = cvt.ConvertToString(sdorig.Font.WindowsFont); - string newFont = cvt.ConvertToString(fcstp.FontDesc.WindowsFont); - if (origFont != newFont) - { - FormatConfig.Step stp = fcstp; - sdlist.Add(stp); - } - break; - } - } - } - } - return sdlist; - } - // Check for differences in the ReplaceWords between UCF and original data for saving of data to database: - private FormatConfig.ReplaceStrData GetChangedReplaceListForSave() - { - // only saving the differences - // need to compare the original format list with the list as it is stored for UCF, i.e.working with property grid and save differences. - // Note that check for 'bad' data such as no flags, or null/empty replace with/word strings - don't use those. - // States for replacewords: 0 = no change, -1 deleted, 1 added, 2 modified - FormatConfig.ReplaceStrData retlist = new FormatConfig.ReplaceStrData(); // list of changes - foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData) - { - // Modified - foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList) - { - // B2019-113: consider replace word AND flags to determine if there was a modification - if (origrepstr.ReplaceWord.Replace("{Backspace}", "") == ucfrepstr.ReplaceWord.Replace("{Backspace}", "") && (E_ReplaceFlags)ucfrepstr.Flag == origrepstr.Flag) - { - if ((ucfrepstr.ReplaceWith != origrepstr.ReplaceWith) && ucfrepstr.Flag != 0 && ucfrepstr.ReplaceWith != "") - { - ucfrepstr.State = 2; - retlist.Add(ucfrepstr); - break; - } - } - } - } - // Added: - List origstrList = new List(); // used to find added, (see later in this method) - foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList) origstrList.Add(origrepstr.ReplaceWord); - foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData) - { - if (!origstrList.Contains(ucfrepstr.ReplaceWord)) - { - // check for valid data, i.e. flag set & both replaceword & with not blank - if (ucfrepstr.Flag != 0 && ucfrepstr.ReplaceWith != null && ucfrepstr.ReplaceWith != "" && ucfrepstr.ReplaceWord != null && ucfrepstr.ReplaceWord != "") - { - ucfrepstr.State = 1; - retlist.Add(ucfrepstr); - } - } - else // B2019-113: replace word is in the original list, see if this word was added with different flags - { - if (!RepWrdSameWordSameFlags(OriginalPlantFormat.FormatData.SectData.ReplaceStrList, ucfrepstr)) - { - ucfrepstr.State = 1; - retlist.Add(ucfrepstr); - } - } - } - //Deleted: - List ucfList = new List(); // used to find deleted - foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData) ucfList.Add(ucfrepstr.ReplaceWord); - foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList) - { - bool addtodeletelist = false; - if (!ucfList.Contains(origrepstr.ReplaceWord) ) - { - if (!((origrepstr.ReplaceWith.Contains("$1") && origrepstr.ReplaceWord.Contains("w*")) || origrepstr.ReplaceWith.Contains("{Backspace}"))) - { - addtodeletelist = true; - } - } - else // // B2019-113: for this ucf replaceword, see if its flag is in the original list - { - foreach (FormatConfig.ReplaceStr ucfrepstruct in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData) - { - if (origrepstr.ReplaceWord.Replace("{Backspace}", "") == ucfrepstruct.ReplaceWord.Replace("{Backspace}", "")) - { - // only deleted if replace word AND flags match: - if (!RepWrdSameWordSameFlags(OriginalPlantFormat.FormatData.SectData.ReplaceStrList, ucfrepstruct)) - { - addtodeletelist = true; - break; - } - } - } - } - if (addtodeletelist) - { - // make a deleted replacestr to save - FormatConfig.ReplaceStr del = new FormatConfig.ReplaceStr(); - del.State = -1; - del.Flag = (FormatConfig.E_ReplaceFlagsUCF)origrepstr.Flag; - del.ReplaceWord = origrepstr.ReplaceWord; - del.ReplaceWith = origrepstr.ReplaceWith; - retlist.Add(del); - } - } - return retlist; - } - - private bool RepWrdSameWordSameFlags(ReplaceStrList replaceStrList, FormatConfig.ReplaceStr ucfrepstr) - { - // B2019-133: if the replace word is the same, see if the UCF flag is different. The Replace Word & the flags need to be the same for it to be a match. - List flags = new List(); - foreach (ReplaceStr origrepstr in replaceStrList) - { - if (origrepstr.ReplaceWord.Replace("{Backspace}", "") == ucfrepstr.ReplaceWord.Replace("{Backspace}", "")) flags.Add(ucfrepstr.Flag); - } - return (flags.Contains(ucfrepstr.Flag)); - } - // The following uses the original format's ReplaceWords list and applies any changes made from the UCF ReplaceWords list. - private FormatConfig.ReplaceStrData GetMergedReplaceList() - { - // 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 inoriglist = new List(); // 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: - FormatConfig.ReplaceStr usethisone = null; - bool deleted = false; - // States for replacewords: 0 = no change, -1 deleted, 1 added, 2 modified - foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData) - { - if (ucfrepstr.ReplaceWord == origrepstr.ReplaceWord && (E_ReplaceFlags)ucfrepstr.Flag == origrepstr.Flag) - { - if (ucfrepstr.State == -1) deleted = true; - else usethisone = ucfrepstr; - ucfrepstr.State = 2; - inoriglist.Add(origrepstr.ReplaceWord); - UcfForRepWords = true; - break; - } - } - // don't add in the replacewords that use 'Backspace' and regular expressions: - bool supported = true; - if (!deleted && usethisone == null) - { - if ((origrepstr.ReplaceWith.Contains("$1") || origrepstr.ReplaceWord.Contains("w*")) || origrepstr.ReplaceWith.Contains("{Backspace}")) - supported = false; - else - { - usethisone = new FormatConfig.ReplaceStr(); - usethisone.Flag = (FormatConfig.E_ReplaceFlagsUCF)origrepstr.Flag; - usethisone.State = 0; // no change - usethisone.ReplaceWith = origrepstr.ReplaceWith; - usethisone.ReplaceWord = origrepstr.ReplaceWord; - } - } - if (!deleted && supported) retlist.Add(usethisone); - } - // now add in any ucf only replacements, any that are not in the inoriglist - foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData) - { - if (!inoriglist.Contains(ucfrepstr.ReplaceWord)) - { - FormatConfig.ReplaceStr newone = new FormatConfig.ReplaceStr(); - newone.Flag = (FormatConfig.E_ReplaceFlagsUCF)ucfrepstr.Flag; - newone.State = 1; - //newone.ReplaceWith = ucfrepstr.ReplaceWith; - newone.ReplaceWith = ucfrepstr.ReplaceWith; - newone.ReplaceWord = ucfrepstr.ReplaceWord; - retlist.Add(newone); - UcfForRepWords = true; - } - } - return (retlist); - } - // This method reads in the format items, merging any changes from UCF into original format. It sets MyFormatConfig, which - // is the structure that gets used by the PropertyGrid - private void GetUCFDataForUCFGrid() - { - // name/description is only stored as format record fields. There are attributes in formatconfig xml that are used for defining these - // when new UCFs are defined or allowing for updates. - MyFormatConfig.Name = OriginalFormatInfo.Name; - MyFormatConfig.Description = OriginalFormatInfo.Description; - - // Store original (currently saved FormatConfig) to be used for comparison when saving. - savDBFormatConfig = MyFormatConfig; - - // Flags - if (MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps == null) MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps; - if (MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression == null) MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression; - if (MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF == null) MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF = OriginalPlantFormat.FormatData.ProcData.CheckOffUCF; - - // checkoff xoffset adjustment - if (MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj == null) MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj = 0; - - GetUCFCheckOffDataForUCFGrid((bool)MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF); - - // StepData: If there is no UCF data for steps, copy over from selected format - FormatConfig.StepData sdlMerged = new FormatConfig.StepData(); - if (MyFormatConfig.PlantFormat.FormatData.StepData == null || MyFormatConfig.PlantFormat.FormatData.StepData.Count == 0) - { - foreach (StepData sdorig in OriginalPlantFormat.FormatData.StepDataList) - { - if (!sdorig.Inactive && sdorig.Index != 0) - { - FormatConfig.Step stp = new FormatConfig.Step(); - stp.Index = sdorig.Index.ToString(); - stp.Type = sdorig.Type; - stp.FontDesc = new FormatConfig.FontDesc(); - stp.FontDesc.OrigWindowsFont = sdorig.Font.WindowsFont; - stp.FontDesc.WindowsFont = sdorig.Font.WindowsFont; - if (MyFormatConfig.PlantFormat.FormatData.StepData == null) MyFormatConfig.PlantFormat.FormatData.StepData = new FormatConfig.StepData(); - sdlMerged.Add(stp); - } - } - } - else - { - foreach (StepData sdorig in OriginalPlantFormat.FormatData.StepDataList) - { - if (!sdorig.Inactive && sdorig.Index != 0) - { - FormatConfig.Step stp = new FormatConfig.Step(); - stp.Index = sdorig.Index.ToString(); - stp.Type = sdorig.Type; - stp.FontDesc = new FormatConfig.FontDesc(); - // See if in the FormatConfig, use it - FormatConfig.Step foundinFC = null; - foreach (FormatConfig.Step fcstp in MyFormatConfig.PlantFormat.FormatData.StepData) - { - if (fcstp.Index == sdorig.Index.ToString()) - { - foundinFC = fcstp; - break; - } - } - stp.FontDesc.OrigWindowsFont = new System.Drawing.Font(sdorig.Font.Family, (float)sdorig.Font.Size, sdorig.Font.WindowsFont.Style); - if (foundinFC != null) - stp.FontDesc.WindowsFont = new System.Drawing.Font(foundinFC.FontDesc.WindowsFont.Name, foundinFC.FontDesc.WindowsFont.Size, foundinFC.FontDesc.WindowsFont.Style); - else - stp.FontDesc.WindowsFont = new System.Drawing.Font(sdorig.Font.Family, (float)sdorig.Font.Size, sdorig.Font.WindowsFont.Style); - sdlMerged.Add(stp); - } - } - } - MyFormatConfig.PlantFormat.FormatData.StepData = sdlMerged; - - // ReplacWords - // if there are no replace str entries in sc, add from the selected format: - if (MyFormatConfig.PlantFormat.FormatData.ReplaceStrData == null || MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Count == 0) - { - foreach (ReplaceStr repstrorig in OriginalPlantFormat.FormatData.SectData.ReplaceStrList) - { - if (!((repstrorig.ReplaceWith.Contains("$1") && repstrorig.ReplaceWord.Contains("w*")) || repstrorig.ReplaceWith.Contains("{Backspace}"))) - { - FormatConfig.ReplaceStr rsfc = new FormatConfig.ReplaceStr(); - rsfc.Flag = (FormatConfig.E_ReplaceFlagsUCF)repstrorig.Flag; - rsfc.State = 0; - rsfc.ReplaceWith = repstrorig.ReplaceWith; - rsfc.ReplaceWord = repstrorig.ReplaceWord; - MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Add(rsfc); - } - } - } - else - { - MyFormatConfig.PlantFormat.FormatData.ReplaceStrData = GetMergedReplaceList(); - } - // Document Style (section) Data (docstyles). Get step editor type only - if (MyFormatConfig.PlantFormat.DocStyles == null || MyFormatConfig.PlantFormat.DocStyles.Count == 0) - { - foreach (DocStyle dsorig in OriginalPlantFormat.DocStyles.DocStyleList) - { - if (!dsorig.Inactive && dsorig.IsStepSection) - { - FormatConfig.DocStyle ds = new FormatConfig.DocStyle(); - ds.Index = dsorig.Index.ToString(); - ds.Name = dsorig.Name; - if (ds.Layout == null) ds.Layout = new FormatConfig.Layout(); - ds.Layout.PageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2); - ds.Layout.OrigPageLength = ds.Layout.PageLength; - ds.Layout.LeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2); - ds.Layout.OrigLeftMargin = ds.Layout.LeftMargin; - if (MyFormatConfig.PlantFormat.DocStyles == null) MyFormatConfig.PlantFormat.DocStyles = new FormatConfig.DocStyles(); - MyFormatConfig.PlantFormat.DocStyles.Add(ds); - } - } - } - else - { - foreach (DocStyle dsorig in OriginalPlantFormat.DocStyles.DocStyleList) - { - if (!dsorig.Inactive && dsorig.IsStepSection) - { - FormatConfig.DocStyle ds = new FormatConfig.DocStyle(); - ds.Index = dsorig.Index.ToString(); - ds.Name = dsorig.Name; - if (ds.Layout == null) ds.Layout = new FormatConfig.Layout(); - // See if in the FormatConfig, use it - FormatConfig.DocStyle foundinFC = null; - foreach (FormatConfig.DocStyle fcds in MyFormatConfig.PlantFormat.DocStyles) - { - if (fcds.Index == dsorig.Index.ToString()) - { - foundinFC = fcds; - break; - } - } - if (foundinFC != null) - { - if (foundinFC.Layout.LeftMargin == null) foundinFC.Layout.LeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2); - else foundinFC.Layout.LeftMargin = (float)Math.Round((float)foundinFC.Layout.LeftMargin / 72, 2); - foundinFC.Layout.OrigLeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2); - if (foundinFC.Layout.PageLength == null) foundinFC.Layout.PageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2); - else foundinFC.Layout.PageLength = (float)Math.Round((float)foundinFC.Layout.PageLength / 72, 2); - foundinFC.Layout.OrigPageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2); - } - else - { - ds.Layout.OrigLeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2); - ds.Layout.OrigPageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2); - ds.Layout.LeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2); - ds.Layout.PageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2); - MyFormatConfig.PlantFormat.DocStyles.Add(ds); - } - } - } - } - } - - private void GetUCFCheckOffDataForUCFGrid(bool ucfcheckof) - { - OriginalPlantFormat.FormatData.ProcData.CheckOffData.ClearCheckOffAndHeaderLists(); - // CheckOffHeaders: If there is no UCF data, use from the selected format, otherwise merge: - FormatConfig.CheckOffHeaderList cohdrsMerged = new FormatConfig.CheckOffHeaderList(); - if (MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList == null || MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList.Count == 0) - { - foreach (CheckOffHeader cohorig in OriginalPlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList) - { - // do inactive:: - FormatConfig.CheckOffHeader coh = new FormatConfig.CheckOffHeader(); - coh.Index = cohorig.Index.ToString(); - coh.CheckOffHeading = cohorig.CheckOffHeading; - coh.Active = true; - coh.OrigActive = true; - cohdrsMerged.Add(coh); - } - } - else - { - foreach (CheckOffHeader cohorig in OriginalPlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList) - { - FormatConfig.CheckOffHeader coh = new FormatConfig.CheckOffHeader(); - coh.Index = cohorig.Index.ToString(); - coh.CheckOffHeading = cohorig.CheckOffHeading; - coh.Active = true; - coh.OrigActive = true; - // See if in the FormatConfig, to check its inactive flag: - foreach (FormatConfig.CheckOffHeader fccoh in MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList) - { - if (fccoh.Index == cohorig.Index.ToString()) - { - coh.Active = fccoh.Active; - coh.OrigActive = true; - break; - } - } - cohdrsMerged.Add(coh); - } - } - MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList = cohdrsMerged; - - // CheckOffs: If there is no UCF data, use from the selected format, otherwise merge: - FormatConfig.CheckOffList cosMerged = new FormatConfig.CheckOffList(); - // clear the lists so that correct lists will be initialized - foreach (CheckOff coorig in OriginalPlantFormat.FormatData.ProcData.CheckOffData.CheckOffList) - { - FormatConfig.CheckOff co = new FormatConfig.CheckOff(); - co.Index = coorig.Index.ToString(); - co.MenuItem = coorig.MenuItem; - co.Active = true; - co.OrigActive = true; - // See if in the FormatConfig, to check its inactive flag: - if (MyFormatConfig.PlantFormat.FormatData.CheckOffList != null) - { - foreach (FormatConfig.CheckOff fcco in MyFormatConfig.PlantFormat.FormatData.CheckOffList) - { - if (fcco.Index == coorig.Index.ToString()) - { - co.Active = fcco.Active; - co.OrigActive = true; - break; - } - } - } - cosMerged.Add(co); - } - MyFormatConfig.PlantFormat.FormatData.CheckOffList = cosMerged; - } - // The Reset button is used to reset a UCF change from the original data. If a field is added to UCF, code needs - // added here for the field: - private void btnReset_Click(object sender, EventArgs e) - { - // The code that enables the Reset button checks if a change (UCF) exists. So no need to check here. - if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Compress Steps")) - { - MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps; - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Partial Step Compression")) - { - MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression; - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:UCF CheckOffs")) - { - MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF = OriginalPlantFormat.FormatData.ProcData.CheckOffUCF; - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:CheckOff XOffset")) - { - MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj = 0; - } - else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Replace Words List")) - { - MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Clear(); - foreach (ReplaceStr repstrorig in OriginalPlantFormat.FormatData.SectData.ReplaceStrList) - { - if (!((repstrorig.ReplaceWith.Contains("$1") && repstrorig.ReplaceWord.Contains("w*")) || repstrorig.ReplaceWith.Contains("{Backspace}"))) - { - FormatConfig.ReplaceStr rsfc = new FormatConfig.ReplaceStr(); - rsfc.Flag = (FormatConfig.E_ReplaceFlagsUCF)repstrorig.Flag; - rsfc.State = 0; - rsfc.ReplaceWith = repstrorig.ReplaceWith; - rsfc.ReplaceWord = repstrorig.ReplaceWord; - MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Add(rsfc); - UcfForRepWords = false; - } - } - } - btnReset.Enabled = false; - btnReset.Text = "Reset"; - } - - private void btnSaveAs_Click(object sender, EventArgs e) - { - // Name must be unique - description can be null. - // Append a '_UCF' at end of all user control of format formats. - // add a format record for this: - // FormatID - next ID, db creates on new format - // ParentID - format id of the format that was used as a base for this user control of format - // Name - user defined - // Description - user defined - if none specified by user, use the original's description - // Data - null: flags that a UCF was saved as and use the parent and config from this. - // - - // check for unique name. - foreach (FormatInfo fi in FormatInfoList.SortedFormatInfoList) - { - if (MyFormatConfig.Name == fi.Name || MyFormatConfig.Name + "_UCF" == fi.Name) - { - MessageBox.Show("A format with Name " + MyFormatConfig.Name + " already exists. Name must be unique. Save As cannot be done."); - return; - } - } - using (Format tmp = Format.Get(OriginalFormatInfo.FormatID)) - { - string fname = MyFormatConfig.Name + (MyFormatConfig.Name.EndsWith("_UCF") ? "" : "_UCF"); - Format fmt = Format.MakeFormat(tmp, fname, MyFormatConfig.Description == OriginalFormatInfo.Description || MyFormatConfig.Description == "" || MyFormatConfig.Description == null ? OriginalFormatInfo.Description : MyFormatConfig.Description, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); - FormatConfig tmpForSave = GetChangesUCFForSave(); - string scf = tmpForSave.ConvertToString(); - scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", ""); - // for now, tell the user that changes don't take affect until reentry. This was done since the 'refresh' of FormatConfig was not - // working. - fmt.Config = scf; - fmt.Description = MyFormatConfig.Description; - fmt.Save(true); - MessageBox.Show(this, "Restart PROMS to have format changes take effect.", "", MessageBoxButtons.OK); - btnSaveAs.Enabled = false; - } - } - - private void btnDelete_Click(object sender, EventArgs e) - { - // delete this format OR (the button text is set to 'delete...' if no item or version uses it) - // revert to the original - string msg = btnDelete.Text == "Revert to Original" ? "revert to the original?" : "delete this format?"; - if (MessageBox.Show(this, "Are you sure you want to " + msg, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - PlantFormat.IgnoreUCF = true; - // the button is either 'Revert to Original' for a format that is the original and has config data, or 'Delete' for a UCF that - // was created by a 'Save As'. - // so do either a clear of the config data, or delete the format record depending on button's text - if (btnDelete.Text == "Revert to Original") - { - using (Format fmt = Format.Get(OriginalFormatInfo.FormatID)) - { - fmt.Config = ""; - fmt.Save(true); - MessageBox.Show(this, "The changes that have been made to the format will take affect after reentry to PROMS", "", MessageBoxButtons.OK); - MyFormatConfig = new FormatConfig(); - PG.SelectedObject = MyFormatConfig; - PG.Enabled = false; - btnSaveAs.Enabled = false; - btnDelete.Enabled = false; - btnSaveClose.Enabled = false; - btnSave.Enabled = false; - btnReset.Enabled = false; - } - } - else - { - try - { - Format.Delete(OriginalFormatInfo.FormatID); - } - catch (Exception ex) - { - MessageBox.Show("Could not delete the format"); - return; - } - cbxFormatList.DataSource = FormatInfoList.GetFormatInfoListUsed(); - cbxFormatList.SelectedIndex = -1; - MyFormatConfig = new FormatConfig(); - PG.SelectedObject = MyFormatConfig; - PG.Enabled = false; - btnSaveAs.Enabled = false; - btnDelete.Enabled = false; - btnSaveClose.Enabled = false; - btnSave.Enabled = false; - btnReset.Enabled = false; - } - PlantFormat.IgnoreUCF = false; - PlantFormat.DoingUCFCheckOffs = false; - } - } - - private void btnDetails_Click(object sender, EventArgs e) - { - FormatConfig tmpfc = GetChangesUCFForSave(); - string scf = tmpfc.ConvertToString(); - scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", ""); - dlgUCFDetail dtl = new dlgUCFDetail(scf, MyFormatConfig.Name, MyFormatConfig.Description); - dtl.ShowDialog(); - } - - private void btnSave_Click(object sender, EventArgs e) - { - // get a FormatConfig structure that only has differences from the original format. This is what gets saved. - FormatConfig tmpForSave = GetChangesUCFForSave(); - string scf = tmpForSave.ConvertToString(); - scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", ""); - int fmtid = OriginalPlantFormat.MyFormat is Format ? (OriginalPlantFormat.MyFormat as Format).FormatID : (OriginalPlantFormat.MyFormat as FormatInfo).FormatID; - // for now, tell the user that changes don't take affect until reentry. This was done since the 'refresh' of FormatConfig was not - // working. - using (Format fmt = Format.Get(fmtid)) - { - FormatInfo fi = FormatInfo.GetFormatNoUCFByFormatID(OriginalFormatInfo.FormatID); - if (fi.Data == "") - { - fmt.Data = ""; - fmt.GenMac = ""; - } - fmt.Config = scf; - fmt.Name = MyFormatConfig.Name; - fmt.Description = MyFormatConfig.Description; - fmt.Save(true); - } - } - } -} diff --git a/PROMS/VEPROMS User Interface/frmUCF.designer.cs b/PROMS/VEPROMS User Interface/frmUCF.designer.cs deleted file mode 100644 index 4c257fb0..00000000 --- a/PROMS/VEPROMS User Interface/frmUCF.designer.cs +++ /dev/null @@ -1,287 +0,0 @@ -namespace VEPROMS -{ - partial class frmUCF - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - //protected override void Dispose(bool disposing) - //{ - // if (disposing && (components != null)) - // { - // components.Dispose(); - // } - // base.Dispose(disposing); - //} - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.PGpanelBtm = new System.Windows.Forms.Panel(); - this.btnSave = new System.Windows.Forms.Button(); - this.btnDelete = new System.Windows.Forms.Button(); - this.btnReset = new System.Windows.Forms.Button(); - this.btnSaveAs = new System.Windows.Forms.Button(); - this.lblPGItem = new System.Windows.Forms.Label(); - this.btnSaveClose = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.PG = new System.Windows.Forms.PropertyGrid(); - this.pnlFormatList = new System.Windows.Forms.Panel(); - this.tbUCFSummary = new System.Windows.Forms.TextBox(); - this.btnDetails = new System.Windows.Forms.Button(); - this.lblSummary = new System.Windows.Forms.Label(); - this.lblDerivedFrom = new System.Windows.Forms.Label(); - this.lblDerFrom = new System.Windows.Forms.Label(); - this.cbxFormatList = new System.Windows.Forms.ComboBox(); - this.lblFormatList = new System.Windows.Forms.Label(); - this.PGpanelBtm.SuspendLayout(); - this.pnlFormatList.SuspendLayout(); - this.SuspendLayout(); - // - // PGpanelBtm - // - this.PGpanelBtm.Controls.Add(this.btnSave); - this.PGpanelBtm.Controls.Add(this.btnDelete); - this.PGpanelBtm.Controls.Add(this.btnReset); - this.PGpanelBtm.Controls.Add(this.btnSaveAs); - this.PGpanelBtm.Controls.Add(this.lblPGItem); - this.PGpanelBtm.Controls.Add(this.btnSaveClose); - this.PGpanelBtm.Controls.Add(this.btnCancel); - this.PGpanelBtm.Dock = System.Windows.Forms.DockStyle.Bottom; - this.PGpanelBtm.Location = new System.Drawing.Point(0, 560); - this.PGpanelBtm.Name = "PGpanelBtm"; - this.PGpanelBtm.Size = new System.Drawing.Size(614, 68); - this.PGpanelBtm.TabIndex = 0; - // - // btnSave - // - this.btnSave.Dock = System.Windows.Forms.DockStyle.Right; - this.btnSave.Enabled = false; - this.btnSave.Location = new System.Drawing.Point(164, 0); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(75, 68); - this.btnSave.TabIndex = 6; - this.btnSave.Text = "Save"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Visible = false; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // btnDelete - // - this.btnDelete.Dock = System.Windows.Forms.DockStyle.Right; - this.btnDelete.Enabled = false; - this.btnDelete.Location = new System.Drawing.Point(239, 0); - this.btnDelete.Name = "btnDelete"; - this.btnDelete.Size = new System.Drawing.Size(75, 68); - this.btnDelete.TabIndex = 5; - this.btnDelete.Text = "Delete"; - this.btnDelete.UseVisualStyleBackColor = true; - this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); - // - // btnReset - // - this.btnReset.Dock = System.Windows.Forms.DockStyle.Right; - this.btnReset.Enabled = false; - this.btnReset.Location = new System.Drawing.Point(314, 0); - this.btnReset.Name = "btnReset"; - this.btnReset.Size = new System.Drawing.Size(75, 68); - this.btnReset.TabIndex = 4; - this.btnReset.Text = "Reset"; - this.btnReset.UseVisualStyleBackColor = true; - this.btnReset.Click += new System.EventHandler(this.btnReset_Click); - // - // btnSaveAs - // - this.btnSaveAs.Dock = System.Windows.Forms.DockStyle.Right; - this.btnSaveAs.Enabled = false; - this.btnSaveAs.Location = new System.Drawing.Point(389, 0); - this.btnSaveAs.Name = "btnSaveAs"; - this.btnSaveAs.Size = new System.Drawing.Size(75, 68); - this.btnSaveAs.TabIndex = 3; - this.btnSaveAs.Text = "Save As"; - this.btnSaveAs.UseVisualStyleBackColor = true; - this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click); - // - // lblPGItem - // - this.lblPGItem.AutoSize = true; - this.lblPGItem.Location = new System.Drawing.Point(39, 20); - this.lblPGItem.Name = "lblPGItem"; - this.lblPGItem.Size = new System.Drawing.Size(46, 17); - this.lblPGItem.TabIndex = 2; - this.lblPGItem.Text = "label1"; - this.lblPGItem.Visible = false; - // - // btnSaveClose - // - this.btnSaveClose.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnSaveClose.Dock = System.Windows.Forms.DockStyle.Right; - this.btnSaveClose.Enabled = false; - this.btnSaveClose.Location = new System.Drawing.Point(464, 0); - this.btnSaveClose.Name = "btnSaveClose"; - this.btnSaveClose.Size = new System.Drawing.Size(75, 68); - this.btnSaveClose.TabIndex = 1; - this.btnSaveClose.Text = "Save and Close"; - this.btnSaveClose.UseVisualStyleBackColor = true; - this.btnSaveClose.Click += new System.EventHandler(this.btnSaveClose_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Dock = System.Windows.Forms.DockStyle.Right; - this.btnCancel.Location = new System.Drawing.Point(539, 0); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 68); - this.btnCancel.TabIndex = 0; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // PG - // - this.PG.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.PG.Font = new System.Drawing.Font("Arial Rounded MT Bold", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.PG.LineColor = System.Drawing.SystemColors.ControlDark; - this.PG.Location = new System.Drawing.Point(0, 155); - this.PG.Name = "PG"; - this.PG.Size = new System.Drawing.Size(614, 405); - this.PG.TabIndex = 1; - // - // pnlFormatList - // - this.pnlFormatList.Controls.Add(this.tbUCFSummary); - this.pnlFormatList.Controls.Add(this.btnDetails); - this.pnlFormatList.Controls.Add(this.lblSummary); - this.pnlFormatList.Controls.Add(this.lblDerivedFrom); - this.pnlFormatList.Controls.Add(this.lblDerFrom); - this.pnlFormatList.Controls.Add(this.cbxFormatList); - this.pnlFormatList.Controls.Add(this.lblFormatList); - this.pnlFormatList.Dock = System.Windows.Forms.DockStyle.Top; - this.pnlFormatList.Location = new System.Drawing.Point(0, 0); - this.pnlFormatList.Name = "pnlFormatList"; - this.pnlFormatList.Size = new System.Drawing.Size(614, 149); - this.pnlFormatList.TabIndex = 3; - // - // tbUCFSummary - // - this.tbUCFSummary.BackColor = System.Drawing.SystemColors.Control; - this.tbUCFSummary.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.tbUCFSummary.Location = new System.Drawing.Point(33, 120); - this.tbUCFSummary.Name = "tbUCFSummary"; - this.tbUCFSummary.Size = new System.Drawing.Size(485, 15); - this.tbUCFSummary.TabIndex = 7; - // - // btnDetails - // - this.btnDetails.Location = new System.Drawing.Point(539, 112); - this.btnDetails.Name = "btnDetails"; - this.btnDetails.Size = new System.Drawing.Size(63, 33); - this.btnDetails.TabIndex = 6; - this.btnDetails.Text = "Details"; - this.btnDetails.UseVisualStyleBackColor = true; - this.btnDetails.Visible = false; - this.btnDetails.Click += new System.EventHandler(this.btnDetails_Click); - // - // lblSummary - // - this.lblSummary.AutoSize = true; - this.lblSummary.Location = new System.Drawing.Point(5, 96); - this.lblSummary.Name = "lblSummary"; - this.lblSummary.Size = new System.Drawing.Size(71, 17); - this.lblSummary.TabIndex = 4; - this.lblSummary.Text = "Summary:"; - this.lblSummary.Visible = false; - // - // lblDerivedFrom - // - this.lblDerivedFrom.AutoSize = true; - this.lblDerivedFrom.Location = new System.Drawing.Point(33, 75); - this.lblDerivedFrom.Name = "lblDerivedFrom"; - this.lblDerivedFrom.Size = new System.Drawing.Size(0, 17); - this.lblDerivedFrom.TabIndex = 3; - this.lblDerivedFrom.Visible = false; - // - // lblDerFrom - // - this.lblDerFrom.AutoSize = true; - this.lblDerFrom.Location = new System.Drawing.Point(3, 52); - this.lblDerFrom.Name = "lblDerFrom"; - this.lblDerFrom.Size = new System.Drawing.Size(97, 17); - this.lblDerFrom.TabIndex = 2; - this.lblDerFrom.Text = "Derived From:"; - this.lblDerFrom.Visible = false; - // - // cbxFormatList - // - this.cbxFormatList.FormattingEnabled = true; - this.cbxFormatList.Location = new System.Drawing.Point(23, 25); - this.cbxFormatList.Name = "cbxFormatList"; - this.cbxFormatList.Size = new System.Drawing.Size(550, 24); - this.cbxFormatList.Sorted = true; - this.cbxFormatList.TabIndex = 1; - this.cbxFormatList.SelectedIndexChanged += new System.EventHandler(this.cbxFormatList_SelectedIndexChanged); - // - // lblFormatList - // - this.lblFormatList.AutoSize = true; - this.lblFormatList.Location = new System.Drawing.Point(5, 4); - this.lblFormatList.Name = "lblFormatList"; - this.lblFormatList.Size = new System.Drawing.Size(115, 17); - this.lblFormatList.TabIndex = 0; - this.lblFormatList.Text = "Selected Format:"; - // - // frmUCF - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(614, 628); - this.Controls.Add(this.pnlFormatList); - this.Controls.Add(this.PG); - this.Controls.Add(this.PGpanelBtm); - this.Name = "frmUCF"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "User Control of Format"; - this.Load += new System.EventHandler(this.frmUCF_Load); - this.PGpanelBtm.ResumeLayout(false); - this.PGpanelBtm.PerformLayout(); - this.pnlFormatList.ResumeLayout(false); - this.pnlFormatList.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel PGpanelBtm; - private System.Windows.Forms.Button btnSaveClose; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.PropertyGrid PG; - private System.Windows.Forms.Panel pnlFormatList; - private System.Windows.Forms.Label lblFormatList; - private System.Windows.Forms.ComboBox cbxFormatList; - private System.Windows.Forms.Label lblPGItem; - private System.Windows.Forms.Button btnSaveAs; - private System.Windows.Forms.Button btnReset; - private System.Windows.Forms.Button btnDelete; - private System.Windows.Forms.Label lblDerivedFrom; - private System.Windows.Forms.Label lblDerFrom; - private System.Windows.Forms.Button btnDetails; - private System.Windows.Forms.Label lblSummary; - private System.Windows.Forms.TextBox tbUCFSummary; - private System.Windows.Forms.Button btnSave; - - } -} - diff --git a/PROMS/VEPROMS User Interface/frmUCF.resx b/PROMS/VEPROMS User Interface/frmUCF.resx deleted file mode 100644 index 7080a7d1..00000000 --- a/PROMS/VEPROMS User Interface/frmUCF.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 7f515749..aef07dd5 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -269,8 +269,6 @@ namespace VEPROMS return true; } - private E_UCFImportOptions _UCFImportOptionsFromSettings; - public frmVEPROMS() { // The following Try/Catch was added to protect against a problem seen by Kathy and Michelle @@ -724,7 +722,7 @@ namespace VEPROMS } else { - dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this, (E_UCFImportOptions)Properties.Settings.Default.UCFImportOpt);//Added frmVEPROMS Parameter + dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this);//Added frmVEPROMS Parameter dlg.ShowDialog(this); MySessionInfo.CheckInItem(ownerid); @@ -778,7 +776,7 @@ namespace VEPROMS else { - dlgExportImport dlg = new dlgExportImport("Import", dvi, this, (E_UCFImportOptions)Properties.Settings.Default.UCFImportOpt);//Added frmVEPROMS Parameter + dlgExportImport dlg = new dlgExportImport("Import", dvi, this);//Added frmVEPROMS Parameter dlg.MyNewProcedure = null; dlg.ExternalTransitionItem = null; dlg.ShowDialog(this); @@ -820,7 +818,7 @@ namespace VEPROMS else { - dlgExportImport dlg = new dlgExportImport("Export", pi, this, (E_UCFImportOptions)0);//Added frmVEPROMS Parameter + dlgExportImport dlg = new dlgExportImport("Export", pi, this);//Added frmVEPROMS Parameter dlg.ShowDialog(this); MySessionInfo.CheckInItem(ownerid); @@ -2010,10 +2008,9 @@ namespace VEPROMS private DevComponents.DotNetBar.ButtonItem btnAdministrativeTools; private DevComponents.DotNetBar.ButtonItem btnSecurity; private DevComponents.DotNetBar.ButtonItem btnFormats; - private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormats; - private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsExport; - private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsImport; + private DevComponents.DotNetBar.ButtonItem btnGeneralTools; + private TabItemsToClose _MyCloseTabList = new TabItemsToClose(); public TabItemsToClose MyCloseTabList @@ -2203,45 +2200,15 @@ namespace VEPROMS InitializeSecurity(); UpdateUser(); - //btnSecurity = new ButtonItem("btnSecurity", "Security"); // C2019-002: move security & format items into submenus - //btnFormats = new ButtonItem("btnFormats", "Formats"); - //btnAdmin.SubItems.Add(btnSecurity); - //btnAdmin.SubItems.Add(btnFormats); - //btnUserControlOfFormats = new ButtonItem("btnUserControlOfFormats", "User Control of Formats"); - //btnFormats.SubItems.Add(btnUpdateFormats); - //btnFormats.SubItems.Add(btnUserControlOfFormats); - //btnUserControlOfFormats.Click += new EventHandler(btnUserControlOfFormats_Click); - //btnUserControlOfFormatsExport = new ButtonItem("btnUserControlOfFormatsExport", "Export User Control of Formats"); - //btnFormats.SubItems.Add(btnUserControlOfFormatsExport); - //btnUserControlOfFormatsExport.Click += new EventHandler(btnUserControlOfFormatsExport_Click); - //btnUserControlOfFormatsImport = new ButtonItem("btnUserControlOfFormatsImport", "Import User Control of Formats"); - //btnFormats.SubItems.Add(btnUserControlOfFormatsImport); - //btnUserControlOfFormatsImport.Click += new EventHandler(btnUserControlOfFormatsImport_Click); - //btnManageSecurity = new ButtonItem("btnManageSecurity", "Manage Security"); - //btnSecurity.SubItems.Add(btnManageSecurity); - //btnManageSecurity.Click += new EventHandler(btnManageSecurity_Click); - - btnSecurity = new ButtonItem("btnSecurity", "Security"); // C2019-002: move security & format items into submenus btnFormats = new ButtonItem("btnFormats", "Formats"); btnAdmin.SubItems.Add(btnSecurity); // btnAdmin.SubItems.Add(btnFormats); // C2024 - 041 remove from Admin(V button) menu btnAdmin.SubItems.Add(btnUpdateFormats); // C2024 - 041 remove from Admin(V button) menu - btnUserControlOfFormats = new ButtonItem("btnUserControlOfFormats", "User Control of Formats"); - //btnFormats.SubItems.Add(btnUpdateFormats); - //btnFormats.SubItems.Add(btnUserControlOfFormats); // C2024-041 remove from Admin (V button) menu - btnUserControlOfFormats.Click += new EventHandler(btnUserControlOfFormats_Click); - btnUserControlOfFormatsExport = new ButtonItem("btnUserControlOfFormatsExport", "Export User Control of Formats"); - //btnFormats.SubItems.Add(btnUserControlOfFormatsExport); // C2024-041 remove from Admin (V button) menu - btnUserControlOfFormatsExport.Click += new EventHandler(btnUserControlOfFormatsExport_Click); - btnUserControlOfFormatsImport = new ButtonItem("btnUserControlOfFormatsImport", "Import User Control of Formats"); - //btnFormats.SubItems.Add(btnUserControlOfFormatsImport); // C2024-041 remove from Admin (V button) menu - btnUserControlOfFormatsImport.Click += new EventHandler(btnUserControlOfFormatsImport_Click); btnManageSecurity = new ButtonItem("btnManageSecurity", "Manage Security"); btnSecurity.SubItems.Add(btnManageSecurity); btnManageSecurity.Click += new EventHandler(btnManageSecurity_Click); - //added by jcb: menu item to reset security requires password to implement btnResetSecurity = new ButtonItem("btnResetSecurity", "Reset Security"); btnSecurity.SubItems.Add(btnResetSecurity); @@ -2264,8 +2231,6 @@ namespace VEPROMS // C2025-031 added tool tip messages this.superTooltip1.SetSuperTooltip(btnManageSecurity, new SuperTooltipInfo("Manage Security", "", "Add, Modify, and Delete PROMS User Access", null, null, eTooltipColor.Gray)); - // remove commented out line below when User Control of Formats code is deleted - //this.superTooltip1.SetSuperTooltip(btnUserControlOfFormats, new SuperTooltipInfo("User Control Of Formats", null, null, null, null, eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(btnResetSecurity, new SuperTooltipInfo("Reset Security", "", "WARNING this will \nREMOVE ALL PROMS USERS and Reset to the\nOriginal Volian Defaults", null, null, eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(btnAdministrativeTools, new SuperTooltipInfo("Administrative Tools", "", "Open the PROMS Adminstration Tools Window", null, null, eTooltipColor.Gray)); this.superTooltip1.SetSuperTooltip(btnUpdateFormats, new SuperTooltipInfo("Update Formats", "", "Install New Formats \n or Re-Install Formats", null, null, eTooltipColor.Gray)); @@ -2307,9 +2272,6 @@ namespace VEPROMS bool isVisible = MyUserInfo.IsAdministrator(); - btnUserControlOfFormats.Visible = isVisible; - btnUserControlOfFormatsExport.Visible = isVisible; - btnUserControlOfFormatsImport.Visible = isVisible; btnManageSecurity.Visible = isVisible; btnUpdateFormats.Visible = isVisible; btnResetSecurity.Visible = isVisible; @@ -3154,32 +3116,6 @@ namespace VEPROMS } } - void btnUserControlOfFormats_Click(object sender, EventArgs e) - { - frmUCF frmucf = new frmUCF(); - DialogResult dr = frmucf.ShowDialog(this); - } - - void btnUserControlOfFormatsExport_Click(object sender, EventArgs e) - { - DocVersionInfo dvi = null; - - dlgExportImport dlg = new dlgExportImport("Export Formats", dvi, this, (E_UCFImportOptions)0); - dlg.MyNewProcedure = null; - dlg.ExternalTransitionItem = null; - dlg.ShowDialog(this); - } - - void btnUserControlOfFormatsImport_Click(object sender, EventArgs e) - { - DocVersionInfo dvi = null; - - dlgExportImport dlg = new dlgExportImport("Import Formats", dvi, this, (E_UCFImportOptions)0); - dlg.MyNewProcedure = null; - dlg.ExternalTransitionItem = null; - dlg.ShowDialog(this); - } - void btnManageSecurity_Click(object sender, EventArgs e) { dlgManageSecurity dlg = new dlgManageSecurity(); @@ -5397,3 +5333,11 @@ namespace VEPROMS } } + + + + + + + + diff --git a/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs index 004c33c7..d5617806 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs @@ -213,14 +213,7 @@ namespace VEPROMS.CSLA.Library [TypeConverter(typeof(ExpandableObjectConverter))] public class Flags { - private bool? _CheckOffUCF; - [DisplayName("UCF CheckOffs")] - [Description("Additional UCF Check Offs and Sign Offs")] - public bool? CheckOffUCF - { - get { return _CheckOffUCF; } - set { _CheckOffUCF = value; } - } + private bool? _PartialStepCompression; [DisplayName("Partial Step Compression")] [Description("Automatically compress last sub-steps to fit on page")] @@ -272,41 +265,7 @@ namespace VEPROMS.CSLA.Library } #endregion ReplaceStrData #region ReplaceStr - [Flags] - public enum E_ReplaceFlagsUCF : uint - { - High = 0x0001, // Do ReplaceWords in HIGH LEVEL STEPS - RNO = 0x0002, // Do ReplaceWords in RNOS - Caution = 0x0004, // Do ReplaceWords in CAUTIONS - Note = 0x0008, // Do ReplaceWords in NOTES - Table = 0x0010, // Do ReplaceWords in TABLES - Substep = 0x0020, // Do ReplaceWords in SUBSTEPS - Attach = 0x0040, // Do ReplaceWords in ATTACHMENTS - Bkgd = 0x0080, // Do ReplaceWords in BACKGROUNDS - DiffUnit = 0x0100, // Do ReplaceWords ONLY for different UNIT # - TOC = 0x0200, // Do in auto table-of-contents - StatTree = 0x0400, - HLSSetpnt = 0x0800, // Do ReplaceWords in HighLevelStep SETPoiNTs - Trans = 0x1000, // Do ReplaceWords in TRANSITIONS - Setpoint = 0x2000, // Do ReplaceWords in SETPOINTS - // Case Sensitivity Flags - default is off (Case Sensitive Replace) - CaseInsens = 0x0000C000, // Do ReplaceWords for all words thatmatch, regardless of case, - // and replace with the ReplaceWith string as is - // B2019-022: do not support CaseInsensFirst & CaseInsensAll - there is no supporting replace word code: - //CaseInsensFirst = 0x4000, // Do ReplaceWords for all words thatexactly match the ReplaceWord, - // except the case of the first character may be different - //CaseInsensAll = 0x8000, // Do ReplaceWords for all words that match the ReplaceWord, regardless of case - - Partials = 0x10000, // Do replace even on partial matches - Plackeep = 0x20000, // Do replace in PlaceKeepers - InSecTitle = 0x40000, - BeforeTrans = 0x80000, // Only do replace if the string occurs immediately before a transition. - BeforeList = 0x100000, // C2021-045 Only if the text ends with a colon ":" - PageList = 0x200000, // F2021-053 Do replace words for PageList items that are ROs - FirstWord = 0x400000, // C2021-056 Do only if is the first word in the text - NotInRO = 0x800000 // B2022-015 BNPPalr: Determine whether RO text should have Replace Words applied - } [Serializable] [TypeConverter(typeof(ExpandableObjectConverter))] public class ReplaceStr @@ -319,15 +278,7 @@ namespace VEPROMS.CSLA.Library get { return _State; } set { _State = value; } } - private E_ReplaceFlagsUCF _Flag; - [Editor(typeof(FlagEnumUIEditor), typeof(System.Drawing.Design.UITypeEditor))] - [XmlAttribute("Flag")] - [DisplayName("Flags (Use In)")] // Note that [Description] is not used in collection items (that use collection editor) - public E_ReplaceFlagsUCF Flag - { - get { return (E_ReplaceFlagsUCF)_Flag; } - set { _Flag = value; } - } + private string _ReplaceWord; [XmlAttribute("ReplaceWord")] [DisplayName("Replace Word")] @@ -341,7 +292,6 @@ namespace VEPROMS.CSLA.Library } } private string _ReplaceWith; - [Editor(typeof(RtfEditor), typeof(System.Drawing.Design.UITypeEditor))] [XmlAttribute("ReplaceWith")] [DisplayName("With")] diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs index eefa7dfe..fff93e8c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs @@ -1755,165 +1755,6 @@ namespace VEPROMS.CSLA.Library #endregion - #region UCF Fix FormatId After Import - private class FixFormatIDAfterImportCriteria - { - private string _DocVersionList; - public string DocVersionList - { - get { return _DocVersionList; } - set { _DocVersionList = value; } - } - private int _OldFormatID; - public int OldFormatID - { - get { return _OldFormatID; } - set { _OldFormatID = value; } - } - private int _NewFormatID; - public int NewFormatID - { - get { return _NewFormatID; } - set { _NewFormatID = value; } - } - public FixFormatIDAfterImportCriteria(string dvlst, int oldfid, int newfid) - { - _DocVersionList = dvlst; - _OldFormatID = oldfid; - _NewFormatID = newfid; - } - } - - private void DataPortal_Fetch(FixFormatIDAfterImportCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_UpdateVersionFormatForUCF"; - cm.Parameters.AddWithValue("@VersionList", criteria.DocVersionList); - cm.Parameters.AddWithValue("@OldFormatID", criteria.OldFormatID); - cm.Parameters.AddWithValue("@NewFormatID", criteria.NewFormatID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentInfo contentInfo = new ContentInfo(dr); - this.Add(contentInfo); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - Database.LogException("FixFormatIDAfterImport.DataPortal_Fetch", ex); - throw new DbCslaException("FixFormatIDAfterImport.DataPortal_Fetch", ex); - } - } - - public static ContentInfoList FixFormatIDAfterImport(string dvlst, int oldfid, int newfid) - { - try - { - ContentInfoList tmp = DataPortal.Fetch(new FixFormatIDAfterImportCriteria(dvlst, oldfid, newfid)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentInfoList.FixFormatIDAfterImport", ex); - } - } - - #endregion - - #region UCF Clear Overwridden Formats - private class ClearOverrideFormatsByFolderCriteria - { - public ClearOverrideFormatsByFolderCriteria(int folderID, int? formatID, int? newformatID) - { - _FormatID = formatID; - _FolderID = folderID; - _NewFormatID = newformatID; - } - private int? _FormatID; - public int? FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - private int? _NewFormatID; - public int? NewFormatID - { - get { return _NewFormatID; } - set { _NewFormatID = value; } - } - private int _FolderID; - public int FolderID - { - get { return _FolderID; } - set { _FolderID = value; } - } - } - - private void DataPortal_Fetch(ClearOverrideFormatsByFolderCriteria criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_ClearOverrideFormatsByFolder"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - if (criteria.FormatID == null) - cm.Parameters.AddWithValue("@FormatID", DBNull.Value); - else - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - if (criteria.NewFormatID == null) - cm.Parameters.AddWithValue("@NewFormatID", DBNull.Value); - else - cm.Parameters.AddWithValue("@NewFormatID", criteria.NewFormatID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentInfo contentInfo = new ContentInfo(dr); - this.Add(contentInfo); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - Database.LogException("ClearOverrideFormatsByFolderCriteria.DataPortal_Fetch", ex); - throw new DbCslaException("ClearOverrideFormatsByFolderCriteria.DataPortal_Fetch", ex); - } - } - - public static ContentInfoList ClearOverrideFormatsByFolder(int folderID, int? formatID, int? newformatID) - { - try - { - ContentInfoList tmp = DataPortal.Fetch(new ClearOverrideFormatsByFolderCriteria(folderID, formatID, newformatID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentInfoList.ClearOverrideFormatsByFolder", ex); - } - } private class ClearOverrideFormatsByDocVersionCriteria { @@ -2077,7 +1918,6 @@ namespace VEPROMS.CSLA.Library } } - #endregion #region Enhanced diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs index b8798d29..466f6338 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayText.cs @@ -2153,7 +2153,7 @@ namespace VEPROMS.CSLA.Library // return Text; //} #endregion - private static Dictionary dicReplaceRegex = new Dictionary(); + private static Dictionary dicReplaceRegex = new Dictionary(); private static bool? _ProcessReplaceWords; public static bool ProcessReplaceWords { @@ -2178,7 +2178,7 @@ namespace VEPROMS.CSLA.Library // F2021-053: BNPP Alarm - need ability to have super/sub scripts in the text of Alarm Tables (ROs). // if doing replace words for Page List items, the current item is not a step, use _DoReplWordInPageList flags this if (_MyItemInfo.MyContent.Type < 20000 && !_DoReplWordInPageList) return Text; // for now only replace in steps. - FormatConfig.ReplaceStrData rsl = _MyFormat.PlantFormat.UCFandOrigReplaceStrData; + ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; if (rsl.Count == 1 && (rsl[0].ReplaceWord == null || rsl[0].ReplaceWord == "")) return Text; // F2021-093: Handle partials first and then plain replace words. Need to do this so that the words don't get processed by plain replace @@ -2193,15 +2193,15 @@ namespace VEPROMS.CSLA.Library // Loop through text looking for words to be replaced Dictionary shouldReplace = new Dictionary(); //int profileDepth = ProfileTimer.Push(">>>> DoReplaceWords2.ForLoop"); - foreach (FormatConfig.ReplaceStr rs in rsl) + foreach (ReplaceStr rs in rsl) { - bool dopartial = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.Partials) == E_ReplaceFlags.Partials; - if (!dopartial) // F2021-093: Partials moved into their own method and done first + bool dopartial = (rs.Flag & E_ReplaceFlags.Partials) == E_ReplaceFlags.Partials; // from pre-UCF + if (!dopartial) // F2021-093: Partials moved into their own method and done first { - bool onlyDoList = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.BeforeList) == E_ReplaceFlags.BeforeList; // C2021-045 - bool onlyIfFirstWord = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.FirstWord) == E_ReplaceFlags.FirstWord; // C2021-056 - bool doInPagelist = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.PageList) == E_ReplaceFlags.PageList; // B2021-132 - //B2021-132 only do replacewords in paglist if the replaceword pagelist flag is set + bool onlyDoList = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.BeforeList) == E_ReplaceFlags.BeforeList; // C2021-045, C2025-022 remove UFC + bool onlyIfFirstWord = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.FirstWord) == E_ReplaceFlags.FirstWord; // C2021-056 + bool doInPagelist = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.PageList) == E_ReplaceFlags.PageList; // B2021-132 + //B2021-132 only do replacewords in paglist if the replaceword pagelist flag is set if (_DoReplWordInPageList && !doInPagelist) continue; // note that the order of this check is important. Check in this order... @@ -2228,7 +2228,9 @@ namespace VEPROMS.CSLA.Library { if (!dicReplaceRegex.ContainsKey(rs)) { - RegexOptions myOptions = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; + RegexOptions myOptions = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; + //RegexOptions myOptions = (E_ReplaceFlags)(rs.Flag) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; + //RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; //int profileDepth3 = ProfileTimer.Push(">>>> DoReplaceWords2.BuildMatch"); // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is //RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline; @@ -2268,18 +2270,18 @@ namespace VEPROMS.CSLA.Library // F2021-093: separate out partial replace words so that they can all be done before normal replace words. Partials read in the 'repword', use // it as-is as a dotnet regular expression to do replacement. Aside from the dotnet regular expression process, the rest of this // code is similar to plain regular expressions, in terms of processing flags for which steps, etc. - private string DoReplacePartials(string Text, FormatConfig.ReplaceStrData rsl) + private string DoReplacePartials(string Text, ReplaceStrList rsl) { - Dictionary partialReplaceList = new Dictionary(); + Dictionary partialReplaceList = new Dictionary(); Dictionary shouldReplace = new Dictionary(); - foreach (FormatConfig.ReplaceStr rs in rsl) + foreach (ReplaceStr rs in rsl) { - bool dopartial = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.Partials) == E_ReplaceFlags.Partials; + bool dopartial = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.Partials) == E_ReplaceFlags.Partials; if (dopartial) { - bool onlyDoList = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.BeforeList) == E_ReplaceFlags.BeforeList; // C2021-045 - bool onlyIfFirstWord = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.FirstWord) == E_ReplaceFlags.FirstWord; // C2021-056 - bool doInPagelist = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.PageList) == E_ReplaceFlags.PageList; // B2021-132 + bool onlyDoList = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.BeforeList) == E_ReplaceFlags.BeforeList; // C2021-045 + bool onlyIfFirstWord = (E_ReplaceFlags)(rs.Flag) == E_ReplaceFlags.FirstWord; // C2021-056 + bool doInPagelist = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.PageList) == E_ReplaceFlags.PageList; // B2021-132 //B2021-132 only do replacewords in paglist if the replaceword pagelist flag is set if (_DoReplWordInPageList && !doInPagelist) continue; @@ -2304,7 +2306,7 @@ namespace VEPROMS.CSLA.Library { if (!dicReplaceRegex.ContainsKey(rs)) { - RegexOptions myOptions = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; + RegexOptions myOptions = (E_ReplaceFlags)(rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; dicReplaceRegex.Add(rs, new Regex(rs.ReplaceWord, myOptions)); } try @@ -2320,7 +2322,7 @@ namespace VEPROMS.CSLA.Library Text = Text.Replace(@"\xA0", @"\u160?"); //replace hard space try { - foreach (FormatConfig.ReplaceStr prs in partialReplaceList.Keys) + foreach (ReplaceStr prs in partialReplaceList.Keys) Text = partialReplaceList[prs].Replace(Text, prs.ReplaceWith); //if (partialReplaceList.Count>0) GC.Collect(); // microsoft had a memory leak in regular expression code - this REALLY slows it down though } @@ -2486,7 +2488,7 @@ namespace VEPROMS.CSLA.Library _Font = font; _MyItemInfo = myItemInfo; } - public void Add(Regex myRegEx, FormatConfig.ReplaceStr myWord) + public void Add(Regex myRegEx, ReplaceStr myWord) { MatchCollection myMatches = myRegEx.Matches(_Text); foreach (Match myMatch in myMatches) @@ -2529,7 +2531,7 @@ namespace VEPROMS.CSLA.Library } return false; } - public void Add(Match myMatch, FormatConfig.ReplaceStr myWord) + public void Add(Match myMatch, ReplaceStr myWord) { // If one already exists for this location, then don't add another. if (ContainsKey(myMatch.Index)) return; @@ -2563,12 +2565,12 @@ namespace VEPROMS.CSLA.Library { // B2022-015 BNPPalr: Determine whether RO text should have Replace Words applied. InLinkAndNotInRoFlag checks // for flag on replace word item & checks that it is within and RO link - bool InLinkAndNotInRoFlag = ((foundMatch.MyWord.Flag & FormatConfig.E_ReplaceFlagsUCF.NotInRO) != 0) ? VerifyWithinLink(text, foundMatch, offset) : false; + bool InLinkAndNotInRoFlag = ((foundMatch.MyWord.Flag & E_ReplaceFlags.NotInRO) != 0) ? VerifyWithinLink(text, foundMatch, offset) : false; if (!InLinkAndNotInRoFlag && VerifyNoHardSpace(text, foundMatch, offset) && VerifyNoLink(text, foundMatch, offset)) { //if(offset != 0 || foundMatch.MyMatch.Index != 0 || !foundMatch.MyWord.ReplaceWith.StartsWith(@"{\par}")) //{ - if (((foundMatch.MyWord.Flag & FormatConfig.E_ReplaceFlagsUCF.DiffUnit) == 0) || DiffUnit(foundMatch.MyWord.ReplaceWord, _MyItemInfo, "UNIT ")) + if (((foundMatch.MyWord.Flag & E_ReplaceFlags.DiffUnit) == 0) || DiffUnit(foundMatch.MyWord.ReplaceWord, _MyItemInfo, "UNIT ")) { string with = foundMatch.MyWord.ReplaceWith; if (offset == 0 && with.StartsWith(@"{\par}")) @@ -2723,13 +2725,13 @@ namespace VEPROMS.CSLA.Library get { return _MyMatch; } set { _MyMatch = value; } } - private FormatConfig.ReplaceStr _MyWord; - public FormatConfig.ReplaceStr MyWord + private ReplaceStr _MyWord; + public ReplaceStr MyWord { get { return _MyWord; } set { _MyWord = value; } } - public FoundMatch(Match myMatch, FormatConfig.ReplaceStr myWord) + public FoundMatch(Match myMatch, ReplaceStr myWord) { _MyMatch = myMatch; _MyWord = myWord; diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs index a4e5383a..28ba06bc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/FormatExt.cs @@ -594,70 +594,7 @@ public partial class FormatInfo : IFormatOrFormatInfo throw new DbCslaException("FormatInfo.DataPortal_Fetch", ex); } } - // Get format data, but do not resolve the 'Data' and 'Genmac' fields, i.e. keep empty if they are - // empty. - public static FormatInfo GetFormatNoUCFByFormatID(int formatID) - { - try - { - FormatInfo tmp = DataPortal.Fetch(new FormatIDNoUCFCriteria(formatID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up FormatInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FormatInfo.GetFormatNoUCFByFormatID", ex); - } - } - protected class FormatIDNoUCFCriteria - { - private int _FormatID; - public int FormatID { get { return _FormatID; } } - public FormatIDNoUCFCriteria(int formatID) - { - _FormatID = formatID; - } - } - private void DataPortal_Fetch(FormatIDNoUCFCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFormatNoUCF"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("FormatInfo.DataPortal_Fetch", ex); - } - } + #region PlantFormat [NonSerialized] private PlantFormat _PlantFormat; diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 9caea004..cc68f7d5 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -6067,7 +6067,7 @@ namespace VEPROMS.CSLA.Library // To determine if the section has a checkoff... // Section won't have checkoffs if there is no checkofflist, or ProcData pd = ActiveFormat.PlantFormat.FormatData.ProcData; - int maxindx = pd.CheckOffUCF ? pd.CheckOffData.CheckOffList.MaxIndex : pd.CheckOffData.CheckOffList.MaxIndexNoInherit; + int maxindx = pd.CheckOffData.CheckOffList.MaxIndexNoInherit; if (pd.CheckOffData == null || pd.CheckOffData.CheckOffList == null || maxindx <= 0) return false; if (pd.CheckOffData.CheckOffHeaderList == null || pd.CheckOffData.CheckOffHeaderList.MaxIndex <= 1) return true; //if (pd.CheckOffData == null || pd.CheckOffData.CheckOffHeaderList == null || pd.CheckOffData.CheckOffHeaderList.Count <= 1) return false; @@ -6099,7 +6099,7 @@ namespace VEPROMS.CSLA.Library private int SectionDefaultCheckOffIndex() { ProcData pd = ActiveFormat.PlantFormat.FormatData.ProcData; - int maxindx = pd.CheckOffUCF ? pd.CheckOffData.CheckOffList.MaxIndex : pd.CheckOffData.CheckOffList.MaxIndexNoInherit; + int maxindx = pd.CheckOffData.CheckOffList.MaxIndexNoInherit; if (pd.CheckOffData != null && pd.CheckOffData.CheckOffList != null && maxindx == 2) return 0; // if only two items, first is macro - use it. SectionConfig sc = ActiveSection.MyConfig as SectionConfig; return sc.Section_CheckoffListSelection; @@ -6111,23 +6111,7 @@ namespace VEPROMS.CSLA.Library if (!SectionHasCheckOffs()) return null; int stpCoIndx = CheckOffIndex(); // this step has a checkoff defined if (stpCoIndx == -1) return null; - if (stpCoIndx > 1) - { - if (ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffUCF && stpCoIndx >= 100) - { - // get index, if greater than 100, store that - otherwise store index down list. - // if this format does not have ucf signoffs, indx is just the selected index from the combo box. - foreach (CheckOff co in ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList) - { - if (stpCoIndx == co.Index) - { - stpCoIndx = (int)co.Index; - break; - } - } - } - return ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList[stpCoIndx]; // DO override of CheckOffList[] to get ucf - } + int sectCoIndx = SectionDefaultCheckOffIndex(); // no checkoff on step, see if there is a section default. if (sectCoIndx == -1) return null; if ((ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffOnHLSOnly && IsHigh) @@ -6161,7 +6145,7 @@ namespace VEPROMS.CSLA.Library get { ProcData pd = ActiveFormat.PlantFormat.FormatData.ProcData; - int maxindx = pd.CheckOffUCF ? pd.CheckOffData.CheckOffList.MaxIndex : pd.CheckOffData.CheckOffList.MaxIndexNoInherit; + int maxindx = pd.CheckOffData.CheckOffList.MaxIndexNoInherit; if (pd.CheckOffData != null && pd.CheckOffData.CheckOffList != null && maxindx == 2 && pd.CheckOffData.CheckOffList[0].MenuItem == "Enabled") return true; // if only two items, first is macro - use it. return false; diff --git a/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs b/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs index 27a22aee..5d0a9ff5 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs @@ -249,13 +249,5 @@ namespace VEPROMS.CSLA.Library SupInfoPdfPrint = 2, Merge = 3 } - public enum E_UCFImportOptions : uint - { - Ignore = 0, - LoadNotUsed = 1, - LoadOnlyImported = 2, - LoadUseAll = 3, - LoadForSetOnly = 4 - } #endregion } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 6703b87c..88c6a841 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -36,27 +36,14 @@ namespace VEPROMS.CSLA.Library // User Control of Format allows a PROMS user to make modifications to a very limited set of format settings // Variables in this region are not set in the format files. They are used only in the C# code - // when IgnoreUCF is true, get the original data, i.e. don't apply any UCF changes to it + // when IgnoreUCF is true, get the original data, i.e.don't apply any UCF changes to it private static bool _IgnoreUCF = false; public static bool IgnoreUCF { get { return PlantFormat._IgnoreUCF; } set { PlantFormat._IgnoreUCF = value; } } - // flags that the User Control of Format setting for using additional UCF checkoffs is active - private static bool _DoingUCFCheckOffs = false; - public static bool DoingUCFCheckOffs - { - get { return PlantFormat._DoingUCFCheckOffs; } - set { PlantFormat._DoingUCFCheckOffs = value; } - } - // flags the value that should be used (true/false) for using additional UCF checkoffs (used with DoingUCFCheckOffs) - private static bool _DoingUCFCheckOffsUse = false; - public static bool DoingUCFCheckOffsUse - { - get { return PlantFormat._DoingUCFCheckOffsUse; } - set { PlantFormat._DoingUCFCheckOffsUse = value; } - } + #endregion //User Control of Format (UCF) public static FormatConfig GetFormatConfig(IFormatOrFormatInfo format) { @@ -126,72 +113,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 FormatConfig.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 inoriglist = new List(); // 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: - FormatConfig.ReplaceStr usethisone = null; - bool deleted = false; - // States for replacewords: 0 = no change, -1 deleted, 1 added, 2 modified - if (FormatConfig != null) - { - foreach (FormatConfig.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 FormatConfig.ReplaceStr(); - usethisone.Flag = (FormatConfig.E_ReplaceFlagsUCF)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 (FormatConfig.ReplaceStr ucfrepstr in FormatConfig.PlantFormat.FormatData.ReplaceStrData) - { - if (!inoriglist.Contains(ucfrepstr.ReplaceWord)) - { - FormatConfig.ReplaceStr newone = new FormatConfig.ReplaceStr(); - newone.Flag = (FormatConfig.E_ReplaceFlagsUCF)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. @@ -1579,25 +1500,6 @@ namespace VEPROMS.CSLA.Library return _PSI == null ? _PSI = new PSI(SelectSingleNode("PSI")) : _PSI; } } - private LazyLoad _CheckOffUCF; - public bool CheckOffUCF - { - get - { - // The following line is used in UCF (User Control of Format). - // This needs to be able to control a change in setting in UCF versus its use: - // - This is a special case since the original format, using the value in BaseAll, is always 'false'. And the value - // should never be set in original volian plant format files, if the additional UCF checkoffs are to be used, this must - // be set in the UCF user interface. - if (PlantFormat.DoingUCFCheckOffs) return PlantFormat.DoingUCFCheckOffsUse; - - if (PlantFormat.IgnoreUCF) return LazyLoad(ref _CheckOffUCF, "@CheckOffUCF"); - bool? localvalue = null; // comes to here if in edit or print - use any UCF data before going to original format. - FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat); - if (fc != null) localvalue = fc.PlantFormat.FormatData.Flags.CheckOffUCF; - return localvalue ?? LazyLoad(ref _CheckOffUCF, "@CheckOffUCF"); - } - } // specifies the maxiumn length of the procedure title before PROMS considers to wrap the title // this is used with the {PROCTITLE} PageStyle toekn @@ -1946,53 +1848,9 @@ namespace VEPROMS.CSLA.Library { if (_CheckOffList != null) return _CheckOffList; - // Get a list of checkoffs that should be included: - // if !UseCheckOffUCF (Baseall has it as false. User can change setting in UCF to true) - // if !IgnoreUCF, i.e. use UCF changes, return original lists with only active items (Inactive = false) - // if IgnoreUCF, return original lists with all items - // if UseCheckOffUCF is true use the merged lists from current format and baseall.xml and - // do the same processing for IgnoreUCF described above. - - // UseCheckOffUCF is false or there is no FormatConfig (UCF) data: - FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat); - if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc==null) - { - _CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat); - // B2019-100: If Ignoring the UCF data, just return the entire list. Also, return entire list if there is no UCF data (fc == null) - if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffList; - // If not ignoring UCF settings, only return those that are active - foreach (FormatConfig.CheckOff co in fc.PlantFormat.FormatData.CheckOffList) - { - foreach (CheckOff coo in _CheckOffList) - { - if ((int)coo.Index == Convert.ToInt32(co.Index) && !(bool)co.Active) - { - _CheckOffList.Remove(coo); - break; - } - } - } - return _CheckOffList; - } - // UseCheckOfffUCF is true: // merge the checkoff list from the current format and the checkoff list from the base format _CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat); - CheckOffList retlist2 = new CheckOffList(SelectNodes("../CheckOffDataUCF/CheckOffList/CheckOff"), MyFormat); - if (retlist2 != null && retlist2.Count > 0) foreach (CheckOff co in retlist2) _CheckOffList.Add(co); - if (PlantFormat.IgnoreUCF) return _CheckOffList; - // if applying UCF, then remove those that are inactive: - foreach (FormatConfig.CheckOff co in fc.PlantFormat.FormatData.CheckOffList) - { - foreach (CheckOff coo in _CheckOffList) - { - if ((int)coo.Index == Convert.ToInt32(co.Index) && !(bool)co.Active) - { - _CheckOffList.Remove(coo); - break; - } - } - } return _CheckOffList; } } @@ -2008,77 +1866,13 @@ namespace VEPROMS.CSLA.Library { if (_CheckOffHeaderList != null) return _CheckOffHeaderList; FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat); - if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc == null) - { - _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat); - // Depending on the IgnoreUCF flag, either return this list with UCF Inactive flags set or return the - // list as is. - if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffHeaderList; - // If not ignoring UCF settings, only return those that are active - foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList) - { - foreach (CheckOffHeader coo in _CheckOffHeaderList) - { - if ((int)coo.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active) - { - _CheckOffHeaderList.Remove(coo); - break; - } - } - } - return _CheckOffHeaderList; - } + // merge the checkoff header lists from the current format and the list from the base _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat); - CheckOffHeaderList retlist2 = new CheckOffHeaderList(SelectNodes("../CheckOffDataUCF/CheckOffHeaderList/CheckOffHeader"), MyFormat); - if (retlist2 != null && retlist2.Count > 0) foreach (CheckOffHeader co in retlist2) _CheckOffHeaderList.Add(co); - if (PlantFormat.IgnoreUCF) return _CheckOffHeaderList; - // if applying UCF, then remove those that are inactive. - foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList) - { - foreach (CheckOffHeader cooh in _CheckOffHeaderList) - { - if ((int)cooh.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active) - { - _CheckOffHeaderList.Remove(cooh); - break; - } - } - } return _CheckOffHeaderList; } } - public void CheckOffHeaderListRefresh(bool CheckOffUCF) - { - if (!CheckOffUCF) - { - _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat); - // Depending on the IgnoreUCF flag, either return this list with UCF Inactive flags set or return the - // list as is. - FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat); - if (PlantFormat.IgnoreUCF || fc == null) return; - // If not ignoring UCF settings, only return those that are active - foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList) - { - foreach (CheckOffHeader coo in _CheckOffHeaderList) - { - if ((int)coo.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active) - { - _CheckOffHeaderList.Remove(coo); - break; - } - } - } - return; - } - // if coming from the UCF dialog, then check for the 'ignoreUCF' this will flag whether to only - // merge the checkoff header lists from the current format and the list from the base - CheckOffHeaderList retlist = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat); - CheckOffHeaderList retlist2 = new CheckOffHeaderList(SelectNodes("../CheckOffDataUCF/CheckOffHeaderList/CheckOffHeader"), MyFormat); - if (retlist2 != null && retlist2.Count > 0) foreach (CheckOffHeader co in retlist2) retlist.Add(co); - _CheckOffHeaderList = retlist; - } // This is used with the {INITIALS} pagelist token and will put the word "INITIALS" at the specified pagelist // location for the checkoff column header. Used by Calvert Cliffs (BGEOI and BGESTP formats) diff --git a/PROMS/Volian.Base.Library/RtfEditor.cs b/PROMS/Volian.Base.Library/RtfEditor.cs deleted file mode 100644 index 60e00494..00000000 --- a/PROMS/Volian.Base.Library/RtfEditor.cs +++ /dev/null @@ -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; - } - } -} diff --git a/PROMS/Volian.Base.Library/Volian.Base.Library.csproj b/PROMS/Volian.Base.Library/Volian.Base.Library.csproj index 99e1e025..4d7bbcd7 100644 --- a/PROMS/Volian.Base.Library/Volian.Base.Library.csproj +++ b/PROMS/Volian.Base.Library/Volian.Base.Library.csproj @@ -101,17 +101,10 @@ FrmPopupStatusMessage.cs - - Form - - - frmRtfEdit.cs - - @@ -126,9 +119,6 @@ FrmPopupStatusMessage.cs - - frmRtfEdit.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/DisplayTags.cs b/PROMS/Volian.Controls.Library/DisplayTags.cs index 9761ae85..7621c55c 100644 --- a/PROMS/Volian.Controls.Library/DisplayTags.cs +++ b/PROMS/Volian.Controls.Library/DisplayTags.cs @@ -315,12 +315,6 @@ namespace Volian.Controls.Library if (StepOverRide()) cmbCheckoff.Enabled = false; // Checkoffs already assigned to AER - //// if there are no checkoffs OR - //// if this is a sign-off, the checkoff list is not enabled either (matches 16bit functionality) At some point, we - //// may want to allow them to turn off the checkoff - //if ((fmtdata.ProcData.CheckOffData.CheckOffList == null || fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0) || - // fmtdata.ProcData.CheckOffData.Menu=="Signoff") - // cmbCheckoff.Enabled = false; cbCAS.Enabled = (!CurItemInfo.IsFigure && !CurItemInfo.IsRtfRaw); cbTCAS.Enabled = (!CurItemInfo.IsFigure && !CurItemInfo.IsRtfRaw); //F2022-024 Time Critical Action Summary if (((CurItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || @@ -367,7 +361,7 @@ namespace Volian.Controls.Library if (fmtdata.ProcData.CheckOffData.CheckoffOnSubStepsOnly) _checkoffsAllowed = cmbCheckoff.Enabled = CurItemInfo.IsType("Substep"); - int maxindx = fmtdata.ProcData.CheckOffUCF ? fmtdata.ProcData.CheckOffData.CheckOffList.MaxIndex : fmtdata.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; + int maxindx = fmtdata.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; if (_checkoffsAllowed && !(fmtdata.ProcData.CheckOffData.CheckOffList == null) && !(maxindx == 0)) { CheckOffList chkoffList = fmtdata.ProcData.CheckOffData.CheckOffList; @@ -856,21 +850,6 @@ namespace Volian.Controls.Library MyEditItem.SaveContents(); // set selected index in the step's config. int indx = _CheckOffIndex[cmbCheckoff.SelectedIndex]; // C2020-003 get the non-sorted index from the sorted index - // get index, if greater than 100, store that - otherwise store index down list. - // if this format does not have ucf signoffs, indx is just the selected index from the combo box. - if (CurItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffUCF) - { - // get index, if greater than 100, store that - otherwise store index down list. - // if this format does not have ucf signoffs, indx is just the selected index from the combo mobx. - foreach (CheckOff co in CurItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList) - { - if (cmbCheckoff.SelectedItem == co.MenuItem) - { - if ((int)co.Index >= 100) indx = (int)co.Index; - break; - } - } - } StepConfig sc = CurItemInfo.MyConfig as StepConfig; sc.Step_CheckOffIndex = indx; //using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID)) diff --git a/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj b/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj index ae6f5783..a6afdbca 100644 --- a/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj +++ b/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj @@ -218,12 +218,6 @@ dlgEnhMissingItem.cs - - Form - - - dlgUCFImportOptions.cs - UserControl @@ -479,9 +473,6 @@ dlgEnhMissingItem.cs - - dlgUCFImportOptions.cs - FindReplace.cs Designer diff --git a/PROMS/Volian.Controls.Library/dlgUCFImportOptions.Designer.cs b/PROMS/Volian.Controls.Library/dlgUCFImportOptions.Designer.cs deleted file mode 100644 index 9a850948..00000000 --- a/PROMS/Volian.Controls.Library/dlgUCFImportOptions.Designer.cs +++ /dev/null @@ -1,397 +0,0 @@ -namespace Volian.Controls.Library -{ - partial class dlgUCFImportOptions - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.btnOk = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.pnlOptions = new System.Windows.Forms.Panel(); - this.pnlChoices = new System.Windows.Forms.Panel(); - this.cmbFNames = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.grPnlLoad = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.grPnlUse = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.rbOnlyImported = new System.Windows.Forms.RadioButton(); - this.rbAll = new System.Windows.Forms.RadioButton(); - this.rbSetOnly = new System.Windows.Forms.RadioButton(); - this.cbUse = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.lblLoadFormat = new DevComponents.DotNetBar.LabelX(); - this.sBtnLoad = new DevComponents.DotNetBar.Controls.SwitchButton(); - this.lblFmt = new System.Windows.Forms.Label(); - this.pnlXmlDiff = new System.Windows.Forms.Panel(); - this.wbBrwsExisting = new System.Windows.Forms.WebBrowser(); - this.splitterWebBrowsers = new System.Windows.Forms.Splitter(); - this.pnlWbBrwsImp = new System.Windows.Forms.Panel(); - this.wbBrwsImporting = new System.Windows.Forms.WebBrowser(); - this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); - this.pnlChoices.SuspendLayout(); - this.grPnlLoad.SuspendLayout(); - this.grPnlUse.SuspendLayout(); - this.pnlXmlDiff.SuspendLayout(); - this.pnlWbBrwsImp.SuspendLayout(); - this.SuspendLayout(); - // - // btnOk - // - this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOk.Location = new System.Drawing.Point(31, 356); - this.btnOk.Name = "btnOk"; - this.btnOk.Size = new System.Drawing.Size(65, 23); - this.btnOk.TabIndex = 5; - this.btnOk.Text = "OK"; - this.btnOk.UseVisualStyleBackColor = true; - this.btnOk.Click += new System.EventHandler(this.btnOk_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(121, 356); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(65, 23); - this.btnCancel.TabIndex = 6; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - // - // pnlOptions - // - this.pnlOptions.Location = new System.Drawing.Point(0, 0); - this.pnlOptions.Name = "pnlOptions"; - this.pnlOptions.Size = new System.Drawing.Size(200, 100); - this.pnlOptions.TabIndex = 0; - // - // pnlChoices - // - this.pnlChoices.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.pnlChoices.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.pnlChoices.Controls.Add(this.cmbFNames); - this.pnlChoices.Controls.Add(this.grPnlLoad); - this.pnlChoices.Controls.Add(this.lblLoadFormat); - this.pnlChoices.Controls.Add(this.sBtnLoad); - this.pnlChoices.Controls.Add(this.lblFmt); - this.pnlChoices.Controls.Add(this.btnCancel); - this.pnlChoices.Controls.Add(this.btnOk); - this.pnlChoices.Location = new System.Drawing.Point(0, 0); - this.pnlChoices.Name = "pnlChoices"; - this.pnlChoices.Size = new System.Drawing.Size(250, 606); - this.pnlChoices.TabIndex = 7; - // - // cmbFNames - // - this.cmbFNames.DisplayMember = "Text"; - this.cmbFNames.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.cmbFNames.FormattingEnabled = true; - this.cmbFNames.ItemHeight = 16; - this.cmbFNames.Location = new System.Drawing.Point(26, 48); - this.cmbFNames.Name = "cmbFNames"; - this.cmbFNames.Size = new System.Drawing.Size(191, 22); - this.cmbFNames.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.cmbFNames.TabIndex = 15; - this.cmbFNames.SelectedIndexChanged += new System.EventHandler(this.cmbFNames_SelectedIndexChanged); - // - // grPnlLoad - // - this.grPnlLoad.CanvasColor = System.Drawing.SystemColors.Control; - this.grPnlLoad.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.grPnlLoad.Controls.Add(this.grPnlUse); - this.grPnlLoad.Controls.Add(this.cbUse); - this.grPnlLoad.DisabledBackColor = System.Drawing.Color.Empty; - this.grPnlLoad.Location = new System.Drawing.Point(11, 130); - this.grPnlLoad.Name = "grPnlLoad"; - this.grPnlLoad.Size = new System.Drawing.Size(224, 184); - // - // - // - this.grPnlLoad.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.grPnlLoad.Style.BackColorGradientAngle = 90; - this.grPnlLoad.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.grPnlLoad.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlLoad.Style.BorderBottomWidth = 1; - this.grPnlLoad.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.grPnlLoad.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlLoad.Style.BorderLeftWidth = 1; - this.grPnlLoad.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlLoad.Style.BorderRightWidth = 1; - this.grPnlLoad.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlLoad.Style.BorderTopWidth = 1; - this.grPnlLoad.Style.CornerDiameter = 4; - this.grPnlLoad.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.grPnlLoad.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.grPnlLoad.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.grPnlLoad.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.grPnlLoad.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.grPnlLoad.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.grPnlLoad.TabIndex = 14; - this.grPnlLoad.Text = "Load Options"; - // - // grPnlUse - // - this.grPnlUse.BackColor = System.Drawing.Color.Transparent; - this.grPnlUse.CanvasColor = System.Drawing.SystemColors.Control; - this.grPnlUse.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.grPnlUse.Controls.Add(this.rbOnlyImported); - this.grPnlUse.Controls.Add(this.rbAll); - this.grPnlUse.Controls.Add(this.rbSetOnly); - this.grPnlUse.DisabledBackColor = System.Drawing.Color.Empty; - this.grPnlUse.Location = new System.Drawing.Point(15, 39); - this.grPnlUse.Name = "grPnlUse"; - this.grPnlUse.Size = new System.Drawing.Size(181, 119); - // - // - // - this.grPnlUse.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.grPnlUse.Style.BackColorGradientAngle = 90; - this.grPnlUse.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.grPnlUse.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlUse.Style.BorderBottomWidth = 1; - this.grPnlUse.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.grPnlUse.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlUse.Style.BorderLeftWidth = 1; - this.grPnlUse.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlUse.Style.BorderRightWidth = 1; - this.grPnlUse.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grPnlUse.Style.BorderTopWidth = 1; - this.grPnlUse.Style.CornerDiameter = 4; - this.grPnlUse.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.grPnlUse.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.grPnlUse.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.grPnlUse.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.grPnlUse.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.grPnlUse.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.grPnlUse.TabIndex = 1; - this.grPnlUse.Text = "In Procedure(s)"; - // - // rbOnlyImported - // - this.rbOnlyImported.AutoSize = true; - this.rbOnlyImported.BackColor = System.Drawing.Color.Transparent; - this.rbOnlyImported.Location = new System.Drawing.Point(12, 6); - this.rbOnlyImported.Name = "rbOnlyImported"; - this.rbOnlyImported.Size = new System.Drawing.Size(142, 21); - this.superTooltip1.SetSuperTooltip(this.rbOnlyImported, new DevComponents.DotNetBar.SuperTooltipInfo("For Imported Only", "", "The changed UCF will only be used by the procedure(s) that are being imported.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.rbOnlyImported.TabIndex = 5; - this.rbOnlyImported.TabStop = true; - this.rbOnlyImported.Text = "For Imported Only"; - this.rbOnlyImported.UseVisualStyleBackColor = false; - // - // rbAll - // - this.rbAll.AutoSize = true; - this.rbAll.BackColor = System.Drawing.Color.Transparent; - this.rbAll.Location = new System.Drawing.Point(12, 33); - this.rbAll.Name = "rbAll"; - this.rbAll.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.rbAll.Size = new System.Drawing.Size(69, 21); - this.superTooltip1.SetSuperTooltip(this.rbAll, new DevComponents.DotNetBar.SuperTooltipInfo("For All ", "", "The changed UCF will be used in all procedure(s) and section(s) within the databa" + - "se that referenced this UCF. The one that existed in the database will be renam" + - "ed to \'Old N of UCFname\'.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.rbAll.TabIndex = 6; - this.rbAll.TabStop = true; - this.rbAll.Text = "For All"; - this.rbAll.UseVisualStyleBackColor = false; - // - // rbSetOnly - // - this.rbSetOnly.AutoSize = true; - this.rbSetOnly.BackColor = System.Drawing.Color.Transparent; - this.rbSetOnly.Location = new System.Drawing.Point(12, 60); - this.rbSetOnly.Name = "rbSetOnly"; - this.rbSetOnly.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.rbSetOnly.Size = new System.Drawing.Size(108, 21); - this.superTooltip1.SetSuperTooltip(this.rbSetOnly, new DevComponents.DotNetBar.SuperTooltipInfo("For Set Only", "", "The changed UCF will only be used by the procedure(s)/sections(s) within the proc" + - "edure set that this procedure belongs.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.rbSetOnly.TabIndex = 7; - this.rbSetOnly.TabStop = true; - this.rbSetOnly.Text = "For Set Only"; - this.rbSetOnly.UseVisualStyleBackColor = false; - // - // cbUse - // - this.cbUse.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.cbUse.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.cbUse.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbUse.Location = new System.Drawing.Point(17, 5); - this.cbUse.Name = "cbUse"; - this.cbUse.Size = new System.Drawing.Size(125, 28); - this.cbUse.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.cbUse, new DevComponents.DotNetBar.SuperTooltipInfo("Use", "", "If checked, the changes will be used as defined In Procedure(s) below. Otherwise," + - " the format is loaded but not used. ", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.cbUse.TabIndex = 0; - this.cbUse.Text = "Use"; - this.cbUse.CheckedChanged += new System.EventHandler(this.cbUse_CheckedChanged); - // - // lblLoadFormat - // - // - // - // - this.lblLoadFormat.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblLoadFormat.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblLoadFormat.Location = new System.Drawing.Point(124, 89); - this.lblLoadFormat.Name = "lblLoadFormat"; - this.lblLoadFormat.Size = new System.Drawing.Size(94, 24); - this.superTooltip1.SetSuperTooltip(this.lblLoadFormat, new DevComponents.DotNetBar.SuperTooltipInfo("Load Format", "", "The User Control of Format changes will be loaded (imported) into the database. O" + - "therwise it will be ignored and the existing User Control of Format will be used" + - ".", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.lblLoadFormat.TabIndex = 13; - this.lblLoadFormat.Text = "Load Format"; - // - // sBtnLoad - // - this.sBtnLoad.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.sBtnLoad.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.sBtnLoad.Location = new System.Drawing.Point(13, 88); - this.sBtnLoad.Name = "sBtnLoad"; - this.sBtnLoad.Size = new System.Drawing.Size(102, 26); - this.sBtnLoad.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.sBtnLoad.TabIndex = 12; - this.sBtnLoad.ValueChanged += new System.EventHandler(this.sBtnLoad_ValueChanged); - // - // lblFmt - // - this.lblFmt.AutoSize = true; - this.lblFmt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblFmt.Location = new System.Drawing.Point(16, 19); - this.lblFmt.Name = "lblFmt"; - this.lblFmt.Size = new System.Drawing.Size(140, 18); - this.lblFmt.TabIndex = 8; - this.lblFmt.Text = "Changes to Format:"; - // - // pnlXmlDiff - // - this.pnlXmlDiff.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pnlXmlDiff.Controls.Add(this.wbBrwsExisting); - this.pnlXmlDiff.Controls.Add(this.splitterWebBrowsers); - this.pnlXmlDiff.Controls.Add(this.pnlWbBrwsImp); - this.pnlXmlDiff.Location = new System.Drawing.Point(255, 0); - this.pnlXmlDiff.Name = "pnlXmlDiff"; - this.pnlXmlDiff.Size = new System.Drawing.Size(548, 601); - this.pnlXmlDiff.TabIndex = 8; - // - // wbBrwsExisting - // - this.wbBrwsExisting.Dock = System.Windows.Forms.DockStyle.Fill; - this.wbBrwsExisting.Location = new System.Drawing.Point(0, 0); - this.wbBrwsExisting.MinimumSize = new System.Drawing.Size(20, 20); - this.wbBrwsExisting.Name = "wbBrwsExisting"; - this.wbBrwsExisting.Size = new System.Drawing.Size(548, 298); - this.wbBrwsExisting.TabIndex = 0; - // - // splitterWebBrowsers - // - this.splitterWebBrowsers.Dock = System.Windows.Forms.DockStyle.Bottom; - this.splitterWebBrowsers.Location = new System.Drawing.Point(0, 298); - this.splitterWebBrowsers.Name = "splitterWebBrowsers"; - this.splitterWebBrowsers.Size = new System.Drawing.Size(548, 3); - this.splitterWebBrowsers.TabIndex = 2; - this.splitterWebBrowsers.TabStop = false; - // - // pnlWbBrwsImp - // - this.pnlWbBrwsImp.Controls.Add(this.wbBrwsImporting); - this.pnlWbBrwsImp.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlWbBrwsImp.Location = new System.Drawing.Point(0, 301); - this.pnlWbBrwsImp.Name = "panel1"; - this.pnlWbBrwsImp.Size = new System.Drawing.Size(548, 300); - this.pnlWbBrwsImp.TabIndex = 3; - // - // wbBrwsImporting - // - this.wbBrwsImporting.Dock = System.Windows.Forms.DockStyle.Fill; - this.wbBrwsImporting.Location = new System.Drawing.Point(0, 0); - this.wbBrwsImporting.MinimumSize = new System.Drawing.Size(20, 20); - this.wbBrwsImporting.Name = "wbBrwsImporting"; - this.wbBrwsImporting.Size = new System.Drawing.Size(548, 300); - this.wbBrwsImporting.TabIndex = 0; - // - // superTooltip1 - // - this.superTooltip1.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray); - this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; - // - // dlgUCFImportOptions - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(803, 606); - this.Controls.Add(this.pnlXmlDiff); - this.Controls.Add(this.pnlChoices); - this.Name = "dlgUCFImportOptions"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "User Control Of Format - Import Options"; - this.pnlChoices.ResumeLayout(false); - this.pnlChoices.PerformLayout(); - this.grPnlLoad.ResumeLayout(false); - this.grPnlUse.ResumeLayout(false); - this.grPnlUse.PerformLayout(); - this.pnlXmlDiff.ResumeLayout(false); - this.pnlWbBrwsImp.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button btnOk; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Panel pnlOptions; - private System.Windows.Forms.Panel pnlXmlDiff; - private System.Windows.Forms.WebBrowser wbBrwsExisting; - private System.Windows.Forms.Panel pnlChoices; - private System.Windows.Forms.Label lblFmt; - private DevComponents.DotNetBar.LabelX lblLoadFormat; - private DevComponents.DotNetBar.Controls.SwitchButton sBtnLoad; - private DevComponents.DotNetBar.Controls.GroupPanel grPnlLoad; - private DevComponents.DotNetBar.Controls.GroupPanel grPnlUse; - private DevComponents.DotNetBar.Controls.CheckBoxX cbUse; - private System.Windows.Forms.RadioButton rbOnlyImported; - private System.Windows.Forms.RadioButton rbAll; - private System.Windows.Forms.RadioButton rbSetOnly; - private DevComponents.DotNetBar.SuperTooltip superTooltip1; - private DevComponents.DotNetBar.Controls.ComboBoxEx cmbFNames; - private System.Windows.Forms.Splitter splitterWebBrowsers; - private System.Windows.Forms.Panel pnlWbBrwsImp; - private System.Windows.Forms.WebBrowser wbBrwsImporting; - } -} \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/dlgUCFImportOptions.cs b/PROMS/Volian.Controls.Library/dlgUCFImportOptions.cs deleted file mode 100644 index 8b411f48..00000000 --- a/PROMS/Volian.Controls.Library/dlgUCFImportOptions.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Linq; -using System.Xml.Xsl; -using System.IO; -using VEPROMS.CSLA.Library; - -namespace Volian.Controls.Library -{ - // This dialog is used when the imported UCF is different than one existing in the database. It allows the user to - // select whether to overwrite, copy, etc. See the user interface project/dlgExportImport.cs for the options. - public partial class dlgUCFImportOptions : Form - { - ListExistingFC; - ListImportedFC; - private bool _Initializing = false; - public E_UCFImportOptions UCFImportOptionsCase = E_UCFImportOptions.LoadOnlyImported; - public dlgUCFImportOptions(List name, List existingFC, List importedFC, E_UCFImportOptions defImpOpt, string xmlpath) - { - _Initializing = true; - InitializeComponent(); - InitializeFNamesCombo(name); - ExistingFC = existingFC; - ImportedFC = importedFC; - cmbFNames.SelectedIndex = 0; // this displays the web browser differences for first name in the combo box. - - // initialize the import of UCF option radio buttons: - UCFImportOptionsCase = defImpOpt; - rbSetOnly.Visible = !xmlpath.ToLower().Contains("folder"); - if (defImpOpt == E_UCFImportOptions.Ignore) - { - sBtnLoad.Value = false; - grPnlLoad.Enabled = false; - grPnlUse.Enabled = false; - } - else if (defImpOpt == E_UCFImportOptions.LoadNotUsed) - { - sBtnLoad.Value = true; - grPnlLoad.Enabled = true; - cbUse.Checked = false; - grPnlUse.Enabled = false; - } - else if (defImpOpt == E_UCFImportOptions.LoadOnlyImported) - { - sBtnLoad.Value = true; - grPnlLoad.Enabled = true; - cbUse.Checked = true; - grPnlUse.Enabled = true; - rbOnlyImported.Checked = true; - } - else if (defImpOpt == E_UCFImportOptions.LoadUseAll) - { - sBtnLoad.Value = true; - grPnlLoad.Enabled = true; - cbUse.Checked = true; - grPnlUse.Enabled = true; - rbAll.Checked = true; - } - else if (defImpOpt == E_UCFImportOptions.LoadForSetOnly) - { - sBtnLoad.Value = true; - grPnlLoad.Enabled = true; - cbUse.Checked = true; - grPnlUse.Enabled = true; - rbSetOnly.Checked = true; - } - _Initializing = false; - return; - } - - private void InitializeFNamesCombo(List name) - { - foreach (string str in name) - cmbFNames.Items.Add(str); - } - - private void DisplayXmlDiff(string existingFC, string importedFC) - { - XmlDocument xd = new XmlDocument(); - xd.LoadXml(existingFC); - XmlNodeList xnl = xd.GetElementsByTagName("FormatConfig"); - if (xnl != null && xnl.Count > 0) AddAttribute(xnl[0], "Version", "Existing"); - string sXSLSummary = System.IO.File.ReadAllText(Application.StartupPath + "\\" + "UCFImpDetails.xsl"); - StringWriter sw = new StringWriter(); - StringWriter xsw = new StringWriter(); - using (XmlReader xrt = XmlReader.Create(new StringReader(sXSLSummary))) - { - XmlTextWriter tx = new XmlTextWriter(xsw); - xd.WriteTo(tx); - string tmp = sw.ToString(); - tmp = xd.InnerXml; - using (XmlReader xri = XmlReader.Create(new StringReader(tmp))) - { - using (XmlWriter xwo = XmlWriter.Create(sw)) - { - XslCompiledTransform xsl = new XslCompiledTransform(); - xsl.Load(xrt); - xsl.Transform(xri, xwo); // Perform Transform - } - wbBrwsExisting.DocumentText = sw.ToString(); - } - } - StringWriter sw1 = new StringWriter(); - StringWriter xsw1 = new StringWriter(); - XmlDocument xd1 = new XmlDocument(); - xd1.LoadXml(importedFC); - xnl = xd1.GetElementsByTagName("FormatConfig"); - if (xnl != null && xnl.Count > 0) AddAttribute(xnl[0], "Version", "Importing"); - using (XmlReader xrt = XmlReader.Create(new StringReader(sXSLSummary))) - { - XmlTextWriter tx = new XmlTextWriter(xsw1); - xd1.WriteTo(tx); - string tmp = xd1.InnerXml; - using (XmlReader xri = XmlReader.Create(new StringReader(tmp))) - { - using (XmlWriter xwo = XmlWriter.Create(sw1)) - { - XslCompiledTransform xsl = new XslCompiledTransform(); - xsl.Load(xrt); - xsl.Transform(xri, xwo); // Perform Transform - } - wbBrwsImporting.DocumentText = sw1.ToString(); - } - } - } - - private void AddAttribute(XmlNode xn, string name, string value) - { - XmlAttribute xa = xn.OwnerDocument.CreateAttribute(name); - xa.Value = value.ToString(); - xn.Attributes.Append(xa); - } - private void btnOk_Click(object sender, EventArgs e) - { - if (!sBtnLoad.Value) UCFImportOptionsCase = E_UCFImportOptions.Ignore; - else if (!cbUse.Checked) UCFImportOptionsCase = E_UCFImportOptions.LoadNotUsed; - else if (rbOnlyImported.Checked) UCFImportOptionsCase = E_UCFImportOptions.LoadOnlyImported; - else if (rbAll.Checked) UCFImportOptionsCase = E_UCFImportOptions.LoadUseAll; - else if (rbSetOnly.Checked) UCFImportOptionsCase = E_UCFImportOptions.LoadForSetOnly; - this.Close(); - } - - private void sBtnLoad_ValueChanged(object sender, EventArgs e) // Import options for UCF Change: Load switch button - { - if (_Initializing) return; - if (sBtnLoad.Value) - { - grPnlLoad.Enabled = true; // Import the ucf change. let user select whether to use it. - grPnlUse.Enabled = false; - cbUse.Checked = false; - } - else - { - grPnlLoad.Enabled = false; // Don't import the ucf change. - grPnlUse.Enabled = false; - } - } - - private void cbUse_CheckedChanged(object sender, EventArgs e) // Import options for UCF Change: use checkbox - { - if (_Initializing) return; - if (cbUse.Checked) - grPnlUse.Enabled = true; // Use the change. enable the load group & select for imported only - else - grPnlUse.Enabled = false; // Don't use the change. - } - - private void cmbFNames_SelectedIndexChanged(object sender, EventArgs e) - { - int indx = cmbFNames.SelectedIndex; - string existingFC = ExistingFC[indx]; - string importedFC = ImportedFC[indx]; - DisplayXmlDiff(existingFC, importedFC); - } - } -} diff --git a/PROMS/Volian.Controls.Library/dlgUCFImportOptions.resx b/PROMS/Volian.Controls.Library/dlgUCFImportOptions.resx deleted file mode 100644 index 2e5faf21..00000000 --- a/PROMS/Volian.Controls.Library/dlgUCFImportOptions.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - True - - \ No newline at end of file diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 68a13f7a..afacd8a5 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -4458,12 +4458,6 @@ namespace Volian.Print.Library xloc_co = XOffset + (relX > 0 ? Width : 0) + relX; } } - // if there is ucf value for adjusting the alignment for checkoffs, use it: - FormatConfig fc = PlantFormat.GetFormatConfig(formatInfo); - if (fc != null && fc.PlantFormat.FormatData.CheckOffXOffAdj != null) - { - if (co.Index > 99) xloc_co += ((float)fc.PlantFormat.FormatData.CheckOffXOffAdj * 72); - } // CheckOffXtraLines was introduced for the additional lines needed for the longer signoffs // for VCBA (&WST1), for F2016-061. @@ -5215,7 +5209,7 @@ namespace Volian.Print.Library // First see if there is any checkoff data in the format file and that there // is a pagelist item for the checkoff header. - int maxindx = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffUCF ? itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex : itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; + int maxindx = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit; if (maxindx <= 0) return; if (MyPageHelper.PageListCheckOffHeader == null) return;