Compare commits
113 Commits
Author | SHA1 | Date | |
---|---|---|---|
3b73d54ea2 | |||
2ca433c83f | |||
0b40569727 | |||
afb0247d87 | |||
bce8461a7e | |||
9d5cc43d71 | |||
bc1370ab29 | |||
eaf2b14cfc | |||
1cf7d81aa5 | |||
f11a9536f0 | |||
c7bdcf0104 | |||
df026499d5 | |||
a3aa4157b8 | |||
8f3268e1bc | |||
5721d440e9 | |||
505c396283 | |||
643e6bc94f | |||
76502e6d97 | |||
851a0b3810 | |||
fd8dbb4c8b | |||
4ffd994c5e | |||
a34828113a | |||
461329468c | |||
35de5df04d | |||
4f0548fd60 | |||
5c1d96cc51 | |||
57049c0c52 | |||
31326e1c91 | |||
3c60994a0a | |||
773cc42346 | |||
f46a1f39dc | |||
b7175bf77f | |||
ec22232aa8 | |||
f303cd2236 | |||
f40cef4416 | |||
fbca97d38d | |||
28bd2cba5c | |||
4b35f73bbf | |||
f4706eb126 | |||
21bcb90558 | |||
ae48ac0cae | |||
cb4979d5bc | |||
7d3ae74e1f | |||
9d680aa500 | |||
0d50b1c2fe | |||
75e034863f | |||
3b42de1571 | |||
668472286e | |||
e00d34c99d | |||
9fb496dfb3 | |||
f4eaa4a3ef | |||
5d50ed6bdf | |||
d7ace4eaf9 | |||
16a4d335ea | |||
ba69bb0772 | |||
455940caa2 | |||
439344757e | |||
ad912691c9 | |||
237144aff6 | |||
810332d558 | |||
f8431d0ba1 | |||
57c3bfa16a | |||
61f1077608 | |||
8877e968b9 | |||
4575c90bee | |||
21279a87ae | |||
3d5ad4a17e | |||
9bb7b044a8 | |||
dc8f2f7561 | |||
829dbf84da | |||
7b156c17f8 | |||
cbf7cbc164 | |||
b04faa816e | |||
517ebe2902 | |||
03d0d314e3 | |||
3e804c5cce | |||
ee2b8b538e | |||
fdfd34fe92 | |||
2d6fb6523b | |||
3084bf3982 | |||
5ba51e8392 | |||
fb5eb43e34 | |||
b154056276 | |||
c67b8f9ca1 | |||
95e4181360 | |||
32dffbe56b | |||
6b3c8d373b | |||
db29107f47 | |||
355537f2ab | |||
0729ef0c21 | |||
6fe82bfd0f | |||
39bf072363 | |||
da7c384fd8 | |||
95130fd9a0 | |||
978e2344a3 | |||
c9bf45602c | |||
aa160b2036 | |||
f82b32d351 | |||
e519dc9a57 | |||
f020c37db9 | |||
5a4ec3b6b1 | |||
2602d6c9d2 | |||
ff403583d7 | |||
c5577cc2bd | |||
78be6e5dc1 | |||
b954a41375 | |||
0100a11cfe | |||
04cf2e8534 | |||
be00724818 | |||
274d93c61a | |||
7dc4c30436 | |||
028ef4bc31 | |||
42124d65c7 |
@@ -18917,10 +18917,9 @@ GO
|
|||||||
Copyright 2020 - Volian Enterprises, Inc. All rights reserved.
|
Copyright 2020 - Volian Enterprises, Inc. All rights reserved.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*
|
/*
|
||||||
==========================================================================================================
|
==========================================================================================================
|
||||||
Author: Jake Ropar / Matthew Schill
|
Author: Jake Ropar
|
||||||
Create Date: 06/23/2022
|
Create Date: 06/23/2022
|
||||||
Modify Date: 08/18/2025
|
|
||||||
Description: Finalizes Rofst Header Record / Updates LoadedDate if Success
|
Description: Finalizes Rofst Header Record / Updates LoadedDate if Success
|
||||||
==========================================================================================================
|
==========================================================================================================
|
||||||
*/
|
*/
|
||||||
@@ -18937,18 +18936,13 @@ GO
|
|||||||
Set LoadedDate = GetDate()
|
Set LoadedDate = GetDate()
|
||||||
Where RofstID = @RofstID;
|
Where RofstID = @RofstID;
|
||||||
|
|
||||||
|
|
||||||
--always rebuild the rofst child and default indexes
|
|
||||||
DBCC DBREINDEX ('RofstChild');
|
|
||||||
DBCC DBREINDEX ('RofstDefaultValue');
|
|
||||||
|
|
||||||
-- Rebuild/Reorganize Indexes
|
-- Rebuild/Reorganize Indexes
|
||||||
Exec [dbo].[vesp_UtilityCheckIndexes] 20.0, 5.0, 0, 1;
|
Exec [dbo].[vesp_UtilityCheckIndexes] 20.0, 5.0, 0, 1;
|
||||||
|
|
||||||
|
|
||||||
Return;
|
Return;
|
||||||
End
|
End
|
||||||
GO
|
Go
|
||||||
|
|
||||||
IF (@@Error = 0) PRINT 'Procedure Creation: [vesp_RofstHeaderFinalizeLoad] Succeeded'
|
IF (@@Error = 0) PRINT 'Procedure Creation: [vesp_RofstHeaderFinalizeLoad] Succeeded'
|
||||||
ELSE PRINT 'Procedure Creation: [vesp_RofstHeaderFinalizeLoad] Error on Creation'
|
ELSE PRINT 'Procedure Creation: [vesp_RofstHeaderFinalizeLoad] Error on Creation'
|
||||||
@@ -24383,8 +24377,8 @@ BEGIN TRY -- Try Block
|
|||||||
DECLARE @RevDate varchar(255)
|
DECLARE @RevDate varchar(255)
|
||||||
DECLARE @RevDescription varchar(255)
|
DECLARE @RevDescription varchar(255)
|
||||||
|
|
||||||
set @RevDate = '08/18/2025 2:07 PM'
|
set @RevDate = '08/13/2025 8:07 AM'
|
||||||
set @RevDescription = 'Updated Index maintenance that occurs after RO FST Load to improve RO Performance'
|
set @RevDescription = 'Improve Performance loading procedures with Alarms'
|
||||||
|
|
||||||
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
||||||
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
||||||
|
@@ -111,6 +111,10 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\3rdPartyLibraries\DotNetBar\DotNetBar4.6Build\DevComponents.DotNetBar2.dll</HintPath>
|
<HintPath>..\..\..\..\3rdPartyLibraries\DotNetBar\DotNetBar4.6Build\DevComponents.DotNetBar2.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\3rdPartyLibraries\Ionic\Ionic.Zip.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Itenso.Rtf.Interpreter">
|
<Reference Include="Itenso.Rtf.Interpreter">
|
||||||
<HintPath>..\..\..\..\3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Interpreter.dll</HintPath>
|
<HintPath>..\..\..\..\3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Interpreter.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -129,8 +133,6 @@
|
|||||||
<Reference Include="System.Deployment" />
|
<Reference Include="System.Deployment" />
|
||||||
<Reference Include="System.Design" />
|
<Reference Include="System.Design" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.IO.Compression" />
|
|
||||||
<Reference Include="System.IO.Compression.FileSystem" />
|
|
||||||
<Reference Include="System.Runtime.Remoting" />
|
<Reference Include="System.Runtime.Remoting" />
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Web.Extensions" />
|
<Reference Include="System.Web.Extensions" />
|
||||||
|
@@ -7,7 +7,7 @@ using Volian.Controls.Library;
|
|||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using Ionic.Zip;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -188,13 +188,14 @@ namespace VEPROMS
|
|||||||
if (MyFolder != null)
|
if (MyFolder != null)
|
||||||
{
|
{
|
||||||
sfd.FileName = string.Format("{0}-{1}.expx", Database.ActiveDatabase, MyFolder.Name);
|
sfd.FileName = string.Format("{0}-{1}.expx", Database.ActiveDatabase, MyFolder.Name);
|
||||||
if (sfd.ShowDialog(this) == DialogResult.OK && sfd.FileName != string.Empty)
|
if (sfd.ShowDialog(this) == DialogResult.OK && sfd.FileName != string.Empty)
|
||||||
{
|
{
|
||||||
txtExport.Text = sfd.FileName;
|
txtExport.Text = sfd.FileName;
|
||||||
if (File.Exists(txtExport.Text))
|
if (File.Exists(txtExport.Text))
|
||||||
File.Delete(txtExport.Text);
|
File.Delete(txtExport.Text);
|
||||||
MyExpZipFileName = txtExport.Text;
|
MyExpxZipFile = new ZipFile(txtExport.Text, Encoding.UTF8);
|
||||||
}
|
MyExpxZipFile.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (MyProcedure != null)
|
else if (MyProcedure != null)
|
||||||
{
|
{
|
||||||
@@ -210,8 +211,8 @@ namespace VEPROMS
|
|||||||
else
|
else
|
||||||
lblExportStatus.Text = "Awaiting Export File Name:";
|
lblExportStatus.Text = "Awaiting Export File Name:";
|
||||||
}
|
}
|
||||||
private string MyExpZipFileName = null;
|
private ZipFile MyExpxZipFile = null;
|
||||||
private string MyImpZipFileName = null;
|
private ZipFile MyImpxZipFile = null;
|
||||||
private DateTime MyStart;
|
private DateTime MyStart;
|
||||||
private bool successfullExport = true;
|
private bool successfullExport = true;
|
||||||
|
|
||||||
@@ -891,94 +892,84 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private bool LoadImportDataDocument()
|
private bool LoadImportDataDocument()
|
||||||
{
|
{
|
||||||
using (FileStream zipToOpen = new FileStream(MyExpZipFileName, FileMode.OpenOrCreate))
|
floatFoldout = new Dictionary<int, int>();
|
||||||
|
ZipEntry ze = MyExpxZipFile[0];
|
||||||
|
string fn = PEIPath + @"\" + ze.FileName;
|
||||||
|
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
||||||
|
XmlDocument xd = new XmlDocument();
|
||||||
|
xd.Load(fn);
|
||||||
|
bool didImp = LoadFormats(xd, "folder/formats/format");
|
||||||
|
if (!didImp)
|
||||||
{
|
{
|
||||||
using (ZipArchive MyExpxZipFile = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
|
this.Cursor = Cursors.Default;
|
||||||
{
|
this.btnImport.Enabled = true; // allow user to select a different export file to import
|
||||||
floatFoldout = new Dictionary<int, int>();
|
this.btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
||||||
ZipArchiveEntry ze = MyExpxZipFile.Entries[0];
|
return false; // Return False to Indicate that the Import did not succeed
|
||||||
if (!Directory.Exists(Path.Combine(PEIPath, "folder")))
|
|
||||||
Directory.CreateDirectory(Path.Combine(PEIPath, "folder"));
|
|
||||||
string fn = Path.Combine(PEIPath, "folder", ze.Name);
|
|
||||||
ze.ExtractToFile(fn, true);
|
|
||||||
XmlDocument xd = new XmlDocument();
|
|
||||||
xd.Load(fn);
|
|
||||||
bool didImp = LoadFormats(xd, "folder/formats/format");
|
|
||||||
if (!didImp)
|
|
||||||
{
|
|
||||||
this.Cursor = Cursors.Default;
|
|
||||||
this.btnImport.Enabled = true; // allow user to select a different export file to import
|
|
||||||
this.btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
|
||||||
return false; // Return False to Indicate that the Import did not succeed
|
|
||||||
}
|
|
||||||
string name = xd.DocumentElement.Attributes.GetNamedItem("name").InnerText;
|
|
||||||
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd, name);
|
|
||||||
if (ff == null)
|
|
||||||
{
|
|
||||||
// C2020-032: Import Procedure set when existing name exists, allow user to import with 'Copy (#) of'.
|
|
||||||
// This is similar functionality to the import of a procedure without the overwrite part.
|
|
||||||
string msg = string.Format("The procedure set you are importing, {0}, already exists.\n\nDo you want to import {0} as a COPY of the existing set?\n\nThis will prefix the name with \"Copy (#) of\"", name);
|
|
||||||
DialogResult dr = MessageBox.Show(this, msg, "Create Copy Of Existing Procedure Set", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop);
|
|
||||||
if (dr == DialogResult.OK)
|
|
||||||
{
|
|
||||||
string number = "";
|
|
||||||
int max = -1;
|
|
||||||
// get maximum number of existing copies.
|
|
||||||
foreach (FolderInfo fi in MyFolder.ChildFolders)
|
|
||||||
{
|
|
||||||
int indx = fi.Name.IndexOf("Copy (");
|
|
||||||
if (indx > -1)
|
|
||||||
{
|
|
||||||
int indxend = fi.Name.IndexOf(")", indx);
|
|
||||||
if (indxend > indx)
|
|
||||||
{
|
|
||||||
string tmp = fi.Name.Substring(indx + 6, indxend - (indx + 6));
|
|
||||||
int ii = Convert.ToInt32(tmp);
|
|
||||||
if (ii > max) max = ii;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
number = max > -1 ? (max + 1).ToString() : "1";
|
|
||||||
name = string.Format("Copy ({0}) of {1}", number, name);
|
|
||||||
|
|
||||||
ff = AddFolder(Folder.Get(MyFolder.FolderID), xd, name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
_MyNewFolder = FolderInfo.Get(ff.FolderID);
|
|
||||||
AddAnnotationTypes(xd);
|
|
||||||
DocVersionInfo dvi = AddDocVersion(ff, xd);
|
|
||||||
MyDocVersion = dvi;
|
|
||||||
xd = null;
|
|
||||||
lblImportStatus.Text = "Creating Procedures...";
|
|
||||||
Application.DoEvents();
|
|
||||||
ProcedureInfo pi = null;
|
|
||||||
pbImportProcedure.Value = 0;
|
|
||||||
pbImportProcedure.Maximum = MyExpxZipFile.Entries.Count - 1;
|
|
||||||
if (!Directory.Exists(Path.Combine(PEIPath, "procedures")))
|
|
||||||
Directory.CreateDirectory(Path.Combine(PEIPath, "procedures"));
|
|
||||||
for (int i = 1; i < MyExpxZipFile.Entries.Count; i++)
|
|
||||||
{
|
|
||||||
ze = MyExpxZipFile.Entries[i];
|
|
||||||
fn = Path.Combine(PEIPath, "procedures", ze.Name);
|
|
||||||
ze.ExtractToFile(fn, true);
|
|
||||||
xd = new XmlDocument();
|
|
||||||
xd.Load(fn);
|
|
||||||
pi = AddProcedure(xd.DocumentElement, dvi, pi);
|
|
||||||
GC.Collect(); // need to cleanup memory after importing each procedure due to use of Regular Expressions in processing RO and Transition links
|
|
||||||
}
|
|
||||||
DirectoryInfo di = new DirectoryInfo(PEIPath);
|
|
||||||
DirectoryInfo[] dis = di.GetDirectories();
|
|
||||||
for (int d = 0; d < dis.Length; d++)
|
|
||||||
dis[d].Delete(true);
|
|
||||||
lblImportStatus.Text = "Updating Transitions";
|
|
||||||
AddTransitions();
|
|
||||||
FixFloatingFoldouts();
|
|
||||||
SaveTransitionAndItemContentIDs();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
string name = xd.DocumentElement.Attributes.GetNamedItem("name").InnerText;
|
||||||
|
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd, name);
|
||||||
|
if (ff == null)
|
||||||
|
{
|
||||||
|
// C2020-032: Import Procedure set when existing name exists, allow user to import with 'Copy (#) of'.
|
||||||
|
// This is similar functionality to the import of a procedure without the overwrite part.
|
||||||
|
string msg = string.Format("The procedure set you are importing, {0}, already exists.\n\nDo you want to import {0} as a COPY of the existing set?\n\nThis will prefix the name with \"Copy (#) of\"", name);
|
||||||
|
DialogResult dr = MessageBox.Show(this, msg, "Create Copy Of Existing Procedure Set", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop);
|
||||||
|
if (dr == DialogResult.OK)
|
||||||
|
{
|
||||||
|
string number = "";
|
||||||
|
int max = -1;
|
||||||
|
// get maximum number of existing copies.
|
||||||
|
foreach (FolderInfo fi in MyFolder.ChildFolders)
|
||||||
|
{
|
||||||
|
int indx = fi.Name.IndexOf("Copy (");
|
||||||
|
if (indx > -1)
|
||||||
|
{
|
||||||
|
int indxend = fi.Name.IndexOf(")", indx);
|
||||||
|
if (indxend > indx)
|
||||||
|
{
|
||||||
|
string tmp = fi.Name.Substring(indx + 6, indxend - (indx + 6));
|
||||||
|
int ii = Convert.ToInt32(tmp);
|
||||||
|
if (ii > max) max = ii;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
number = max > -1 ? (max + 1).ToString() : "1";
|
||||||
|
name = string.Format("Copy ({0}) of {1}", number, name);
|
||||||
|
|
||||||
|
ff = AddFolder(Folder.Get(MyFolder.FolderID), xd, name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_MyNewFolder = FolderInfo.Get(ff.FolderID);
|
||||||
|
AddAnnotationTypes(xd);
|
||||||
|
DocVersionInfo dvi = AddDocVersion(ff, xd);
|
||||||
|
MyDocVersion = dvi;
|
||||||
|
xd = null;
|
||||||
|
lblImportStatus.Text = "Creating Procedures...";
|
||||||
|
Application.DoEvents();
|
||||||
|
ProcedureInfo pi = null;
|
||||||
|
pbImportProcedure.Value = 0;
|
||||||
|
pbImportProcedure.Maximum = MyExpxZipFile.Entries.Count - 1;
|
||||||
|
for (int i = 1; i < MyExpxZipFile.Entries.Count; i++)
|
||||||
|
{
|
||||||
|
ze = MyExpxZipFile[i];
|
||||||
|
fn = PEIPath + @"\" + ze.FileName;
|
||||||
|
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
||||||
|
xd = new XmlDocument();
|
||||||
|
xd.Load(fn);
|
||||||
|
pi = AddProcedure(xd.DocumentElement, dvi, pi);
|
||||||
|
GC.Collect(); // need to cleanup memory after importing each procedure due to use of Regular Expressions in processing RO and Transition links
|
||||||
|
}
|
||||||
|
DirectoryInfo di = new DirectoryInfo(PEIPath);
|
||||||
|
DirectoryInfo[] dis = di.GetDirectories();
|
||||||
|
for (int d = 0; d < dis.Length; d++)
|
||||||
|
dis[d].Delete(true);
|
||||||
|
lblImportStatus.Text = "Updating Transitions";
|
||||||
|
AddTransitions();
|
||||||
|
FixFloatingFoldouts();
|
||||||
|
SaveTransitionAndItemContentIDs();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
private void FixSectionStart(ProcedureInfo pi)
|
private void FixSectionStart(ProcedureInfo pi)
|
||||||
{
|
{
|
||||||
@@ -1263,85 +1254,85 @@ namespace VEPROMS
|
|||||||
// the xml files are then added (or replaced) in the .impx file.
|
// the xml files are then added (or replaced) in the .impx file.
|
||||||
private void SaveTransitionAndItemContentIDs()
|
private void SaveTransitionAndItemContentIDs()
|
||||||
{
|
{
|
||||||
using (FileStream zipToOpen = new FileStream(MyImpZipFileName, FileMode.OpenOrCreate))
|
XmlDocument xd = new XmlDocument();
|
||||||
|
XmlElement xe = xd.CreateElement("items");
|
||||||
|
xd.AppendChild(xe);
|
||||||
|
string fn = PEIPath + @"\items.xml";
|
||||||
|
foreach (int key in Old2NewItem.Keys)
|
||||||
{
|
{
|
||||||
using (ZipArchive MyImpxZipFile = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
|
xe = xd.CreateElement("item");
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString()));
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewItem[key].ToString()));
|
||||||
|
xd.DocumentElement.AppendChild(xe);
|
||||||
|
}
|
||||||
|
xd.Save(fn);
|
||||||
|
ZipEntry ze = MyImpxZipFile["items.xml"];
|
||||||
|
MyImpxZipFile.RemoveEntry(ze);
|
||||||
|
MyImpxZipFile.Save();
|
||||||
|
MyImpxZipFile.AddFile(fn, "");
|
||||||
|
MyImpxZipFile.Save();
|
||||||
|
File.Delete(fn);
|
||||||
|
xd = new XmlDocument();
|
||||||
|
xe = xd.CreateElement("contents");
|
||||||
|
xd.AppendChild(xe);
|
||||||
|
fn = PEIPath + @"\contents.xml";
|
||||||
|
foreach (int key in Old2NewContent.Keys)
|
||||||
|
{
|
||||||
|
xe = xd.CreateElement("content");
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString()));
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewContent[key].ToString()));
|
||||||
|
xd.DocumentElement.AppendChild(xe);
|
||||||
|
}
|
||||||
|
xd.Save(fn);
|
||||||
|
ze = MyImpxZipFile["contents.xml"];
|
||||||
|
MyImpxZipFile.RemoveEntry(ze);
|
||||||
|
MyImpxZipFile.Save();
|
||||||
|
MyImpxZipFile.AddFile(fn, "");
|
||||||
|
MyImpxZipFile.Save();
|
||||||
|
File.Delete(fn);
|
||||||
|
xd = new XmlDocument();
|
||||||
|
xe = xd.CreateElement("transitions");
|
||||||
|
xd.AppendChild(xe);
|
||||||
|
fn = PEIPath + @"\transitions.xml";
|
||||||
|
if (PendingTransitions != null && PendingTransitions.DocumentElement.HasChildNodes)
|
||||||
|
{
|
||||||
|
foreach (XmlNode nd in PendingTransitions.DocumentElement.ChildNodes)
|
||||||
{
|
{
|
||||||
XmlDocument xd = new XmlDocument();
|
if (nd.InnerText == "")
|
||||||
XmlElement xe = xd.CreateElement("items");
|
xd.DocumentElement.AppendChild(xd.ImportNode(nd, true));
|
||||||
xd.AppendChild(xe);
|
|
||||||
string fn = PEIPath + @"\items.xml";
|
|
||||||
foreach (int key in Old2NewItem.Keys)
|
|
||||||
{
|
|
||||||
xe = xd.CreateElement("item");
|
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString()));
|
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewItem[key].ToString()));
|
|
||||||
xd.DocumentElement.AppendChild(xe);
|
|
||||||
}
|
|
||||||
xd.Save(fn);
|
|
||||||
ZipArchiveEntry ze = MyImpxZipFile.GetEntry("items.xml");
|
|
||||||
ze.Delete();
|
|
||||||
_ = MyImpxZipFile.CreateEntryFromFile(fn, Path.GetFileName(fn));
|
|
||||||
File.Delete(fn);
|
|
||||||
xd = new XmlDocument();
|
|
||||||
xe = xd.CreateElement("contents");
|
|
||||||
xd.AppendChild(xe);
|
|
||||||
fn = PEIPath + @"\contents.xml";
|
|
||||||
foreach (int key in Old2NewContent.Keys)
|
|
||||||
{
|
|
||||||
xe = xd.CreateElement("content");
|
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString()));
|
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewContent[key].ToString()));
|
|
||||||
xd.DocumentElement.AppendChild(xe);
|
|
||||||
}
|
|
||||||
xd.Save(fn);
|
|
||||||
ze = MyImpxZipFile.GetEntry("contents.xml");
|
|
||||||
ze.Delete();
|
|
||||||
_ = MyImpxZipFile.CreateEntryFromFile(fn, Path.GetFileName(fn));
|
|
||||||
File.Delete(fn);
|
|
||||||
xd = new XmlDocument();
|
|
||||||
xe = xd.CreateElement("transitions");
|
|
||||||
xd.AppendChild(xe);
|
|
||||||
fn = PEIPath + @"\transitions.xml";
|
|
||||||
if (PendingTransitions != null && PendingTransitions.DocumentElement.HasChildNodes)
|
|
||||||
{
|
|
||||||
foreach (XmlNode nd in PendingTransitions.DocumentElement.ChildNodes)
|
|
||||||
{
|
|
||||||
if (nd.InnerText == "")
|
|
||||||
xd.DocumentElement.AppendChild(xd.ImportNode(nd, true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
xd.Save(fn);
|
|
||||||
ze = MyImpxZipFile.GetEntry("transitions.xml");
|
|
||||||
ze.Delete();
|
|
||||||
_ = MyImpxZipFile.CreateEntryFromFile(fn, Path.GetFileName(fn));
|
|
||||||
File.Delete(fn);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
xd.Save(fn);
|
||||||
|
ze = MyImpxZipFile["transitions.xml"];
|
||||||
|
MyImpxZipFile.RemoveEntry(ze);
|
||||||
|
MyImpxZipFile.Save();
|
||||||
|
MyImpxZipFile.AddFile(fn, "");
|
||||||
|
MyImpxZipFile.Save();
|
||||||
|
File.Delete(fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is called only when we are importing an entire folder and there is a .impx file (a zip file)
|
// This is called only when we are importing an entire folder and there is a .impx file (a zip file)
|
||||||
// the name of the .impx file is based on the folder name containing the export file being imported
|
// the name of the .impx file is based on the folder name containing the export file being imported
|
||||||
// This will read in the saved ItemIDs (old and new), ContentIDs (old andnew), library document IDs (old and new), and pending transitions
|
// This will read in the saved ItemIDs (old and new), ContentIDs (old andnew), library document IDs (old and new), and pending transitions
|
||||||
private void ReadTransitionAndItemContentIDs(ZipArchive MyImpxZipFile)
|
private void ReadTransitionAndItemContentIDs()
|
||||||
{
|
{
|
||||||
ZipArchiveEntry ze = MyImpxZipFile.GetEntry("items.xml");
|
ZipEntry ze = MyImpxZipFile["items.xml"];
|
||||||
|
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
||||||
string fn = PEIPath + @"\items.xml";
|
string fn = PEIPath + @"\items.xml";
|
||||||
ze.ExtractToFile(fn, true);
|
|
||||||
XmlDocument xd = new XmlDocument();
|
XmlDocument xd = new XmlDocument();
|
||||||
xd.Load(fn);
|
xd.Load(fn);
|
||||||
// B2016-176, B2016-197 Transitions were no always properly resolved - don't load in the old item ids
|
// B2016-176, B2016-197 Transitions were no always properly resolved - don't load in the old item ids
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
ze = MyImpxZipFile.GetEntry("contents.xml");
|
ze = MyImpxZipFile["contents.xml"];
|
||||||
|
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
||||||
fn = PEIPath + @"\contents.xml";
|
fn = PEIPath + @"\contents.xml";
|
||||||
ze.ExtractToFile(fn, true);
|
|
||||||
xd = new XmlDocument();
|
xd = new XmlDocument();
|
||||||
xd.Load(fn);
|
xd.Load(fn);
|
||||||
// B2016-176, B2016-197 Transitions were no always properly resolved - don't load in the old content ids
|
// B2016-176, B2016-197 Transitions were no always properly resolved - don't load in the old content ids
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
ze = MyImpxZipFile.GetEntry("libdocs.xml");
|
ze = MyImpxZipFile["libdocs.xml"];
|
||||||
|
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
||||||
fn = PEIPath + @"\libdocs.xml";
|
fn = PEIPath + @"\libdocs.xml";
|
||||||
ze.ExtractToFile(fn, true);
|
|
||||||
xd = new XmlDocument();
|
xd = new XmlDocument();
|
||||||
xd.Load(fn);
|
xd.Load(fn);
|
||||||
XmlNodeList nl = xd.SelectNodes("//libdoc");
|
XmlNodeList nl = xd.SelectNodes("//libdoc");
|
||||||
@@ -1353,9 +1344,9 @@ namespace VEPROMS
|
|||||||
Old2NewLibDoc.Add(oldid, newid);
|
Old2NewLibDoc.Add(oldid, newid);
|
||||||
}
|
}
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
ze = MyImpxZipFile.GetEntry("transitions.xml");
|
ze = MyImpxZipFile["transitions.xml"];
|
||||||
|
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
||||||
fn = PEIPath + @"\transitions.xml";
|
fn = PEIPath + @"\transitions.xml";
|
||||||
ze.ExtractToFile(fn, true);
|
|
||||||
PendingTransitions.Load(fn);
|
PendingTransitions.Load(fn);
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
}
|
}
|
||||||
@@ -1383,53 +1374,53 @@ namespace VEPROMS
|
|||||||
else
|
else
|
||||||
dn = fi.Name.Substring(0, fi.Name.IndexOf("."));
|
dn = fi.Name.Substring(0, fi.Name.IndexOf("."));
|
||||||
txtImport.Text = ofd.FileName;
|
txtImport.Text = ofd.FileName;
|
||||||
MyExpZipFileName = txtImport.Text;
|
ReadOptions ro = new ReadOptions();
|
||||||
string fn = string.Format(@"{0}\{1}.impx", PEIPath, dn);
|
ro.Encoding = Encoding.UTF8;
|
||||||
MyImpZipFileName = fn;
|
MyExpxZipFile = ZipFile.Read(txtImport.Text, ro);
|
||||||
if (File.Exists(fn))
|
string fn = string.Format(@"{0}\{1}.impx", PEIPath, dn);
|
||||||
|
if (File.Exists(fn))
|
||||||
{
|
{
|
||||||
using (ZipArchive MyImpxZipFile = ZipFile.OpenRead(fn))
|
MyImpxZipFile = ZipFile.Read(fn, ro);
|
||||||
ReadTransitionAndItemContentIDs(MyImpxZipFile);
|
ReadTransitionAndItemContentIDs();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
using (FileStream zipToOpen = new FileStream(fn, FileMode.OpenOrCreate))
|
MyImpxZipFile = new ZipFile(fn, Encoding.UTF8);
|
||||||
{
|
//transitions
|
||||||
using (ZipArchive MyImpxZipFile = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
|
XmlElement xe = PendingTransitions.CreateElement("transitions");
|
||||||
{
|
PendingTransitions.AppendChild(xe);
|
||||||
//transitions
|
fn = PEIPath + @"\transitions.xml";
|
||||||
XmlElement xe = PendingTransitions.CreateElement("transitions");
|
PendingTransitions.Save(fn);
|
||||||
PendingTransitions.AppendChild(xe);
|
MyImpxZipFile.AddFile(fn, "");
|
||||||
fn = PEIPath + @"\transitions.xml";
|
MyImpxZipFile.Save();
|
||||||
PendingTransitions.Save(fn);
|
File.Delete(fn);
|
||||||
_ = MyImpxZipFile.CreateEntryFromFile(fn, Path.GetFileName(fn));
|
//itemids
|
||||||
File.Delete(fn);
|
XmlDocument xd = new XmlDocument();
|
||||||
//itemids
|
xe = xd.CreateElement("items");
|
||||||
XmlDocument xd = new XmlDocument();
|
xd.AppendChild(xe);
|
||||||
xe = xd.CreateElement("items");
|
fn = PEIPath + @"\items.xml";
|
||||||
xd.AppendChild(xe);
|
xd.Save(fn);
|
||||||
fn = PEIPath + @"\items.xml";
|
MyImpxZipFile.AddFile(fn, "");
|
||||||
xd.Save(fn);
|
MyImpxZipFile.Save();
|
||||||
_ = MyImpxZipFile.CreateEntryFromFile(fn, Path.GetFileName(fn));
|
File.Delete(fn);
|
||||||
File.Delete(fn);
|
//contentids
|
||||||
//contentids
|
xd = new XmlDocument();
|
||||||
xd = new XmlDocument();
|
xe = xd.CreateElement("contents");
|
||||||
xe = xd.CreateElement("contents");
|
xd.AppendChild(xe);
|
||||||
xd.AppendChild(xe);
|
fn = PEIPath + @"\contents.xml";
|
||||||
fn = PEIPath + @"\contents.xml";
|
xd.Save(fn);
|
||||||
xd.Save(fn);
|
MyImpxZipFile.AddFile(fn, "");
|
||||||
_ = MyImpxZipFile.CreateEntryFromFile(fn, Path.GetFileName(fn));
|
MyImpxZipFile.Save();
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
//libdocids
|
//libdocids
|
||||||
xd = new XmlDocument();
|
xd = new XmlDocument();
|
||||||
xe = xd.CreateElement("libdocs");
|
xe = xd.CreateElement("libdocs");
|
||||||
xd.AppendChild(xe);
|
xd.AppendChild(xe);
|
||||||
fn = PEIPath + @"\libdocs.xml";
|
fn = PEIPath + @"\libdocs.xml";
|
||||||
xd.Save(fn);
|
xd.Save(fn);
|
||||||
_ = MyImpxZipFile.CreateEntryFromFile(fn, Path.GetFileName(fn));
|
MyImpxZipFile.AddFile(fn, "");
|
||||||
File.Delete(fn);
|
MyImpxZipFile.Save();
|
||||||
}
|
File.Delete(fn);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MyDocVersion != null)
|
if (MyDocVersion != null)
|
||||||
@@ -1604,31 +1595,27 @@ namespace VEPROMS
|
|||||||
ExportAssociation(xe, ai, "association");
|
ExportAssociation(xe, ai, "association");
|
||||||
string fn = PEIPath + @"\folder.xml";
|
string fn = PEIPath + @"\folder.xml";
|
||||||
xn.OwnerDocument.Save(fn);
|
xn.OwnerDocument.Save(fn);
|
||||||
using (FileStream zipToOpen = new FileStream(MyExpZipFileName, FileMode.OpenOrCreate))
|
MyExpxZipFile.AddFile(fn, "folder");
|
||||||
|
MyExpxZipFile.Save();
|
||||||
|
File.Delete(fn);
|
||||||
|
//here
|
||||||
|
lblExportStatus.Text = "Exporting Procedures...";
|
||||||
|
Application.DoEvents();
|
||||||
|
if (dvi.Procedures.Count > 0)
|
||||||
{
|
{
|
||||||
using (ZipArchive MyExpxZipFile = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
|
pbExportProcedure.Value = 0;
|
||||||
{
|
pbExportProcedure.Maximum = dvi.Procedures.Count;
|
||||||
_ = MyExpxZipFile.CreateEntryFromFile(fn, $"folder/{Path.GetFileName(fn)}");
|
lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures";
|
||||||
|
foreach (ItemInfo ii in dvi.Procedures)
|
||||||
|
{
|
||||||
|
XmlDocument xd = new XmlDocument();
|
||||||
|
ExportItem(xd, ii, "procedure");
|
||||||
|
fn = string.Format(@"{0}\proc{1}.xml", PEIPath, pbExportProcedure.Value.ToString().PadLeft(4, '0'));
|
||||||
|
xd.Save(fn);
|
||||||
|
MyExpxZipFile.AddFile(fn, "procedures");
|
||||||
|
MyExpxZipFile.Save();
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
//here
|
xd = null;
|
||||||
lblExportStatus.Text = "Exporting Procedures...";
|
|
||||||
Application.DoEvents();
|
|
||||||
if (dvi.Procedures.Count > 0)
|
|
||||||
{
|
|
||||||
pbExportProcedure.Value = 0;
|
|
||||||
pbExportProcedure.Maximum = dvi.Procedures.Count;
|
|
||||||
lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures";
|
|
||||||
foreach (ItemInfo ii in dvi.Procedures)
|
|
||||||
{
|
|
||||||
XmlDocument xd = new XmlDocument();
|
|
||||||
ExportItem(xd, ii, "procedure");
|
|
||||||
fn = string.Format(@"{0}\proc{1}.xml", PEIPath, pbExportProcedure.Value.ToString().PadLeft(4, '0'));
|
|
||||||
xd.Save(fn);
|
|
||||||
_ = MyExpxZipFile.CreateEntryFromFile(fn, $"procedures/{Path.GetFileName(fn)}");
|
|
||||||
File.Delete(fn);
|
|
||||||
xd = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1852,14 +1839,12 @@ namespace VEPROMS
|
|||||||
//and handled/overridden in dlgExportEP.cs
|
//and handled/overridden in dlgExportEP.cs
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void SetEPEnhancedDocLinks(ref XmlElement xe, ItemInfo ii)
|
protected virtual void SetROLocation(ref XmlElement xindivid, ROFSTLookup.rochild roc, RODbInfo rodb, bool isMulti)
|
||||||
{
|
{
|
||||||
//do nothing - this will be for Electronic procedures only
|
//do nothing - this will be for Electronic procedures only
|
||||||
//and handled/overridden in dlgExportEP.cs
|
//and handled/overridden in dlgExportEP.cs
|
||||||
}
|
}
|
||||||
|
protected virtual void SetEPEnhancedDocLinks(ref XmlElement xe, ItemInfo ii)
|
||||||
|
|
||||||
protected virtual void SetROLocation(ref XmlElement xindivid, ROFSTLookup.rochild roc, RODbInfo rodb, bool isMulti)
|
|
||||||
{
|
{
|
||||||
//do nothing - this will be for Electronic procedures only
|
//do nothing - this will be for Electronic procedures only
|
||||||
//and handled/overridden in dlgExportEP.cs
|
//and handled/overridden in dlgExportEP.cs
|
||||||
|
@@ -839,7 +839,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
using (SqlCommand cmd = cn.CreateCommand())
|
using (SqlCommand cmd = cn.CreateCommand())
|
||||||
{
|
{
|
||||||
cmd.CommandTimeout = 0;
|
cmd.CommandTimeout = Database.DefaultTimeout;
|
||||||
cmd.CommandType = CommandType.StoredProcedure;
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
cmd.CommandText = "vesp_RofstHeaderFinalizeLoad";
|
cmd.CommandText = "vesp_RofstHeaderFinalizeLoad";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user