logic to save word sections with resolved RO values for exporting the approved procedure

logic to create an export file with unlinked RO and Transition
Commented out debug statements to help evaluate memory usage
This commit is contained in:
John Jenko 2016-02-18 15:29:25 +00:00
parent 6ae1fcda1a
commit 8cd75c0c14
7 changed files with 820 additions and 734 deletions

View File

@ -1103,6 +1103,7 @@ namespace VEPROMS
frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true,"",false,false); frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true,"",false,false);
frm.AllowAllWatermarks = true; frm.AllowAllWatermarks = true;
frm.CloseWhenDone = !ViewPDF; frm.CloseWhenDone = !ViewPDF;
frm.DocReplace = new Dictionary<int, byte[]>(); // will hold the Word Attachments with resolved ROs
frm.ShowDialog(); frm.ShowDialog();
//if (ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0) //if (ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
//{ //{
@ -1139,9 +1140,11 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
if (si.IsApproved == 1) if (si.IsApproved == 1)
{ {
dlgExportImport dlg = new dlgExportImport("Export", pi); dlgExportImport dlg = new dlgExportImport("Export", pi); // "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(); System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
dlg.ExportItem(xd, pi, "procedure"); dlg.ExportItem(xd, pi, "procedure");
frm.DocReplace = dlg.DocReplace = null;
version.ApprovedXML = xd.OuterXml; version.ApprovedXML = xd.OuterXml;
version.Save(); version.Save();
dlg.Dispose(); dlg.Dispose();

View File

@ -14,7 +14,8 @@ using Ionic.Zip;
namespace VEPROMS namespace VEPROMS
{ {
public partial class dlgExportImport : Form public partial class dlgExportImport : Form
{ {
private bool _ConvertROsAndTransitionsToText = false; // set to true when Approval creates an Export file
private ItemInfo _ExternalTransitionItem = null; private ItemInfo _ExternalTransitionItem = null;
public ItemInfo ExternalTransitionItem public ItemInfo ExternalTransitionItem
{ {
@ -527,195 +528,196 @@ namespace VEPROMS
if (!dicItemDepth.ContainsKey(depth)) dicItemDepth.Add(depth, 0); if (!dicItemDepth.ContainsKey(depth)) dicItemDepth.Add(depth, 0);
dicItemDepth[depth] = id; dicItemDepth[depth] = id;
} }
private void LoadImportDataReader() // jsj 2016Feb17 - this appears to not be used
{ //private void LoadImportDataReader()
int pCount = 0; //{
int sCount = 0; // int pCount = 0;
Folder folder = null; // int sCount = 0;
DocVersion docversion = null; // Folder folder = null;
Dictionary<string, string> dicRofst = null; // DocVersion docversion = null;
Dictionary<string, string> dicEntry = null; // Dictionary<string, string> dicRofst = null;
ROFst rofst = null; // Dictionary<string, string> dicEntry = null;
GetImportDataCounts(); // ROFst rofst = null;
pbImportProcedure.Maximum = MyCounts.Count; // GetImportDataCounts();
pbImportProcedure.Value = 0; // pbImportProcedure.Maximum = MyCounts.Count;
Application.DoEvents(); // pbImportProcedure.Value = 0;
FileStream fs = File.OpenRead(txtImport.Text); // Application.DoEvents();
XmlReaderSettings rs = new XmlReaderSettings(); // FileStream fs = File.OpenRead(txtImport.Text);
rs.CheckCharacters = false; // XmlReaderSettings rs = new XmlReaderSettings();
XmlReader xr = XmlReader.Create(fs, rs); // rs.CheckCharacters = false;
while (xr.Read()) // XmlReader xr = XmlReader.Create(fs, rs);
{ // while (xr.Read())
if (xr.IsStartElement()) // {
{ // if (xr.IsStartElement())
switch (xr.Name) // {
{ // switch (xr.Name)
case "annotation": // {
AddAnnotation(xr); // case "annotation":
break; // AddAnnotation(xr);
//case "association": // break;
// break; // //case "association":
case "content": // // break;
{ // case "content":
if (xr.Depth == 3) //content for procedure // {
{ // if (xr.Depth == 3) //content for procedure
ItemInfo ii = AddProcedure(xr, docversion, dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); // {
UpdatePreviousItem(xr.Depth, ii); // ItemInfo ii = AddProcedure(xr, docversion, dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]);
UpdateParentItem(xr.Depth, ii); // UpdatePreviousItem(xr.Depth, ii);
} // UpdateParentItem(xr.Depth, ii);
else // }
{ // else
// {
int fromtype = dicItemDepth.ContainsKey(xr.Depth - 2) ? dicItemDepth[xr.Depth - 2] : 0; // int fromtype = dicItemDepth.ContainsKey(xr.Depth - 2) ? dicItemDepth[xr.Depth - 2] : 0;
switch (fromtype) // switch (fromtype)
{ // {
case 2: // case 2:
{ //sections // { //sections
ItemInfo ii = AddSection(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); // ItemInfo ii = AddSection(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]);
UpdatePreviousItem(xr.Depth, ii); // UpdatePreviousItem(xr.Depth, ii);
UpdateParentItem(xr.Depth, ii); // UpdateParentItem(xr.Depth, ii);
break; // break;
} // }
case 3: // case 3:
{ //cautions // { //cautions
ItemInfo ii = AddCaution(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); // ItemInfo ii = AddCaution(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]);
UpdatePreviousItem(xr.Depth, ii); // UpdatePreviousItem(xr.Depth, ii);
UpdateParentItem(xr.Depth, ii); // UpdateParentItem(xr.Depth, ii);
break; // break;
} // }
case 4: // case 4:
{ //notes // { //notes
ItemInfo ii = AddNote(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); // ItemInfo ii = AddNote(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]);
UpdatePreviousItem(xr.Depth, ii); // UpdatePreviousItem(xr.Depth, ii);
UpdateParentItem(xr.Depth, ii); // UpdateParentItem(xr.Depth, ii);
break; // break;
} // }
case 5: // case 5:
{ //rnos // { //rnos
ItemInfo ii = AddRNO(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); // ItemInfo ii = AddRNO(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]);
UpdatePreviousItem(xr.Depth, ii); // UpdatePreviousItem(xr.Depth, ii);
UpdateParentItem(xr.Depth, ii); // UpdateParentItem(xr.Depth, ii);
break; // break;
} // }
case 6: // case 6:
{ //steps // { //steps
ItemInfo ii = AddStep(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); // ItemInfo ii = AddStep(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]);
UpdatePreviousItem(xr.Depth, ii); // UpdatePreviousItem(xr.Depth, ii);
UpdateParentItem(xr.Depth, ii); // UpdateParentItem(xr.Depth, ii);
break; // break;
} // }
case 7: // case 7:
{ //tables // { //tables
ItemInfo ii = AddTable(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); // ItemInfo ii = AddTable(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]);
UpdatePreviousItem(xr.Depth, ii); // UpdatePreviousItem(xr.Depth, ii);
UpdateParentItem(xr.Depth, ii); // UpdateParentItem(xr.Depth, ii);
break; // break;
} // }
default: // default:
break; // break;
} // }
} // }
break; // break;
} // }
case "document": // case "document":
AddDocument(xr, dicEntry); // AddDocument(xr, dicEntry);
break; // break;
case "docversion": // case "docversion":
{ // {
docversion = AddDocVersion(folder, xr); // docversion = AddDocVersion(folder, xr);
UpdatePreviousItem(xr.Depth + 2, null); // UpdatePreviousItem(xr.Depth + 2, null);
break; // break;
} // }
case "entry": // case "entry":
dicEntry = AddEntry(xr); // dicEntry = AddEntry(xr);
break; // break;
case "folder": // case "folder":
folder = AddFolder(Folder.Get(MyFolder.FolderID), xr); // folder = AddFolder(Folder.Get(MyFolder.FolderID), xr);
break; // break;
case "grid": // case "grid":
AddGrid(xr); // AddGrid(xr);
break; // break;
case "procedure": // case "procedure":
{ // {
UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid")));
pbImportProcedure.PerformStep(); // pbImportProcedure.PerformStep();
lblImportProcedure.Text = string.Format("{0} of {1} Procedures", pbImportProcedure.Value.ToString(), pbImportProcedure.Maximum.ToString()); // lblImportProcedure.Text = string.Format("{0} of {1} Procedures", pbImportProcedure.Value.ToString(), pbImportProcedure.Maximum.ToString());
pCount++; // pCount++;
pbImportSection.Maximum = MyCounts[pCount].Count; // pbImportSection.Maximum = MyCounts[pCount].Count;
pbImportSection.Value = 0; // pbImportSection.Value = 0;
sCount = 0; // sCount = 0;
Application.DoEvents(); // Application.DoEvents();
break; // break;
} // }
case "section": // case "section":
{ // {
UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid")));
pbImportSection.PerformStep(); // pbImportSection.PerformStep();
lblImportSection.Text = string.Format("{0} of {1} Sections", pbImportSection.Value.ToString(), pbImportSection.Maximum.ToString()); // lblImportSection.Text = string.Format("{0} of {1} Sections", pbImportSection.Value.ToString(), pbImportSection.Maximum.ToString());
sCount++; // sCount++;
pbImportStep.Maximum = MyCounts[pCount][sCount]; // pbImportStep.Maximum = MyCounts[pCount][sCount];
pbImportStep.Value = 0; // pbImportStep.Value = 0;
Application.DoEvents(); // Application.DoEvents();
break; // break;
} // }
case "step": // case "step":
{ // {
UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid")));
if (xr.Depth == 8) // if (xr.Depth == 8)
{ // {
pbImportStep.PerformStep(); // pbImportStep.PerformStep();
lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); // lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString());
Application.DoEvents(); // Application.DoEvents();
} // }
break; // break;
} // }
case "caution": // case "caution":
case "note": // case "note":
case "rno": // case "rno":
case "table": // case "table":
UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid")));
break; // break;
case "cautions": // case "cautions":
case "notes": // case "notes":
case "rnos": // case "rnos":
case "sections": // case "sections":
case "steps": // case "steps":
case "tables": // case "tables":
{ // {
UpdateItemDepth(xr.Depth, int.Parse(xr.GetAttribute("fromtype"))); // UpdateItemDepth(xr.Depth, int.Parse(xr.GetAttribute("fromtype")));
UpdatePreviousItem(xr.Depth + 2, null); // UpdatePreviousItem(xr.Depth + 2, null);
UpdateParentItem(xr.Depth + 2, dicParentItem[xr.Depth - 1]); // UpdateParentItem(xr.Depth + 2, dicParentItem[xr.Depth - 1]);
break; // break;
} // }
case "rodb": // case "rodb":
{ // {
MyRODb = AddRODb(xr); // MyRODb = AddRODb(xr);
rofst = AddROFst(dicRofst); // rofst = AddROFst(dicRofst);
docversion.DocVersionAssociations.Add(rofst); // docversion.DocVersionAssociations.Add(rofst);
docversion.Save(); // docversion.Save();
break; // break;
} // }
case "rofst": // case "rofst":
dicRofst = GetROFstData(xr); // dicRofst = GetROFstData(xr);
break; // break;
case "rousage": // case "rousage":
AddROUsage(xr); // AddROUsage(xr);
break; // break;
//case "transition": // //case "transition":
// break; // // break;
default: // default:
break; // break;
} // }
Console.WriteLine("{0} - {1}", xr.Name, xr.Depth.ToString()); // Console.WriteLine("{0} - {1}", xr.Name, xr.Depth.ToString());
} // }
} // }
pbImportProcedure.PerformStep(); // pbImportProcedure.PerformStep();
Application.DoEvents(); // Application.DoEvents();
fs.Close(); // fs.Close();
FixImportDataTransitions(); // FixImportDataTransitions();
StoreItemContentIDs(); // StoreItemContentIDs();
ResolveExternalTransitions(folder); // ResolveExternalTransitions(folder);
} //}
private void SaveTransitionAndItemContentIDs() private void SaveTransitionAndItemContentIDs()
{ {
XmlDocument xd = new XmlDocument(); XmlDocument xd = new XmlDocument();
@ -1091,9 +1093,7 @@ namespace VEPROMS
{ {
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)
{
txtImport.Text = ofd.FileName; txtImport.Text = ofd.FileName;
}
} }
} }
private void txtImport_TextChanged(object sender, EventArgs e) private void txtImport_TextChanged(object sender, EventArgs e)
@ -1574,6 +1574,17 @@ namespace VEPROMS
} }
} }
} }
// used to save word sections with resolved ROs (export generated from Approve)
private Dictionary<int, byte[]> _DocReplace;
public Dictionary<int, byte[]> DocReplace
{
get { return _DocReplace; }
set
{
_DocReplace = value;
_ConvertROsAndTransitionsToText = (value != null);
}
}
private void ExportItem(ItemInfo ii, string nodename) private void ExportItem(ItemInfo ii, string nodename)
{ {
/* /*
@ -1630,9 +1641,11 @@ namespace VEPROMS
UserID UserID
*/ */
XmlElement xe = xn.OwnerDocument.CreateElement(nodename); XmlElement xe = xn.OwnerDocument.CreateElement(nodename);
// strip the link information if we are convertingthe RO and Transitions to text
string ciText = (_ConvertROsAndTransitionsToText)?ItemInfo.StripLinks(ci.Text):ci.Text;
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ci.ContentID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ci.ContentID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "number", ci.Number)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "number", ci.Number));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "text", ci.Text)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "text", ciText));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "type", ci.Type.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "type", ci.Type.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", ci.FormatID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", ci.FormatID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ci.Config)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ci.Config));
@ -1697,10 +1710,12 @@ namespace VEPROMS
DTS DTS
UserID UserID
*/ */
// strip the link information if we are convertinga the ROs and Transitions to text
string ciText = (_ConvertROsAndTransitionsToText) ? ItemInfo.StripLinks(ci.Text) : ci.Text;
MyWriter.WriteStartElement(nodename); MyWriter.WriteStartElement(nodename);
MyWriter.WriteAttributeString("contentid", ci.ContentID.ToString()); MyWriter.WriteAttributeString("contentid", ci.ContentID.ToString());
MyWriter.WriteAttributeString("number", ci.Number); MyWriter.WriteAttributeString("number", ci.Number);
MyWriter.WriteAttributeString("text", ci.Text); MyWriter.WriteAttributeString("text", ciText);
MyWriter.WriteAttributeString("type", ci.Type.ToString()); MyWriter.WriteAttributeString("type", ci.Type.ToString());
MyWriter.WriteAttributeString("formatid", ci.FormatID.ToString()); MyWriter.WriteAttributeString("formatid", ci.FormatID.ToString());
MyWriter.WriteAttributeString("config", ci.Config); MyWriter.WriteAttributeString("config", ci.Config);
@ -1730,9 +1745,15 @@ namespace VEPROMS
DTS DTS
UserID UserID
*/ */
string giData = gi.Data;
if (_ConvertROsAndTransitionsToText)
{
giData = giData.Replace("<IsRoTable>True", "<IsRoTable>False"); // converts a RO table to a unlinked regular table
giData = ItemInfo.StripLinks(giData); // this converts ROs and transitions to text
}
XmlElement xe = xn.OwnerDocument.CreateElement(nodename); XmlElement xe = xn.OwnerDocument.CreateElement(nodename);
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", gi.ContentID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", gi.ContentID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "data", gi.Data)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "data", giData));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", gi.Config)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", gi.Config));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", gi.UserID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", gi.UserID.ToString()));
@ -1777,9 +1798,15 @@ namespace VEPROMS
DTS DTS
UserID UserID
*/ */
string giData = gi.Data;
if (_ConvertROsAndTransitionsToText)
{
giData = giData.Replace("IsRoTable&gtTrue", "IsRoTable&gt;False"); // converts a RO table to regular table
giData = ItemInfo.StripLinks(giData); // converts ROs and Transitions to text
}
MyWriter.WriteStartElement(nodename); MyWriter.WriteStartElement(nodename);
MyWriter.WriteAttributeString("contentid", gi.ContentID.ToString()); MyWriter.WriteAttributeString("contentid", gi.ContentID.ToString());
MyWriter.WriteAttributeString("data", gi.Data); MyWriter.WriteAttributeString("data", giData);
MyWriter.WriteAttributeString("config", gi.Config); MyWriter.WriteAttributeString("config", gi.Config);
MyWriter.WriteAttributeString("dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); MyWriter.WriteAttributeString("dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"));
MyWriter.WriteAttributeString("userid", gi.UserID.ToString()); MyWriter.WriteAttributeString("userid", gi.UserID.ToString());
@ -1856,10 +1883,17 @@ namespace VEPROMS
UserID UserID
FileExtension FileExtension
*/ */
byte[] buf = di.DocContent;
string libDocTitle = di.LibTitle;
if (DocReplace != null && DocReplace.ContainsKey(di.DocID) && _ConvertROsAndTransitionsToText)
{
buf = DocReplace[di.DocID];
libDocTitle = null; // unlink the word section from the library document
}
XmlElement xe = xn.OwnerDocument.CreateElement(nodename); XmlElement xe = xn.OwnerDocument.CreateElement(nodename);
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docid", di.DocID.ToString())); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docid", di.DocID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "libtitle", di.LibTitle)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "libtitle", libDocTitle)); // di.LibTitle));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "doccontent", Convert.ToBase64String(di.DocContent))); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "doccontent", Convert.ToBase64String(buf)));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docascii", di.DocAscii)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docascii", di.DocAscii));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", di.Config)); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", di.Config));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")));
@ -1910,10 +1944,17 @@ namespace VEPROMS
UserID UserID
FileExtension FileExtension
*/ */
byte[] buf = di.DocContent;
string libDocTitle = di.LibTitle;
if (DocReplace != null && DocReplace.ContainsKey(di.DocID) && _ConvertROsAndTransitionsToText)
{
buf = DocReplace[di.DocID];
libDocTitle = null; // unlink the word section from the library document
}
MyWriter.WriteStartElement(nodename); MyWriter.WriteStartElement(nodename);
MyWriter.WriteAttributeString("docid", di.DocID.ToString()); MyWriter.WriteAttributeString("docid", di.DocID.ToString());
MyWriter.WriteAttributeString("libtitle", di.LibTitle); MyWriter.WriteAttributeString("libtitle", libDocTitle);// di.LibTitle);
MyWriter.WriteAttributeString("doccontent", Convert.ToBase64String(di.DocContent)); MyWriter.WriteAttributeString("doccontent", Convert.ToBase64String(buf));
MyWriter.WriteAttributeString("docascii", di.DocAscii); MyWriter.WriteAttributeString("docascii", di.DocAscii);
MyWriter.WriteAttributeString("config", di.Config); MyWriter.WriteAttributeString("config", di.Config);
MyWriter.WriteAttributeString("dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); MyWriter.WriteAttributeString("dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"));
@ -2246,69 +2287,69 @@ namespace VEPROMS
cc.Text = cc.Text.Replace(lookfor, replacewith); cc.Text = cc.Text.Replace(lookfor, replacewith);
cc.Save(); cc.Save();
} }
private void AddTransitions(Content content, XmlNode xn) private void AddTransitions(Content content, XmlNode xn)
{ {
/* /*
Content Content
Item Item
Item Item
int int
int int
string string
dts dts
string string
<transition transitionid="1" fromid="186" toid="175" rangeid="177" isrange="1" trantype="2" config="" dts="4/11/1997 1:20:00 PM" userid="MH" /> <transition transitionid="1" fromid="186" toid="175" rangeid="177" isrange="1" trantype="2" config="" dts="4/11/1997 1:20:00 PM" userid="MH" />
#Link:Transition:1 2 187 #Link:Transition:1 2 187
type,id,toid type,id,toid
#Link:TransitionRange:2 1 175 177 #Link:TransitionRange:2 1 175 177
type,id,toid,rangeid type,id,toid,rangeid
*/ */
XmlNodeList nl = xn.SelectNodes("./transition"); XmlNodeList nl = xn.SelectNodes("./transition");
foreach (XmlNode nd in nl) foreach (XmlNode nd in nl)
{ {
int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText); int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText);
int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText); int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText);
if (Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid)) if (Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid))
{ {
int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText);
int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText);
int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText); int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText);
string config = nd.Attributes.GetNamedItem("config").InnerText; string config = nd.Attributes.GetNamedItem("config").InnerText;
string userid = nd.Attributes.GetNamedItem("userid").InnerText; string userid = nd.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
string lookfor; string lookfor;
if (isrange == 0) if (isrange == 0)
lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid);
else else
lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid);
//fromid = content.ContentID; //fromid = content.ContentID;
toid = Old2NewItem[toid]; toid = Old2NewItem[toid];
rangeid = Old2NewItem[rangeid]; rangeid = Old2NewItem[rangeid];
Transition tt = Transition.MakeTransition(content, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); Transition tt = Transition.MakeTransition(content, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid);
transitionid = tt.TransitionID; transitionid = tt.TransitionID;
string replacewith; string replacewith;
if (isrange == 0) if (isrange == 0)
replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid);
else else
replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid);
content.Text = content.Text.Replace(lookfor, replacewith); content.Text = content.Text.Replace(lookfor, replacewith);
content.FixTransitionText(TransitionInfo.Get(tt.TransitionID)); content.FixTransitionText(TransitionInfo.Get(tt.TransitionID));
content.Save(); content.Save();
} }
else else
{ {
PendingTransitions.DocumentElement.AppendChild(PendingTransitions.ImportNode(nd, true)); PendingTransitions.DocumentElement.AppendChild(PendingTransitions.ImportNode(nd, true));
//save to holding pen //save to holding pen
} }
} }
} }
private void AddTransitions() private void AddTransitions()
{ {
AddTransitions(PendingTransitions); AddTransitions(PendingTransitions);
} }
private void AddTransitions(XmlDocument xd) private void AddTransitions(XmlDocument xd)
{ {
/* /*
Content Content
@ -2684,26 +2725,27 @@ namespace VEPROMS
FixSectionStart(procInfo); FixSectionStart(procInfo);
return procInfo; return procInfo;
} }
private void AddROUsage(XmlReader xr) // jsj 2016Feb16 - This appears to not be used
{ //private void AddROUsage(XmlReader xr)
int contentid = int.Parse(xr.GetAttribute("contentid")); //{
contentid = Old2NewContent[contentid]; // int contentid = int.Parse(xr.GetAttribute("contentid"));
Content content = Content.Get(contentid); // contentid = Old2NewContent[contentid];
string rousageid = xr.GetAttribute("rousageid"); // Content content = Content.Get(contentid);
string roid = xr.GetAttribute("roid"); // string rousageid = xr.GetAttribute("rousageid");
string config = xr.GetAttribute("config"); // string roid = xr.GetAttribute("roid");
string userid = xr.GetAttribute("userid"); // string config = xr.GetAttribute("config");
DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); // string userid = xr.GetAttribute("userid");
RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb); // DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
rou.Save(); // RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb);
string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString()); // rou.Save();
string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString()); // string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString());
if (lookFor != replaceWith) // string replaceWith = (cbxCvrtROsToText.Checked) ? "" : string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString());
{ // if (lookFor != replaceWith)
content.Text = content.Text.Replace(lookFor, replaceWith); // {
content.Save(); // content.Text = content.Text.Replace(lookFor, replaceWith);
} // content.Save();
} // }
//}
private void AddROUsages(Content content, XmlNode xn) private void AddROUsages(Content content, XmlNode xn)
{ {
foreach (XmlNode nd in xn.SelectNodes("rousage")) foreach (XmlNode nd in xn.SelectNodes("rousage"))
@ -2812,29 +2854,30 @@ namespace VEPROMS
foreach (XmlNode nd in xn.ChildNodes) foreach (XmlNode nd in xn.ChildNodes)
prevInfo = AddTable(nd, parentInfo, prevInfo); prevInfo = AddTable(nd, parentInfo, prevInfo);
} }
private ItemInfo AddTable(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) // jsj 2016Feb16 - This appears to not be used
{ //private ItemInfo AddTable(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid)
string number = xr.GetAttribute("number"); //{
string text = xr.GetAttribute("text"); // string number = xr.GetAttribute("number");
int steptype = int.Parse(xr.GetAttribute("type")); // string text = xr.GetAttribute("text");
string formatid = xr.GetAttribute("formatid"); // int steptype = int.Parse(xr.GetAttribute("type"));
string config = xr.GetAttribute("config"); // string formatid = xr.GetAttribute("formatid");
string userid = xr.GetAttribute("userid"); // string config = xr.GetAttribute("config");
DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); // string userid = xr.GetAttribute("userid");
Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Table); // DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
step.DTS = dts; // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Table);
step.UserID = userid; // step.DTS = dts;
if (formatid != string.Empty) // step.UserID = userid;
step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid)); // if (formatid != string.Empty)
step.MyContent.Config = config; // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid));
step.MyContent.DTS = dts; // step.MyContent.Config = config;
step.MyContent.UserID = userid; // step.MyContent.DTS = dts;
step.Save(); // step.MyContent.UserID = userid;
Old2NewItem.Add(oldid, step.ItemID); // step.Save();
Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); // Old2NewItem.Add(oldid, step.ItemID);
prevInfo = StepInfo.Get(step.ItemID); // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID);
return prevInfo; // prevInfo = StepInfo.Get(step.ItemID);
} // return prevInfo;
//}
private ItemInfo AddTable(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) private ItemInfo AddTable(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo)
{ {
pbImportStep.PerformStep(); pbImportStep.PerformStep();
@ -3285,17 +3328,18 @@ namespace VEPROMS
floatFoldout.Add(contentid, int.Parse(xn.InnerText)); floatFoldout.Add(contentid, int.Parse(xn.InnerText));
} }
} }
private void AddGrid(XmlReader xr) // jsj 2016Feb16 - This appears to not be used
{ //private void AddGrid(XmlReader xr)
int contentid = int.Parse(xr.GetAttribute("contentid")); //{
contentid = Old2NewContent[contentid]; // int contentid = int.Parse(xr.GetAttribute("contentid"));
Content content = Content.Get(contentid); // contentid = Old2NewContent[contentid];
string data = xr.GetAttribute("data"); // Content content = Content.Get(contentid);
string config = xr.GetAttribute("config"); // string data = xr.GetAttribute("data");
string userid = xr.GetAttribute("userid"); // string config = xr.GetAttribute("config");
DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); // string userid = xr.GetAttribute("userid");
Grid gg = Grid.MakeGrid(content, data, config, dts, userid); // DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
} // Grid gg = Grid.MakeGrid(content, data, config, dts, userid);
//}
private void AddGrid(Content content, XmlNode xc) private void AddGrid(Content content, XmlNode xc)
{ {
XmlNode nd = xc.SelectSingleNode("grid"); XmlNode nd = xc.SelectSingleNode("grid");
@ -3303,29 +3347,29 @@ namespace VEPROMS
XmlDocument xd = new XmlDocument(); XmlDocument xd = new XmlDocument();
xd.LoadXml(data); xd.LoadXml(data);
XmlNode gn = xd.SelectSingleNode("C1FlexGrid/Control/IsRoTable"); XmlNode gn = xd.SelectSingleNode("C1FlexGrid/Control/IsRoTable");
if (gn.InnerText.ToLower() == "true") if (gn.InnerText.ToLower() == "true")
{ {
gn = xd.SelectSingleNode("C1FlexGrid/Control/RODbId"); gn = xd.SelectSingleNode("C1FlexGrid/Control/RODbId");
gn.InnerText = newRODbID.ToString(); gn.InnerText = newRODbID.ToString();
data = xd.OuterXml; data = xd.OuterXml;
} }
else else
{ {
XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data");
bool modified = false; bool modified = false;
string lookFor = string.Format(" {0}[END", oldRODbID.ToString()); string lookFor = string.Format(" {0}[END", oldRODbID.ToString());
string replaceWith = string.Format(" {0}[END", newRODbID.ToString()); string replaceWith = string.Format(" {0}[END", newRODbID.ToString());
foreach (XmlNode nn in nl) foreach (XmlNode nn in nl)
{ {
if (nn.InnerText.Contains("#Link:ReferencedObject:")) if (nn.InnerText.Contains("#Link:ReferencedObject:"))
{ {
nn.InnerText = nn.InnerText.Replace(lookFor, replaceWith); nn.InnerText = nn.InnerText.Replace(lookFor, replaceWith);
modified = true; modified = true;
} }
} }
if(modified) if (modified)
data = xd.OuterXml; data = xd.OuterXml;
} }
string config = nd.Attributes.GetNamedItem("config").InnerText; string config = nd.Attributes.GetNamedItem("config").InnerText;
string userid = nd.Attributes.GetNamedItem("userid").InnerText; string userid = nd.Attributes.GetNamedItem("userid").InnerText;
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
@ -3349,23 +3393,24 @@ namespace VEPROMS
Entry ee = Entry.MakeEntry(content, dd, dts, userid); Entry ee = Entry.MakeEntry(content, dd, dts, userid);
ee.Save(); ee.Save();
} }
private void AddDocument(XmlReader xr, Dictionary<string, string> dic) // jsj 2016Feb16 - This appears to not be used
{ //private void AddDocument(XmlReader xr, Dictionary<string, string> dic)
string libtitle = xr.GetAttribute("libtitle"); //{
byte[] doccontent = Convert.FromBase64String(xr.GetAttribute("doccontent")); // string libtitle = xr.GetAttribute("libtitle");
string docascii = xr.GetAttribute("docascii"); // byte[] doccontent = Convert.FromBase64String(xr.GetAttribute("doccontent"));
string config = xr.GetAttribute("config"); // string docascii = xr.GetAttribute("docascii");
string userid = xr.GetAttribute("userid"); // string config = xr.GetAttribute("config");
DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); // string userid = xr.GetAttribute("userid");
string fileextension = xr.GetAttribute("fileextension"); // DateTime dts = DateTime.Parse(xr.GetAttribute("dts"));
Document dd = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension); // string fileextension = xr.GetAttribute("fileextension");
int contentid = int.Parse(dic["contentid"]); // Document dd = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension);
contentid = Old2NewContent[contentid]; // int contentid = int.Parse(dic["contentid"]);
Content content = Content.Get(contentid); // contentid = Old2NewContent[contentid];
dts = DateTime.Parse(dic["dts"]); // Content content = Content.Get(contentid);
userid = dic["userid"]; // dts = DateTime.Parse(dic["dts"]);
Entry ee = Entry.MakeEntry(content, dd, dts, userid); // userid = dic["userid"];
} // Entry ee = Entry.MakeEntry(content, dd, dts, userid);
//}
private Document AddDocument(XmlNode xn) private Document AddDocument(XmlNode xn)
{ {
Document d; Document d;

View File

@ -28,379 +28,377 @@ namespace VEPROMS
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.pnlExport = new System.Windows.Forms.Panel(); this.pnlExport = new System.Windows.Forms.Panel();
this.btnCloseExport = new System.Windows.Forms.Button(); this.cbxExportAudits = new System.Windows.Forms.CheckBox();
this.lblExportTime = new System.Windows.Forms.Label(); this.btnCloseExport = new System.Windows.Forms.Button();
this.lblExportStatus = new System.Windows.Forms.Label(); this.lblExportTime = new System.Windows.Forms.Label();
this.pbExportStep = new System.Windows.Forms.ProgressBar(); this.lblExportStatus = new System.Windows.Forms.Label();
this.lblExportStep = new System.Windows.Forms.Label(); this.pbExportStep = new System.Windows.Forms.ProgressBar();
this.pbExportSection = new System.Windows.Forms.ProgressBar(); this.lblExportStep = new System.Windows.Forms.Label();
this.lblExportSection = new System.Windows.Forms.Label(); this.pbExportSection = new System.Windows.Forms.ProgressBar();
this.pbExportProcedure = new System.Windows.Forms.ProgressBar(); this.lblExportSection = new System.Windows.Forms.Label();
this.lblExportProcedure = new System.Windows.Forms.Label(); this.pbExportProcedure = new System.Windows.Forms.ProgressBar();
this.btnDoExport = new System.Windows.Forms.Button(); this.lblExportProcedure = new System.Windows.Forms.Label();
this.btnExport = new System.Windows.Forms.Button(); this.btnDoExport = new System.Windows.Forms.Button();
this.txtExport = new System.Windows.Forms.TextBox(); this.btnExport = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.txtExport = new System.Windows.Forms.TextBox();
this.pnlImport = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label();
this.btnCloseImport = new System.Windows.Forms.Button(); this.pnlImport = new System.Windows.Forms.Panel();
this.lblImportTime = new System.Windows.Forms.Label(); this.cbxImportAudits = new System.Windows.Forms.CheckBox();
this.lblImportStatus = new System.Windows.Forms.Label(); this.btnCloseImport = new System.Windows.Forms.Button();
this.pbImportStep = new System.Windows.Forms.ProgressBar(); this.lblImportTime = new System.Windows.Forms.Label();
this.lblImportStep = new System.Windows.Forms.Label(); this.lblImportStatus = new System.Windows.Forms.Label();
this.pbImportSection = new System.Windows.Forms.ProgressBar(); this.pbImportStep = new System.Windows.Forms.ProgressBar();
this.lblImportSection = new System.Windows.Forms.Label(); this.lblImportStep = new System.Windows.Forms.Label();
this.pbImportProcedure = new System.Windows.Forms.ProgressBar(); this.pbImportSection = new System.Windows.Forms.ProgressBar();
this.lblImportProcedure = new System.Windows.Forms.Label(); this.lblImportSection = new System.Windows.Forms.Label();
this.btnDoImport = new System.Windows.Forms.Button(); this.pbImportProcedure = new System.Windows.Forms.ProgressBar();
this.btnImport = new System.Windows.Forms.Button(); this.lblImportProcedure = new System.Windows.Forms.Label();
this.txtImport = new System.Windows.Forms.TextBox(); this.btnDoImport = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label(); this.btnImport = new System.Windows.Forms.Button();
this.ofd = new System.Windows.Forms.OpenFileDialog(); this.txtImport = new System.Windows.Forms.TextBox();
this.sfd = new System.Windows.Forms.SaveFileDialog(); this.label2 = new System.Windows.Forms.Label();
this.cbxExportAudits = new System.Windows.Forms.CheckBox(); this.ofd = new System.Windows.Forms.OpenFileDialog();
this.cbxImportAudits = new System.Windows.Forms.CheckBox(); this.sfd = new System.Windows.Forms.SaveFileDialog();
this.pnlExport.SuspendLayout(); this.pnlExport.SuspendLayout();
this.pnlImport.SuspendLayout(); this.pnlImport.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// pnlExport // pnlExport
// //
this.pnlExport.Controls.Add(this.cbxExportAudits); this.pnlExport.Controls.Add(this.cbxExportAudits);
this.pnlExport.Controls.Add(this.btnCloseExport); this.pnlExport.Controls.Add(this.btnCloseExport);
this.pnlExport.Controls.Add(this.lblExportTime); this.pnlExport.Controls.Add(this.lblExportTime);
this.pnlExport.Controls.Add(this.lblExportStatus); this.pnlExport.Controls.Add(this.lblExportStatus);
this.pnlExport.Controls.Add(this.pbExportStep); this.pnlExport.Controls.Add(this.pbExportStep);
this.pnlExport.Controls.Add(this.lblExportStep); this.pnlExport.Controls.Add(this.lblExportStep);
this.pnlExport.Controls.Add(this.pbExportSection); this.pnlExport.Controls.Add(this.pbExportSection);
this.pnlExport.Controls.Add(this.lblExportSection); this.pnlExport.Controls.Add(this.lblExportSection);
this.pnlExport.Controls.Add(this.pbExportProcedure); this.pnlExport.Controls.Add(this.pbExportProcedure);
this.pnlExport.Controls.Add(this.lblExportProcedure); this.pnlExport.Controls.Add(this.lblExportProcedure);
this.pnlExport.Controls.Add(this.btnDoExport); this.pnlExport.Controls.Add(this.btnDoExport);
this.pnlExport.Controls.Add(this.btnExport); this.pnlExport.Controls.Add(this.btnExport);
this.pnlExport.Controls.Add(this.txtExport); this.pnlExport.Controls.Add(this.txtExport);
this.pnlExport.Controls.Add(this.label1); this.pnlExport.Controls.Add(this.label1);
this.pnlExport.Location = new System.Drawing.Point(12, 12); this.pnlExport.Location = new System.Drawing.Point(12, 12);
this.pnlExport.Name = "pnlExport"; this.pnlExport.Name = "pnlExport";
this.pnlExport.Size = new System.Drawing.Size(618, 199); this.pnlExport.Size = new System.Drawing.Size(618, 199);
this.pnlExport.TabIndex = 0; this.pnlExport.TabIndex = 0;
// //
// btnCloseExport // cbxExportAudits
// //
this.btnCloseExport.Enabled = false; this.cbxExportAudits.AutoSize = true;
this.btnCloseExport.Location = new System.Drawing.Point(562, 32); this.cbxExportAudits.Location = new System.Drawing.Point(141, 54);
this.btnCloseExport.Name = "btnCloseExport"; this.cbxExportAudits.Name = "cbxExportAudits";
this.btnCloseExport.Size = new System.Drawing.Size(53, 23); this.cbxExportAudits.Size = new System.Drawing.Size(123, 17);
this.btnCloseExport.TabIndex = 12; this.cbxExportAudits.TabIndex = 13;
this.btnCloseExport.Text = "Close"; this.cbxExportAudits.Text = "Include Audit History";
this.btnCloseExport.UseVisualStyleBackColor = true; this.cbxExportAudits.UseVisualStyleBackColor = true;
this.btnCloseExport.Click += new System.EventHandler(this.btnCloseExport_Click);
//
// lblExportTime
//
this.lblExportTime.AutoSize = true;
this.lblExportTime.Location = new System.Drawing.Point(392, 29);
this.lblExportTime.Name = "lblExportTime";
this.lblExportTime.Size = new System.Drawing.Size(28, 13);
this.lblExportTime.TabIndex = 11;
this.lblExportTime.Text = "0:00";
this.lblExportTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblExportStatus
//
this.lblExportStatus.AutoSize = true;
this.lblExportStatus.Location = new System.Drawing.Point(140, 30);
this.lblExportStatus.Name = "lblExportStatus";
this.lblExportStatus.Size = new System.Drawing.Size(133, 13);
this.lblExportStatus.TabIndex = 10;
this.lblExportStatus.Text = "Awaiting Export File Name:";
//
// pbExportStep
//
this.pbExportStep.Location = new System.Drawing.Point(15, 155);
this.pbExportStep.Name = "pbExportStep";
this.pbExportStep.Size = new System.Drawing.Size(561, 20);
this.pbExportStep.Step = 1;
this.pbExportStep.TabIndex = 9;
//
// lblExportStep
//
this.lblExportStep.AutoSize = true;
this.lblExportStep.Location = new System.Drawing.Point(12, 139);
this.lblExportStep.Name = "lblExportStep";
this.lblExportStep.Size = new System.Drawing.Size(34, 13);
this.lblExportStep.TabIndex = 8;
this.lblExportStep.Text = "Steps";
//
// pbExportSection
//
this.pbExportSection.Location = new System.Drawing.Point(15, 116);
this.pbExportSection.Name = "pbExportSection";
this.pbExportSection.Size = new System.Drawing.Size(561, 20);
this.pbExportSection.Step = 1;
this.pbExportSection.TabIndex = 7;
//
// lblExportSection
//
this.lblExportSection.AutoSize = true;
this.lblExportSection.Location = new System.Drawing.Point(12, 100);
this.lblExportSection.Name = "lblExportSection";
this.lblExportSection.Size = new System.Drawing.Size(48, 13);
this.lblExportSection.TabIndex = 6;
this.lblExportSection.Text = "Sections";
//
// pbExportProcedure
//
this.pbExportProcedure.Location = new System.Drawing.Point(15, 77);
this.pbExportProcedure.Name = "pbExportProcedure";
this.pbExportProcedure.Size = new System.Drawing.Size(561, 20);
this.pbExportProcedure.Step = 1;
this.pbExportProcedure.TabIndex = 5;
//
// lblExportProcedure
//
this.lblExportProcedure.AutoSize = true;
this.lblExportProcedure.Location = new System.Drawing.Point(12, 61);
this.lblExportProcedure.Name = "lblExportProcedure";
this.lblExportProcedure.Size = new System.Drawing.Size(61, 13);
this.lblExportProcedure.TabIndex = 4;
this.lblExportProcedure.Text = "Procedures";
//
// btnDoExport
//
this.btnDoExport.Enabled = false;
this.btnDoExport.Location = new System.Drawing.Point(15, 25);
this.btnDoExport.Name = "btnDoExport";
this.btnDoExport.Size = new System.Drawing.Size(119, 23);
this.btnDoExport.TabIndex = 3;
this.btnDoExport.Text = "Process Export";
this.btnDoExport.UseVisualStyleBackColor = true;
this.btnDoExport.Click += new System.EventHandler(this.btnDoExport_Click);
//
// btnExport
//
this.btnExport.Location = new System.Drawing.Point(582, 3);
this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(25, 23);
this.btnExport.TabIndex = 2;
this.btnExport.Text = "...";
this.btnExport.UseVisualStyleBackColor = true;
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
//
// txtExport
//
this.txtExport.Location = new System.Drawing.Point(141, 6);
this.txtExport.Name = "txtExport";
this.txtExport.ReadOnly = true;
this.txtExport.Size = new System.Drawing.Size(435, 20);
this.txtExport.TabIndex = 1;
this.txtExport.TextChanged += new System.EventHandler(this.txtExport_TextChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(123, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Select Export File Name:";
//
// pnlImport
//
this.pnlImport.Controls.Add(this.cbxImportAudits);
this.pnlImport.Controls.Add(this.btnCloseImport);
this.pnlImport.Controls.Add(this.lblImportTime);
this.pnlImport.Controls.Add(this.lblImportStatus);
this.pnlImport.Controls.Add(this.pbImportStep);
this.pnlImport.Controls.Add(this.lblImportStep);
this.pnlImport.Controls.Add(this.pbImportSection);
this.pnlImport.Controls.Add(this.lblImportSection);
this.pnlImport.Controls.Add(this.pbImportProcedure);
this.pnlImport.Controls.Add(this.lblImportProcedure);
this.pnlImport.Controls.Add(this.btnDoImport);
this.pnlImport.Controls.Add(this.btnImport);
this.pnlImport.Controls.Add(this.txtImport);
this.pnlImport.Controls.Add(this.label2);
this.pnlImport.Location = new System.Drawing.Point(12, 217);
this.pnlImport.Name = "pnlImport";
this.pnlImport.Size = new System.Drawing.Size(618, 225);
this.pnlImport.TabIndex = 1;
//
// btnCloseImport
//
this.btnCloseImport.Enabled = false;
this.btnCloseImport.Location = new System.Drawing.Point(562, 33);
this.btnCloseImport.Name = "btnCloseImport";
this.btnCloseImport.Size = new System.Drawing.Size(53, 23);
this.btnCloseImport.TabIndex = 18;
this.btnCloseImport.Text = "Close";
this.btnCloseImport.UseVisualStyleBackColor = true;
this.btnCloseImport.Click += new System.EventHandler(this.btnCloseImport_Click);
//
// lblImportTime
//
this.lblImportTime.AutoSize = true;
this.lblImportTime.Location = new System.Drawing.Point(392, 30);
this.lblImportTime.Name = "lblImportTime";
this.lblImportTime.Size = new System.Drawing.Size(28, 13);
this.lblImportTime.TabIndex = 17;
this.lblImportTime.Text = "0.00";
this.lblImportTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblImportStatus
//
this.lblImportStatus.AutoSize = true;
this.lblImportStatus.Location = new System.Drawing.Point(137, 31);
this.lblImportStatus.Name = "lblImportStatus";
this.lblImportStatus.Size = new System.Drawing.Size(132, 13);
this.lblImportStatus.TabIndex = 16;
this.lblImportStatus.Text = "Awaiting Import File Name:";
//
// pbImportStep
//
this.pbImportStep.Location = new System.Drawing.Point(15, 156);
this.pbImportStep.Name = "pbImportStep";
this.pbImportStep.Size = new System.Drawing.Size(561, 20);
this.pbImportStep.Step = 1;
this.pbImportStep.TabIndex = 15;
//
// lblImportStep
//
this.lblImportStep.AutoSize = true;
this.lblImportStep.Location = new System.Drawing.Point(12, 140);
this.lblImportStep.Name = "lblImportStep";
this.lblImportStep.Size = new System.Drawing.Size(34, 13);
this.lblImportStep.TabIndex = 14;
this.lblImportStep.Text = "Steps";
//
// pbImportSection
//
this.pbImportSection.Location = new System.Drawing.Point(14, 117);
this.pbImportSection.Name = "pbImportSection";
this.pbImportSection.Size = new System.Drawing.Size(561, 20);
this.pbImportSection.Step = 1;
this.pbImportSection.TabIndex = 13;
//
// lblImportSection
//
this.lblImportSection.AutoSize = true;
this.lblImportSection.Location = new System.Drawing.Point(12, 101);
this.lblImportSection.Name = "lblImportSection";
this.lblImportSection.Size = new System.Drawing.Size(48, 13);
this.lblImportSection.TabIndex = 12;
this.lblImportSection.Text = "Sections";
//
// pbImportProcedure
//
this.pbImportProcedure.Location = new System.Drawing.Point(14, 78);
this.pbImportProcedure.Name = "pbImportProcedure";
this.pbImportProcedure.Size = new System.Drawing.Size(561, 20);
this.pbImportProcedure.Step = 1;
this.pbImportProcedure.TabIndex = 11;
//
// lblImportProcedure
//
this.lblImportProcedure.AutoSize = true;
this.lblImportProcedure.Location = new System.Drawing.Point(12, 62);
this.lblImportProcedure.Name = "lblImportProcedure";
this.lblImportProcedure.Size = new System.Drawing.Size(61, 13);
this.lblImportProcedure.TabIndex = 10;
this.lblImportProcedure.Text = "Procedures";
//
// btnDoImport
//
this.btnDoImport.Enabled = false;
this.btnDoImport.Location = new System.Drawing.Point(15, 26);
this.btnDoImport.Name = "btnDoImport";
this.btnDoImport.Size = new System.Drawing.Size(119, 23);
this.btnDoImport.TabIndex = 5;
this.btnDoImport.Text = "Process Import";
this.btnDoImport.UseVisualStyleBackColor = true;
this.btnDoImport.Click += new System.EventHandler(this.btnDoImport_Click);
//
// btnImport
//
this.btnImport.Location = new System.Drawing.Point(581, 4);
this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(25, 23);
this.btnImport.TabIndex = 4;
this.btnImport.Text = "...";
this.btnImport.UseVisualStyleBackColor = true;
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
//
// txtImport
//
this.txtImport.Location = new System.Drawing.Point(140, 7);
this.txtImport.Name = "txtImport";
this.txtImport.ReadOnly = true;
this.txtImport.Size = new System.Drawing.Size(435, 20);
this.txtImport.TabIndex = 3;
this.txtImport.TextChanged += new System.EventHandler(this.txtImport_TextChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 10);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(122, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Select Import File Name:";
//
// ofd
//
this.ofd.AddExtension = false;
this.ofd.Filter = "PROMS Export Files|*.expx";
this.ofd.Title = "Import File Name";
//
// sfd
//
this.sfd.DefaultExt = "expx";
this.sfd.Filter = "PROMS Export Files|*.expx";
this.sfd.Title = "Export File Name";
//
// cbxExportAudits
//
this.cbxExportAudits.AutoSize = true;
this.cbxExportAudits.Location = new System.Drawing.Point(141, 47);
this.cbxExportAudits.Name = "cbxExportAudits";
this.cbxExportAudits.Size = new System.Drawing.Size(123, 17);
this.cbxExportAudits.TabIndex = 13;
this.cbxExportAudits.Text = "Include Audit History";
this.cbxExportAudits.UseVisualStyleBackColor = true;
this.cbxExportAudits.Checked = false;
this.cbxExportAudits.Visible = false; this.cbxExportAudits.Visible = false;
// //
// cbxImportAudits // btnCloseExport
// //
this.cbxImportAudits.AutoSize = true; this.btnCloseExport.Enabled = false;
this.cbxImportAudits.Location = new System.Drawing.Point(140, 47); this.btnCloseExport.Location = new System.Drawing.Point(562, 32);
this.cbxImportAudits.Name = "cbxImportAudits"; this.btnCloseExport.Name = "btnCloseExport";
this.cbxImportAudits.Size = new System.Drawing.Size(182, 17); this.btnCloseExport.Size = new System.Drawing.Size(53, 23);
this.cbxImportAudits.TabIndex = 19; this.btnCloseExport.TabIndex = 12;
this.cbxImportAudits.Text = "Include Audit History (if available)"; this.btnCloseExport.Text = "Close";
this.cbxImportAudits.UseVisualStyleBackColor = true; this.btnCloseExport.UseVisualStyleBackColor = true;
this.cbxImportAudits.Checked = false; this.btnCloseExport.Click += new System.EventHandler(this.btnCloseExport_Click);
//
// lblExportTime
//
this.lblExportTime.AutoSize = true;
this.lblExportTime.Location = new System.Drawing.Point(392, 29);
this.lblExportTime.Name = "lblExportTime";
this.lblExportTime.Size = new System.Drawing.Size(28, 13);
this.lblExportTime.TabIndex = 11;
this.lblExportTime.Text = "0:00";
this.lblExportTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblExportStatus
//
this.lblExportStatus.AutoSize = true;
this.lblExportStatus.Location = new System.Drawing.Point(140, 30);
this.lblExportStatus.Name = "lblExportStatus";
this.lblExportStatus.Size = new System.Drawing.Size(133, 13);
this.lblExportStatus.TabIndex = 10;
this.lblExportStatus.Text = "Awaiting Export File Name:";
//
// pbExportStep
//
this.pbExportStep.Location = new System.Drawing.Point(15, 155);
this.pbExportStep.Name = "pbExportStep";
this.pbExportStep.Size = new System.Drawing.Size(561, 20);
this.pbExportStep.Step = 1;
this.pbExportStep.TabIndex = 9;
//
// lblExportStep
//
this.lblExportStep.AutoSize = true;
this.lblExportStep.Location = new System.Drawing.Point(12, 139);
this.lblExportStep.Name = "lblExportStep";
this.lblExportStep.Size = new System.Drawing.Size(34, 13);
this.lblExportStep.TabIndex = 8;
this.lblExportStep.Text = "Steps";
//
// pbExportSection
//
this.pbExportSection.Location = new System.Drawing.Point(15, 116);
this.pbExportSection.Name = "pbExportSection";
this.pbExportSection.Size = new System.Drawing.Size(561, 20);
this.pbExportSection.Step = 1;
this.pbExportSection.TabIndex = 7;
//
// lblExportSection
//
this.lblExportSection.AutoSize = true;
this.lblExportSection.Location = new System.Drawing.Point(12, 100);
this.lblExportSection.Name = "lblExportSection";
this.lblExportSection.Size = new System.Drawing.Size(48, 13);
this.lblExportSection.TabIndex = 6;
this.lblExportSection.Text = "Sections";
//
// pbExportProcedure
//
this.pbExportProcedure.Location = new System.Drawing.Point(15, 77);
this.pbExportProcedure.Name = "pbExportProcedure";
this.pbExportProcedure.Size = new System.Drawing.Size(561, 20);
this.pbExportProcedure.Step = 1;
this.pbExportProcedure.TabIndex = 5;
//
// lblExportProcedure
//
this.lblExportProcedure.AutoSize = true;
this.lblExportProcedure.Location = new System.Drawing.Point(12, 61);
this.lblExportProcedure.Name = "lblExportProcedure";
this.lblExportProcedure.Size = new System.Drawing.Size(61, 13);
this.lblExportProcedure.TabIndex = 4;
this.lblExportProcedure.Text = "Procedures";
//
// btnDoExport
//
this.btnDoExport.Enabled = false;
this.btnDoExport.Location = new System.Drawing.Point(15, 25);
this.btnDoExport.Name = "btnDoExport";
this.btnDoExport.Size = new System.Drawing.Size(119, 23);
this.btnDoExport.TabIndex = 3;
this.btnDoExport.Text = "Process Export";
this.btnDoExport.UseVisualStyleBackColor = true;
this.btnDoExport.Click += new System.EventHandler(this.btnDoExport_Click);
//
// btnExport
//
this.btnExport.Location = new System.Drawing.Point(582, 3);
this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(25, 23);
this.btnExport.TabIndex = 2;
this.btnExport.Text = "...";
this.btnExport.UseVisualStyleBackColor = true;
this.btnExport.Click += new System.EventHandler(this.btnExport_Click);
//
// txtExport
//
this.txtExport.Location = new System.Drawing.Point(141, 6);
this.txtExport.Name = "txtExport";
this.txtExport.ReadOnly = true;
this.txtExport.Size = new System.Drawing.Size(435, 20);
this.txtExport.TabIndex = 1;
this.txtExport.TextChanged += new System.EventHandler(this.txtExport_TextChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(123, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Select Export File Name:";
//
// pnlImport
//
this.pnlImport.Controls.Add(this.cbxImportAudits);
this.pnlImport.Controls.Add(this.btnCloseImport);
this.pnlImport.Controls.Add(this.lblImportTime);
this.pnlImport.Controls.Add(this.lblImportStatus);
this.pnlImport.Controls.Add(this.pbImportStep);
this.pnlImport.Controls.Add(this.lblImportStep);
this.pnlImport.Controls.Add(this.pbImportSection);
this.pnlImport.Controls.Add(this.lblImportSection);
this.pnlImport.Controls.Add(this.pbImportProcedure);
this.pnlImport.Controls.Add(this.lblImportProcedure);
this.pnlImport.Controls.Add(this.btnDoImport);
this.pnlImport.Controls.Add(this.btnImport);
this.pnlImport.Controls.Add(this.txtImport);
this.pnlImport.Controls.Add(this.label2);
this.pnlImport.Location = new System.Drawing.Point(12, 217);
this.pnlImport.Name = "pnlImport";
this.pnlImport.Size = new System.Drawing.Size(618, 225);
this.pnlImport.TabIndex = 1;
//
// cbxImportAudits
//
this.cbxImportAudits.AutoSize = true;
this.cbxImportAudits.Location = new System.Drawing.Point(360, 56);
this.cbxImportAudits.Name = "cbxImportAudits";
this.cbxImportAudits.Size = new System.Drawing.Size(182, 17);
this.cbxImportAudits.TabIndex = 19;
this.cbxImportAudits.Text = "Include Audit History (if available)";
this.cbxImportAudits.UseVisualStyleBackColor = true;
this.cbxImportAudits.Visible = false; this.cbxImportAudits.Visible = false;
// //
// dlgExportImport // btnCloseImport
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.btnCloseImport.Enabled = false;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.btnCloseImport.Location = new System.Drawing.Point(562, 33);
this.ClientSize = new System.Drawing.Size(633, 452); this.btnCloseImport.Name = "btnCloseImport";
this.Controls.Add(this.pnlImport); this.btnCloseImport.Size = new System.Drawing.Size(53, 23);
this.Controls.Add(this.pnlExport); this.btnCloseImport.TabIndex = 18;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.btnCloseImport.Text = "Close";
this.MaximizeBox = false; this.btnCloseImport.UseVisualStyleBackColor = true;
this.MinimizeBox = false; this.btnCloseImport.Click += new System.EventHandler(this.btnCloseImport_Click);
this.Name = "dlgExportImport"; //
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; // lblImportTime
this.Text = "Export Import Dialog"; //
this.Load += new System.EventHandler(this.dlgExportImport_Load); this.lblImportTime.AutoSize = true;
this.pnlExport.ResumeLayout(false); this.lblImportTime.Location = new System.Drawing.Point(392, 30);
this.pnlExport.PerformLayout(); this.lblImportTime.Name = "lblImportTime";
this.pnlImport.ResumeLayout(false); this.lblImportTime.Size = new System.Drawing.Size(28, 13);
this.pnlImport.PerformLayout(); this.lblImportTime.TabIndex = 17;
this.ResumeLayout(false); this.lblImportTime.Text = "0.00";
this.lblImportTime.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblImportStatus
//
this.lblImportStatus.AutoSize = true;
this.lblImportStatus.Location = new System.Drawing.Point(137, 31);
this.lblImportStatus.Name = "lblImportStatus";
this.lblImportStatus.Size = new System.Drawing.Size(132, 13);
this.lblImportStatus.TabIndex = 16;
this.lblImportStatus.Text = "Awaiting Import File Name:";
//
// pbImportStep
//
this.pbImportStep.Location = new System.Drawing.Point(16, 180);
this.pbImportStep.Name = "pbImportStep";
this.pbImportStep.Size = new System.Drawing.Size(561, 20);
this.pbImportStep.Step = 1;
this.pbImportStep.TabIndex = 15;
//
// lblImportStep
//
this.lblImportStep.AutoSize = true;
this.lblImportStep.Location = new System.Drawing.Point(13, 164);
this.lblImportStep.Name = "lblImportStep";
this.lblImportStep.Size = new System.Drawing.Size(34, 13);
this.lblImportStep.TabIndex = 14;
this.lblImportStep.Text = "Steps";
//
// pbImportSection
//
this.pbImportSection.Location = new System.Drawing.Point(15, 141);
this.pbImportSection.Name = "pbImportSection";
this.pbImportSection.Size = new System.Drawing.Size(561, 20);
this.pbImportSection.Step = 1;
this.pbImportSection.TabIndex = 13;
//
// lblImportSection
//
this.lblImportSection.AutoSize = true;
this.lblImportSection.Location = new System.Drawing.Point(13, 125);
this.lblImportSection.Name = "lblImportSection";
this.lblImportSection.Size = new System.Drawing.Size(48, 13);
this.lblImportSection.TabIndex = 12;
this.lblImportSection.Text = "Sections";
//
// pbImportProcedure
//
this.pbImportProcedure.Location = new System.Drawing.Point(15, 102);
this.pbImportProcedure.Name = "pbImportProcedure";
this.pbImportProcedure.Size = new System.Drawing.Size(561, 20);
this.pbImportProcedure.Step = 1;
this.pbImportProcedure.TabIndex = 11;
//
// lblImportProcedure
//
this.lblImportProcedure.AutoSize = true;
this.lblImportProcedure.Location = new System.Drawing.Point(13, 86);
this.lblImportProcedure.Name = "lblImportProcedure";
this.lblImportProcedure.Size = new System.Drawing.Size(61, 13);
this.lblImportProcedure.TabIndex = 10;
this.lblImportProcedure.Text = "Procedures";
//
// btnDoImport
//
this.btnDoImport.Enabled = false;
this.btnDoImport.Location = new System.Drawing.Point(15, 26);
this.btnDoImport.Name = "btnDoImport";
this.btnDoImport.Size = new System.Drawing.Size(119, 23);
this.btnDoImport.TabIndex = 5;
this.btnDoImport.Text = "Process Import";
this.btnDoImport.UseVisualStyleBackColor = true;
this.btnDoImport.Click += new System.EventHandler(this.btnDoImport_Click);
//
// btnImport
//
this.btnImport.Location = new System.Drawing.Point(581, 4);
this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(25, 23);
this.btnImport.TabIndex = 4;
this.btnImport.Text = "...";
this.btnImport.UseVisualStyleBackColor = true;
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
//
// txtImport
//
this.txtImport.Location = new System.Drawing.Point(140, 7);
this.txtImport.Name = "txtImport";
this.txtImport.ReadOnly = true;
this.txtImport.Size = new System.Drawing.Size(435, 20);
this.txtImport.TabIndex = 3;
this.txtImport.TextChanged += new System.EventHandler(this.txtImport_TextChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 10);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(122, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Select Import File Name:";
//
// ofd
//
this.ofd.AddExtension = false;
this.ofd.Filter = "PROMS Export Files|*.expx";
this.ofd.Title = "Import File Name";
//
// sfd
//
this.sfd.DefaultExt = "expx";
this.sfd.Filter = "PROMS Export Files|*.expx";
this.sfd.Title = "Export File Name";
//
// dlgExportImport
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(633, 452);
this.Controls.Add(this.pnlImport);
this.Controls.Add(this.pnlExport);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "dlgExportImport";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Export Import Dialog";
this.Load += new System.EventHandler(this.dlgExportImport_Load);
this.pnlExport.ResumeLayout(false);
this.pnlExport.PerformLayout();
this.pnlImport.ResumeLayout(false);
this.pnlImport.PerformLayout();
this.ResumeLayout(false);
} }
@ -437,7 +435,7 @@ namespace VEPROMS
private System.Windows.Forms.Button btnCloseExport; private System.Windows.Forms.Button btnCloseExport;
private System.Windows.Forms.Button btnCloseImport; private System.Windows.Forms.Button btnCloseImport;
private System.Windows.Forms.CheckBox cbxExportAudits; private System.Windows.Forms.CheckBox cbxExportAudits;
private System.Windows.Forms.CheckBox cbxImportAudits; private System.Windows.Forms.CheckBox cbxImportAudits;
} }
} }

View File

@ -88,6 +88,14 @@ namespace VEPROMS
_NewLocation = newLocation; _NewLocation = newLocation;
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
// used when the approved function creates an export file with unlinked ROs and Transitons. Word sections that have RO tokens are saved with the RO Vaules in DocReplace
// DocReplace is passed on to the Export functions.
private Dictionary<int, byte[]> _DocReplace;
public Dictionary<int, byte[]> DocReplace
{
get { return _DocReplace; }
set { _DocReplace = value; }
}
public bool AllowAllWatermarks public bool AllowAllWatermarks
{ {
get { return MyPromsPrinter.AllowAllWatermarks; } get { return MyPromsPrinter.AllowAllWatermarks; }
@ -146,6 +154,7 @@ namespace VEPROMS
if (CancelStop) btnCancel.Visible = true; if (CancelStop) btnCancel.Visible = true;
Application.DoEvents(); Application.DoEvents();
MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged); MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
MyPromsPrinter.DocReplace = DocReplace; // used when approve generates an export with unlinked ROs and Transitions
DateTime tStart = DateTime.Now; DateTime tStart = DateTime.Now;
if (!CancelStop) PromsPrinter.ClearTransPageNumProblems(); if (!CancelStop) PromsPrinter.ClearTransPageNumProblems();
do do

View File

@ -572,6 +572,13 @@ namespace VEPROMS.CSLA.Library
} }
public static class MSWordToPDF public static class MSWordToPDF
{ {
// used to save Word sections with resolved ROs (for export generated from Approve)
private static Dictionary<int, byte[]> _DocReplace;
public static Dictionary<int, byte[]> DocReplace
{
get { return MSWordToPDF._DocReplace; }
set { MSWordToPDF._DocReplace = value; }
}
private static bool _CloseWordWhenDone = true; private static bool _CloseWordWhenDone = true;
public static bool CloseWordWhenDone public static bool CloseWordWhenDone
{ {
@ -615,7 +622,7 @@ namespace VEPROMS.CSLA.Library
string fileName = GetFileName(sect); string fileName = GetFileName(sect);
FileInfo fi = new FileInfo(fileName); FileInfo fi = new FileInfo(fileName);
FileStream fs = fi.Create(); FileStream fs = fi.Create();
PdfInfo myPdf = PdfInfo.Get(sect); PdfInfo myPdf = PdfInfo.Get(sect,false);
if (myPdf != null && myPdf.DocPdf != null) fs.Write(myPdf.DocPdf, 0, myPdf.DocPdf.Length); if (myPdf != null && myPdf.DocPdf != null) fs.Write(myPdf.DocPdf, 0, myPdf.DocPdf.Length);
fs.Close(); fs.Close();
return fileName; return fileName;
@ -624,7 +631,7 @@ namespace VEPROMS.CSLA.Library
public static bool UpdateDocPdf(DocumentInfo mydoc, Color overrideColor, ItemInfo sect) public static bool UpdateDocPdf(DocumentInfo mydoc, Color overrideColor, ItemInfo sect)
{ {
MSWordToPDF.OverrideColor = overrideColor; MSWordToPDF.OverrideColor = overrideColor;
PdfInfo myPdf = PdfInfo.Get(sect); PdfInfo myPdf = PdfInfo.Get(sect,DocReplace!=null);
return true; return true;
} }
public static bool SetDocPdf(DocumentInfo docInfo, ItemInfo sect) public static bool SetDocPdf(DocumentInfo docInfo, ItemInfo sect)
@ -982,15 +989,32 @@ namespace VEPROMS.CSLA.Library
sel.Range.Font.Color = (LBWdColor)WordColor(OverrideColor == System.Drawing.Color.Transparent ? System.Drawing.Color.Black : OverrideColor); sel.Range.Font.Color = (LBWdColor)WordColor(OverrideColor == System.Drawing.Color.Transparent ? System.Drawing.Color.Black : OverrideColor);
sect.MSWordPageCount = myDoc.Length; sect.MSWordPageCount = myDoc.Length;
fileName = CreatePDF(fileName, openPdf,MSWordToPDF.DebugStatus); fileName = CreatePDF(fileName, openPdf,MSWordToPDF.DebugStatus);
if (DocReplace != null)
{
MyApp.ActiveDocument.SaveAs2000();
DocReplace.Add(sect.MyContent.MyEntry.DocID, GetBytes(MyApp.ActiveDocument.FullName)); // save the word document containing resolved ROs
}
CloseDocument(); CloseDocument();
if (CloseWordWhenDone) if (CloseWordWhenDone)
{ {
CloseAppAfterWait(); CloseAppAfterWait();
} }
if (statusChange != null) statusChange(VolianStatusType.Complete, 0, ""); if (statusChange != null) statusChange(VolianStatusType.Complete, 0, "");
GC.Collect(); //jsj 2-15-2016 - for memeory garbage collection
return fileName; return fileName;
} }
} }
// Reads the Word file containing the resolved ROs
// used when adding to DocReplace
private static byte[] GetBytes(string filename)
{
FileInfo fi = new FileInfo(filename);
FileStream fs = fi.Open(FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
byte[] buf = new byte[fi.Length];
fs.Read(buf, 0, buf.Length);
fs.Close();
return buf;
}
private static void CloseDocument() private static void CloseDocument()
{ {
int attempts = 0; int attempts = 0;
@ -1323,6 +1347,7 @@ namespace VEPROMS.CSLA.Library
VG.IVGOutput vgOut = new VG.VGOut_Graphics(grfx); VG.IVGOutput vgOut = new VG.VGOut_Graphics(grfx);
vgOut.DebugStatus = MSWordToPDF.DebugStatus; vgOut.DebugStatus = MSWordToPDF.DebugStatus;
myPlot.Process(vgOut); myPlot.Process(vgOut);
GC.Collect(); // memory garbage collection (Regex bug)
grfx.Dispose(); grfx.Dispose();
GraphicsUnit gu = new GraphicsUnit(); GraphicsUnit gu = new GraphicsUnit();
retval = mf.GetBounds(ref gu); retval = mf.GetBounds(ref gu);

View File

@ -63,7 +63,7 @@ namespace VEPROMS.CSLA.Library
} }
public partial class PdfInfo public partial class PdfInfo
{ {
public static PdfInfo Get(ItemInfo sect) public static PdfInfo Get(ItemInfo sect, bool ovrride)
{ {
int count = 0; int count = 0;
while (count < 2) while (count < 2)
@ -81,8 +81,12 @@ namespace VEPROMS.CSLA.Library
myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, myPdf = Get(sect.MyContent.MyEntry.DocID, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth); (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth);
} }
if (myPdf != null) return myPdf; // ovrride forces the the printing of the word seciton, which creates a word file with resolved ROs, which is saved for an approved export
if (count > 0) return null; // Could not find or create a pdf if (!ovrride || (ovrride && count ==1))
{
if (myPdf != null) return myPdf;
if (count > 0) return null; // Could not find or create a pdf
}
MSWordToPDF.SetDocPdf(sect.MyContent.MyEntry.MyDocument, sect); MSWordToPDF.SetDocPdf(sect.MyContent.MyEntry.MyDocument, sect);
count++; count++;
} }

View File

@ -878,14 +878,16 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
//_MyLog.WarnFormat("LatestVersion 1 - {0}",GC.GetTotalMemory(true));
if (this.RevisionVersions == null || this.RevisionVersions.Count == 0) return null; if (this.RevisionVersions == null || this.RevisionVersions.Count == 0) return null;
VersionInfo latest = this.RevisionVersions[0]; VersionInfo latest = this.RevisionVersions[0];
foreach (VersionInfo vi in this.RevisionVersions) foreach (VersionInfo vi in this.RevisionVersions)
{ {
if (vi.DTS > latest.DTS) if (vi.DTS > latest.DTS)
latest = vi; latest = vi;
} }
return latest; //_MyLog.WarnFormat("LatestVersion 2 - {0}", GC.GetTotalMemory(true));
return latest;
} }
} }
public override string ToString() public override string ToString()