C2025-024 #590

Merged
jjenko merged 18 commits from C2025-024 into Development 2025-08-08 10:19:00 -04:00
52 changed files with 2226 additions and 4210 deletions
Showing only changes of commit d7f83fa4d4 - Show all commits

View File

@@ -155,18 +155,15 @@ 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) if (sfd.ShowDialog(this) == DialogResult.OK && sfd.FileName != string.Empty)
{ {
if (sfd.FileName != string.Empty) txtExport.Text = sfd.FileName;
{ if (File.Exists(txtExport.Text))
txtExport.Text = sfd.FileName; File.Delete(txtExport.Text);
if (File.Exists(txtExport.Text)) MyExpxZipFile = new ZipFile(txtExport.Text, Encoding.UTF8);
File.Delete(txtExport.Text); MyExpxZipFile.Save();
MyExpxZipFile = new ZipFile(txtExport.Text, Encoding.UTF8); }
MyExpxZipFile.Save(); }
}
}
}
else if (MyProcedure != null) else if (MyProcedure != null)
{ {
txtExport.Enabled = true; txtExport.Enabled = true;
@@ -1330,76 +1327,70 @@ namespace VEPROMS
txtImport.Text = ofd.FileName; txtImport.Text = ofd.FileName;
return; return;
} }
if (MyFolder != null) if (MyFolder != null && ofd.ShowDialog(this) == DialogResult.OK && ofd.FileName != string.Empty)
{ {
if (ofd.ShowDialog(this) == DialogResult.OK) Old2NewItem = new Dictionary<int, int>();
{ Old2NewContent = new Dictionary<int, int>();
if (ofd.FileName != string.Empty) Old2NewLibDoc = new Dictionary<int, int>();
{ GetExistingLibDocsList(); // B2019-035 better memory management
Old2NewItem = new Dictionary<int, int>(); PendingTransitions = new XmlDocument();
Old2NewContent = new Dictionary<int, int>(); FileInfo fi = new FileInfo(ofd.FileName);
Old2NewLibDoc = new Dictionary<int, int>(); string dn;
GetExistingLibDocsList(); // B2019-035 better memory management if (fi.Name.IndexOf("-") > 0)
PendingTransitions = new XmlDocument(); dn = fi.Name.Substring(0, fi.Name.IndexOf("-"));
FileInfo fi = new FileInfo(ofd.FileName); else
string dn; dn = fi.Name.Substring(0, fi.Name.IndexOf("."));
if (fi.Name.IndexOf("-") > 0) txtImport.Text = ofd.FileName;
dn = fi.Name.Substring(0, fi.Name.IndexOf("-")); ReadOptions ro = new ReadOptions();
else ro.Encoding = Encoding.UTF8;
dn = fi.Name.Substring(0, fi.Name.IndexOf(".")); MyExpxZipFile = ZipFile.Read(txtImport.Text, ro);
txtImport.Text = ofd.FileName; string fn = string.Format(@"{0}\{1}.impx", PEIPath, dn);
ReadOptions ro = new ReadOptions(); if (File.Exists(fn))
ro.Encoding = Encoding.UTF8; {
MyExpxZipFile = ZipFile.Read(txtImport.Text, ro); MyImpxZipFile = ZipFile.Read(fn, ro);
string fn = string.Format(@"{0}\{1}.impx", PEIPath, dn); ReadTransitionAndItemContentIDs();
if (File.Exists(fn)) }
{ else
MyImpxZipFile = ZipFile.Read(fn, ro); {
ReadTransitionAndItemContentIDs(); MyImpxZipFile = new ZipFile(fn, Encoding.UTF8);
} //transitions
else XmlElement xe = PendingTransitions.CreateElement("transitions");
{ PendingTransitions.AppendChild(xe);
MyImpxZipFile = new ZipFile(fn, Encoding.UTF8); fn = PEIPath + @"\transitions.xml";
//transitions PendingTransitions.Save(fn);
XmlElement xe = PendingTransitions.CreateElement("transitions"); MyImpxZipFile.AddFile(fn, "");
PendingTransitions.AppendChild(xe); MyImpxZipFile.Save();
fn = PEIPath + @"\transitions.xml"; File.Delete(fn);
PendingTransitions.Save(fn); //itemids
MyImpxZipFile.AddFile(fn, ""); XmlDocument xd = new XmlDocument();
MyImpxZipFile.Save(); xe = xd.CreateElement("items");
File.Delete(fn); xd.AppendChild(xe);
//itemids fn = PEIPath + @"\items.xml";
XmlDocument xd = new XmlDocument(); xd.Save(fn);
xe = xd.CreateElement("items"); MyImpxZipFile.AddFile(fn, "");
xd.AppendChild(xe); MyImpxZipFile.Save();
fn = PEIPath + @"\items.xml"; File.Delete(fn);
xd.Save(fn); //contentids
MyImpxZipFile.AddFile(fn, ""); xd = new XmlDocument();
MyImpxZipFile.Save(); xe = xd.CreateElement("contents");
File.Delete(fn); xd.AppendChild(xe);
//contentids fn = PEIPath + @"\contents.xml";
xd = new XmlDocument(); xd.Save(fn);
xe = xd.CreateElement("contents"); MyImpxZipFile.AddFile(fn, "");
xd.AppendChild(xe); MyImpxZipFile.Save();
fn = PEIPath + @"\contents.xml"; File.Delete(fn);
xd.Save(fn); //libdocids
MyImpxZipFile.AddFile(fn, ""); xd = new XmlDocument();
MyImpxZipFile.Save(); xe = xd.CreateElement("libdocs");
File.Delete(fn); xd.AppendChild(xe);
//libdocids fn = PEIPath + @"\libdocs.xml";
xd = new XmlDocument(); xd.Save(fn);
xe = xd.CreateElement("libdocs"); MyImpxZipFile.AddFile(fn, "");
xd.AppendChild(xe); MyImpxZipFile.Save();
fn = PEIPath + @"\libdocs.xml"; File.Delete(fn);
xd.Save(fn); }
MyImpxZipFile.AddFile(fn, ""); }
MyImpxZipFile.Save(); if (MyDocVersion != null)
File.Delete(fn);
}
}
}
}
if (MyDocVersion != null)
{ {
ofd.Filter = "PROMS Procedure Export Files|*.pxml"; ofd.Filter = "PROMS Procedure Export Files|*.pxml";
if (ofd.ShowDialog(this) == DialogResult.OK) if (ofd.ShowDialog(this) == DialogResult.OK)
@@ -2223,16 +2214,9 @@ namespace VEPROMS
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ri.RODbID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ri.RODbID.ToString()));
if (_ExportBothConvertedandNot) SetROLocation(ref xe, ri.ROID, ri.RODbID); if (_ExportBothConvertedandNot) SetROLocation(ref xe, ri.ROID, ri.RODbID);
//rousage audits
ExportROUsageAudits(xe, ri);
xn.AppendChild(xe); xn.AppendChild(xe);
} }
private void ExportROUsageAudits(XmlElement xe, RoUsageInfo ri)
{
if (cbxExportAudits.Checked) { };
}
private void ExportPart(XmlElement xn, PartInfo pi, string nodename) private void ExportPart(XmlElement xn, PartInfo pi, string nodename)
{ {
/* /*
@@ -2309,16 +2293,9 @@ namespace VEPROMS
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ti.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ti.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ti.UserID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ti.UserID.ToString()));
//transition audits
ExportTransitionAudits(xe, ti);
xn.AppendChild(xe); xn.AppendChild(xe);
} }
private void ExportTransitionAudits(XmlElement xe, TransitionInfo ti)
{
if (cbxExportAudits.Checked) { };
}
private void ExportAnnotation(XmlElement xn, AnnotationInfo ai, string nodename) private void ExportAnnotation(XmlElement xn, AnnotationInfo ai, string nodename)
{ {
/* /*
@@ -2813,15 +2790,11 @@ namespace VEPROMS
{ {
// create a list of the RO databases currently in the database // create a list of the RO databases currently in the database
List<string> roDbNameList = new List<string>(); List<string> roDbNameList = new List<string>();
RODbInfoList rolist = RODbInfoList.Get(); using (RODbInfoList rolist = RODbInfoList.Get())
{
roDbNameList.AddRange(rolist.Where(rodbinfo => !roDbNameList.Contains(rodbinfo.ROName)).Select(rodbinfo => rodbinfo.ROName));
}
foreach (RODbInfo rodbinfo in rolist)
{
if (!roDbNameList.Contains(rodbinfo.ROName))
roDbNameList.Add(rodbinfo.ROName);
}
rolist.Dispose();
int cnt = 0; int cnt = 0;
string roNameNew = roname; string roNameNew = roname;