C2018-039: Upgrade – User Control of Format
This commit is contained in:
parent
dcefdc8754
commit
e2392f5fec
@ -30,7 +30,7 @@ namespace AdjustBuildRevision
|
|||||||
string outline = line;
|
string outline = line;
|
||||||
if (line.Contains("AssemblyVersion") || line.Contains("AssemblyFileVersion"))
|
if (line.Contains("AssemblyVersion") || line.Contains("AssemblyFileVersion"))
|
||||||
{
|
{
|
||||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("1.5.yyMM.dHH") + "\")");
|
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("1.6.yyMM.dHH") + "\")");
|
||||||
// if (outline != line)
|
// if (outline != line)
|
||||||
// {
|
// {
|
||||||
// Console.WriteLine("Before: '{0}'", line);
|
// Console.WriteLine("Before: '{0}'", line);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
BIN
PROMS/Formats/genmacall/base.svg
Normal file
BIN
PROMS/Formats/genmacall/base.svg
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1151,7 +1151,7 @@ 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, MyFrmVEPROMS); // "true tell export to convert ROs and Transitions to text
|
dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (E_UCFImportOptions)0); // "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
|
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");
|
||||||
|
@ -6,6 +6,7 @@ using System.Drawing;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
using Volian.Controls.Library;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -39,8 +40,10 @@ namespace VEPROMS
|
|||||||
set { _ExternalTransitionItem = value; }
|
set { _ExternalTransitionItem = value; }
|
||||||
}
|
}
|
||||||
private Dictionary<int, int> floatFoldout;
|
private Dictionary<int, int> floatFoldout;
|
||||||
private Dictionary<int, string> oldFormat;
|
private Dictionary<int, string> importedFormat;
|
||||||
private Dictionary<string, int> newFormat;
|
private Dictionary<string, int> existingFormat;
|
||||||
|
private Dictionary<string, string> renamedUCFFormatName; // if format is renamed, this is its new name so references to it can be made
|
||||||
|
private Dictionary<int, int> renamedUCFFormatId; // if format is renamed, this is its old->new formatid
|
||||||
private int oldRODbID;
|
private int oldRODbID;
|
||||||
private int newRODbID;
|
private int newRODbID;
|
||||||
private FolderInfo _MyNewFolder;
|
private FolderInfo _MyNewFolder;
|
||||||
@ -65,24 +68,30 @@ namespace VEPROMS
|
|||||||
xa.InnerText = value;
|
xa.InnerText = value;
|
||||||
return xa;
|
return xa;
|
||||||
}
|
}
|
||||||
public dlgExportImport(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS)
|
public dlgExportImport(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, E_UCFImportOptions frset)
|
||||||
{
|
{
|
||||||
|
UCFImportDefaultFromSettings = frset;
|
||||||
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||||
_MyMode = mode;
|
_MyMode = mode;
|
||||||
MyFolder = folderInfo;
|
MyFolder = folderInfo;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Text = mode + " Dialog for " + folderInfo.Name;
|
this.Text = mode + " Dialog for " + folderInfo.Name;
|
||||||
}
|
}
|
||||||
public dlgExportImport(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS)
|
public dlgExportImport(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS, E_UCFImportOptions frset)
|
||||||
{
|
{
|
||||||
|
UCFImportDefaultFromSettings = frset;
|
||||||
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||||
_MyMode = mode;
|
_MyMode = mode;
|
||||||
MyDocVersion = docVersionInfo;
|
MyDocVersion = docVersionInfo;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Text = mode + " Dialog for " + docVersionInfo.Name + " of " + docVersionInfo.MyFolder.Name;
|
if (mode.ToUpper().Contains("FORMAT"))
|
||||||
|
this.Text = mode;
|
||||||
|
else
|
||||||
|
this.Text = mode + " Dialog for " + docVersionInfo.Name + " of " + docVersionInfo.MyFolder.Name;
|
||||||
}
|
}
|
||||||
public dlgExportImport(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS)
|
public dlgExportImport(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS, E_UCFImportOptions frset)
|
||||||
{
|
{
|
||||||
|
UCFImportDefaultFromSettings = frset;
|
||||||
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||||
_MyMode = mode;
|
_MyMode = mode;
|
||||||
MyProcedure = procedureInfo;
|
MyProcedure = procedureInfo;
|
||||||
@ -105,20 +114,43 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
pnlExport.Dock = DockStyle.Fill;
|
pnlExport.Dock = DockStyle.Fill;
|
||||||
pnlImport.Dock = DockStyle.Fill;
|
pnlImport.Dock = DockStyle.Fill;
|
||||||
if (_MyMode.ToLower() == "export")
|
int formsize = 2;
|
||||||
|
if (_MyMode.ToLower().Contains("export"))
|
||||||
{
|
{
|
||||||
|
// if doing formats, make various controls invisible:
|
||||||
|
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
|
{
|
||||||
|
cbxExportAudits.Visible = false;
|
||||||
|
lblExportProcedure.Visible = lblExportSection.Visible = lblExportStep.Visible = false;
|
||||||
|
pbExportProcedure.Visible = pbExportSection.Visible = pbExportStep.Visible = false;
|
||||||
|
lblExportTime.Visible = false;
|
||||||
|
formsize = 4;
|
||||||
|
}
|
||||||
sfd.InitialDirectory = PEIPath;
|
sfd.InitialDirectory = PEIPath;
|
||||||
pnlExport.BringToFront();
|
pnlExport.BringToFront();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
|
{
|
||||||
|
cbxImportAudits.Visible = false;
|
||||||
|
lblImportProcedure.Visible = lblImportSection.Visible = lblImportStep.Visible = false;
|
||||||
|
pbImportProcedure.Visible = pbImportSection.Visible = pbImportStep.Visible = false;
|
||||||
|
lblExportTime.Visible = false;
|
||||||
|
formsize = 4;
|
||||||
|
}
|
||||||
ofd.InitialDirectory = PEIPath;
|
ofd.InitialDirectory = PEIPath;
|
||||||
pnlImport.BringToFront();
|
pnlImport.BringToFront();
|
||||||
}
|
}
|
||||||
this.Height = this.Height / 2;
|
this.Height = this.Height / formsize;
|
||||||
}
|
}
|
||||||
private void btnExport_Click(object sender, EventArgs e)
|
private void btnExport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
|
{
|
||||||
|
txtExport.Text = string.Format(@"{0}\{1}.pxml", PEIPath, "UCF");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (MyFolder != null)
|
if (MyFolder != null)
|
||||||
{
|
{
|
||||||
//Database.SelectedDatabase
|
//Database.SelectedDatabase
|
||||||
@ -158,7 +190,19 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
btnExport.Enabled = false;
|
btnExport.Enabled = false;
|
||||||
string msg = "Finished Exporting:\n\n";
|
string msg = "Finished Exporting:\n\n";
|
||||||
if (MyFolder != null)
|
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
|
{
|
||||||
|
this.Cursor = Cursors.WaitCursor;
|
||||||
|
MyStart = DateTime.Now;
|
||||||
|
btnDoExport.Enabled = false;
|
||||||
|
lblExportStatus.Text = "Performing Export of UC Formats";
|
||||||
|
SaveExportUCF();
|
||||||
|
|
||||||
|
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||||
|
lblExportStatus.Text = "Format Export Completed in " + elapsed.ToString();
|
||||||
|
this.Cursor = Cursors.Default;
|
||||||
|
}
|
||||||
|
else if (MyFolder != null)
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
this.Cursor = Cursors.WaitCursor;
|
||||||
MyStart = DateTime.Now;
|
MyStart = DateTime.Now;
|
||||||
@ -181,19 +225,43 @@ namespace VEPROMS
|
|||||||
pbExportProcedure.Maximum = 1;
|
pbExportProcedure.Maximum = 1;
|
||||||
XmlDocument xd = new XmlDocument();
|
XmlDocument xd = new XmlDocument();
|
||||||
ExportItem(xd, MyProcedure, "procedure");
|
ExportItem(xd, MyProcedure, "procedure");
|
||||||
|
XmlElement xe = xd.CreateElement("formats");
|
||||||
|
xd.DocumentElement.AppendChild(xe);
|
||||||
|
ExportFormats(FormatInfoList.GetFormatInfoListUsed(), xe, "formats", false);
|
||||||
xd.Save(txtExport.Text);
|
xd.Save(txtExport.Text);
|
||||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||||
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
||||||
this.Cursor = Cursors.Default;
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
// added message to user when export of a procedure or procedure set has completed
|
// added message to user when export of a procedure or procedure set has completed
|
||||||
if (successfullExport)
|
if (successfullExport)
|
||||||
msg += MyProcedure;
|
{
|
||||||
else
|
if (!_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
msg = "Could not complete export";
|
msg += MyProcedure;
|
||||||
|
else
|
||||||
|
msg += "Formats";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
msg = "Could not complete export";
|
||||||
MessageBox.Show(msg, "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show(msg, "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
btnCloseExport.Enabled = true;
|
btnCloseExport.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SaveExportUCF()
|
||||||
|
{
|
||||||
|
lblExportStatus.Text = "Exporting UC Formats...";
|
||||||
|
Application.DoEvents();
|
||||||
|
XmlDocument xd = new XmlDocument();
|
||||||
|
XmlElement xe = xd.CreateElement("ucformats");
|
||||||
|
xd.AppendChild(xe);
|
||||||
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
|
foreach (FormatInfo fi in fil)
|
||||||
|
{
|
||||||
|
if (fi.Config != null && fi.Config != "")
|
||||||
|
ExportFormat(xe, fi, "ucformat");
|
||||||
|
}
|
||||||
|
xd.Save(txtExport.Text);
|
||||||
|
}
|
||||||
private void SaveExportData()
|
private void SaveExportData()
|
||||||
{
|
{
|
||||||
XmlDocument xd = new XmlDocument();
|
XmlDocument xd = new XmlDocument();
|
||||||
@ -228,7 +296,26 @@ namespace VEPROMS
|
|||||||
_DidProcessTransitions = false; // B2017-076 to know if we processed any transition (used in status message at the end of importing)
|
_DidProcessTransitions = false; // B2017-076 to know if we processed any transition (used in status message at the end of importing)
|
||||||
_DidProcessROs = false; // B2017-076 to know if we processed any transition (used in status message at the end of importing)
|
_DidProcessROs = false; // B2017-076 to know if we processed any transition (used in status message at the end of importing)
|
||||||
//LoadImportDataReader();
|
//LoadImportDataReader();
|
||||||
if (MyFolder != null) // import a folder - a .expx file
|
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
|
{
|
||||||
|
TurnChangeManagerOff.Execute();
|
||||||
|
MyFrmVEPROMS.DisablePing = true;// Turn-off SessionPing
|
||||||
|
bool result = TryToImportUCFs(ref isImported, ref canceledPressed);
|
||||||
|
MyFrmVEPROMS.DisablePing = false;// Turn-on SessionPing
|
||||||
|
TurnChangeManagerOn.Execute();
|
||||||
|
if (!result) return;
|
||||||
|
if (isImported)
|
||||||
|
{
|
||||||
|
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||||
|
lblImportStatus.Text = "Format Import Completed in " + elapsed.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btnImport.Enabled = true;
|
||||||
|
btnDoImport.Enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (MyFolder != null) // import a folder - a .expx file
|
||||||
{
|
{
|
||||||
TurnChangeManagerOff.Execute();
|
TurnChangeManagerOff.Execute();
|
||||||
MyFrmVEPROMS.DisablePing = true;// Turn-off SessionPing
|
MyFrmVEPROMS.DisablePing = true;// Turn-off SessionPing
|
||||||
@ -289,6 +376,71 @@ namespace VEPROMS
|
|||||||
btnCloseImport.PerformClick();
|
btnCloseImport.PerformClick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool TryToImportUCFs(ref bool isImported, ref bool canceledPressed)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
existingFormat = new Dictionary<string, int>();
|
||||||
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
|
foreach (FormatInfo fi in fil)
|
||||||
|
existingFormat.Add(fi.Name, fi.FormatID);
|
||||||
|
XmlDocument xd = new XmlDocument();
|
||||||
|
xd.Load(txtImport.Text);
|
||||||
|
XmlNodeList nl = xd.SelectNodes("ucformats/ucformat");
|
||||||
|
foreach (XmlNode nd in nl)
|
||||||
|
{
|
||||||
|
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
||||||
|
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
||||||
|
string config = null;
|
||||||
|
XmlNode cfg = nd.Attributes.GetNamedItem("config");
|
||||||
|
if (cfg != null) config = cfg.InnerText;
|
||||||
|
string pname = nd.Attributes.GetNamedItem("pname").InnerText;
|
||||||
|
string description = null;
|
||||||
|
XmlNode descript = nd.Attributes.GetNamedItem("description");
|
||||||
|
if (descript != null) description = descript.InnerText;
|
||||||
|
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
||||||
|
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
||||||
|
if (!existingFormat.ContainsKey(pname)) return false;
|
||||||
|
int pid = existingFormat[pname];
|
||||||
|
Format pformat = Format.Get(pid);
|
||||||
|
if (existingFormat.ContainsKey(name)) // this UCF already exists in database, just update the record.
|
||||||
|
{
|
||||||
|
FormatInfo exFI = FormatInfo.Get(existingFormat[name]);
|
||||||
|
if (exFI.Config != config)
|
||||||
|
{
|
||||||
|
using (Format f = Format.Get(exFI.FormatID))
|
||||||
|
{
|
||||||
|
f.Name = name;
|
||||||
|
f.MyParent = pformat;
|
||||||
|
f.Description = description;
|
||||||
|
f.UserID = userid;
|
||||||
|
f.DTS = dts;
|
||||||
|
f.Config = config;
|
||||||
|
f.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // doesn't exist in the database, add it
|
||||||
|
{
|
||||||
|
|
||||||
|
Format rec = Format.MakeFormat(pformat, name, description, null, null, dts, userid);
|
||||||
|
rec.Config = config;
|
||||||
|
rec.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
isImported = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||||
|
_MyLog.Warn("Failed during UC Formats Import", ex);
|
||||||
|
this.Close();
|
||||||
|
isImported = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
private bool TryToImportProcedure(ref bool isImported, ref bool canceledPressed)
|
private bool TryToImportProcedure(ref bool isImported, ref bool canceledPressed)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -411,7 +563,14 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
} // end - need to select RO Path
|
} // end - need to select RO Path
|
||||||
|
bool didImp = LoadFormats(xd, "procedure/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
|
||||||
|
}
|
||||||
// use resolvedProcNum to determine if procedure is 'unique', i.e. if the procedure number exists
|
// use resolvedProcNum to determine if procedure is 'unique', i.e. if the procedure number exists
|
||||||
// and user does not overwrite or copy, then the procedure should NOT be imported. Fix for B2016-045
|
// and user does not overwrite or copy, then the procedure should NOT be imported. Fix for B2016-045
|
||||||
bool resolvedProcNum = true;
|
bool resolvedProcNum = true;
|
||||||
@ -472,8 +631,28 @@ namespace VEPROMS
|
|||||||
ImportProcedureNew(xd);
|
ImportProcedureNew(xd);
|
||||||
isImported = true;
|
isImported = true;
|
||||||
}
|
}
|
||||||
|
if (isImported && UCFImportCase==E_UCFImportOptions.LoadForSetOnly) UpdateFormatForUCFInSet();
|
||||||
return true;// Import Suceeded
|
return true;// Import Suceeded
|
||||||
}
|
}
|
||||||
|
private void UpdateFormatForUCFInSet()
|
||||||
|
{
|
||||||
|
// this gets called if the UCFImportCase == LoadForSetOnly, i.e. only items in this PROCEDURE Set whose formats point to a
|
||||||
|
// UCF format should point to the updated (copied) UCF format.
|
||||||
|
if (renamedUCFFormatId == null) return;
|
||||||
|
foreach (int key in renamedUCFFormatId.Keys)
|
||||||
|
{
|
||||||
|
using (ContentInfoList cil = ContentInfoList.FixFormatIDAfterImport(MyDocVersion.VersionID.ToString(), renamedUCFFormatId[key], key))
|
||||||
|
{
|
||||||
|
foreach (ContentInfo ci in cil)
|
||||||
|
{
|
||||||
|
using (Content c = ci.Get())
|
||||||
|
{
|
||||||
|
ContentInfo.Refresh(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Added Error Handling to assure that Change Manager is turned-on regardless of success or failure of the import
|
// Added Error Handling to assure that Change Manager is turned-on regardless of success or failure of the import
|
||||||
private void TryToLoadImportDataDocument()
|
private void TryToLoadImportDataDocument()
|
||||||
{
|
{
|
||||||
@ -490,14 +669,14 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
//add imported procedure
|
//add imported procedure
|
||||||
floatFoldout = new Dictionary<int, int>();
|
floatFoldout = new Dictionary<int, int>();
|
||||||
oldFormat = new Dictionary<int, string>();
|
importedFormat = new Dictionary<int, string>();
|
||||||
newFormat = new Dictionary<string, int>();
|
existingFormat = new Dictionary<string, int>();
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
foreach (FormatInfo fi in fil)
|
foreach (FormatInfo fi in fil)
|
||||||
{
|
{
|
||||||
oldFormat.Add(fi.FormatID, fi.Name);
|
importedFormat.Add(fi.FormatID, fi.Name);
|
||||||
newFormat.Add(fi.Name, fi.FormatID);
|
existingFormat.Add(fi.Name, fi.FormatID);
|
||||||
}
|
}
|
||||||
Old2NewItem = new Dictionary<int, int>();
|
Old2NewItem = new Dictionary<int, int>();
|
||||||
Old2NewContent = new Dictionary<int, int>();
|
Old2NewContent = new Dictionary<int, int>();
|
||||||
Old2NewLibDoc = new Dictionary<int, int>();
|
Old2NewLibDoc = new Dictionary<int, int>();
|
||||||
@ -519,13 +698,13 @@ namespace VEPROMS
|
|||||||
private void ImportProcedureCopy(XmlDocument xd)
|
private void ImportProcedureCopy(XmlDocument xd)
|
||||||
{
|
{
|
||||||
floatFoldout = new Dictionary<int, int>();
|
floatFoldout = new Dictionary<int, int>();
|
||||||
oldFormat = new Dictionary<int, string>();
|
importedFormat = new Dictionary<int, string>();
|
||||||
newFormat = new Dictionary<string, int>();
|
existingFormat = new Dictionary<string, int>();
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
foreach (FormatInfo fi in fil)
|
foreach (FormatInfo fi in fil)
|
||||||
{
|
{
|
||||||
oldFormat.Add(fi.FormatID, fi.Name);
|
importedFormat.Add(fi.FormatID, fi.Name);
|
||||||
newFormat.Add(fi.Name, fi.FormatID);
|
existingFormat.Add(fi.Name, fi.FormatID);
|
||||||
}
|
}
|
||||||
Old2NewItem = new Dictionary<int, int>();
|
Old2NewItem = new Dictionary<int, int>();
|
||||||
Old2NewContent = new Dictionary<int, int>();
|
Old2NewContent = new Dictionary<int, int>();
|
||||||
@ -558,13 +737,13 @@ namespace VEPROMS
|
|||||||
private bool ImportProcedureOverwrite(XmlDocument xd, ProcedureInfo pi)
|
private bool ImportProcedureOverwrite(XmlDocument xd, ProcedureInfo pi)
|
||||||
{
|
{
|
||||||
floatFoldout = new Dictionary<int, int>();
|
floatFoldout = new Dictionary<int, int>();
|
||||||
oldFormat = new Dictionary<int, string>();
|
importedFormat = new Dictionary<int, string>();
|
||||||
newFormat = new Dictionary<string, int>();
|
existingFormat = new Dictionary<string, int>( );
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
foreach (FormatInfo fi in fil)
|
foreach (FormatInfo fi in fil)
|
||||||
{
|
{
|
||||||
oldFormat.Add(fi.FormatID, fi.Name);
|
importedFormat.Add(fi.FormatID, fi.Name);
|
||||||
newFormat.Add(fi.Name, fi.FormatID);
|
existingFormat.Add(fi.Name, fi.FormatID);
|
||||||
}
|
}
|
||||||
Old2NewItem = new Dictionary<int, int>();
|
Old2NewItem = new Dictionary<int, int>();
|
||||||
Old2NewContent = new Dictionary<int, int>();
|
Old2NewContent = new Dictionary<int, int>();
|
||||||
@ -620,7 +799,14 @@ namespace VEPROMS
|
|||||||
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently);
|
||||||
XmlDocument xd = new XmlDocument();
|
XmlDocument xd = new XmlDocument();
|
||||||
xd.Load(fn);
|
xd.Load(fn);
|
||||||
LoadFormats(xd);
|
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; // Return False to Indicate that the Import did not succeed
|
||||||
|
}
|
||||||
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd);
|
Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd);
|
||||||
if (ff == null)
|
if (ff == null)
|
||||||
{
|
{
|
||||||
@ -656,33 +842,33 @@ namespace VEPROMS
|
|||||||
FixFloatingFoldouts();
|
FixFloatingFoldouts();
|
||||||
SaveTransitionAndItemContentIDs();
|
SaveTransitionAndItemContentIDs();
|
||||||
}
|
}
|
||||||
private void FixSectionStart(ProcedureInfo pi)
|
private void FixSectionStart(ProcedureInfo pi)
|
||||||
{
|
{
|
||||||
Content c = Content.Get(pi.MyContent.ContentID);
|
Content c = Content.Get(pi.MyContent.ContentID);
|
||||||
XmlDocument xd = new XmlDocument();
|
XmlDocument xd = new XmlDocument();
|
||||||
// If the config field is empty, add an empty xml node.
|
// If the config field is empty, add an empty xml node.
|
||||||
if (c.Config == "") c.Config = "<Config/>";
|
if (c.Config == "") c.Config = "<Config/>";
|
||||||
xd.LoadXml(c.Config);
|
xd.LoadXml(c.Config);
|
||||||
XmlNode xn = xd.SelectSingleNode("Config/Procedure/@SectionStart");
|
XmlNode xn = xd.SelectSingleNode("Config/Procedure/@SectionStart");
|
||||||
if (xn != null)
|
if (xn != null)
|
||||||
{
|
{
|
||||||
int iid = int.Parse(xn.InnerText);
|
int iid = int.Parse(xn.InnerText);
|
||||||
if (Old2NewItem.ContainsKey(iid))
|
if (Old2NewItem.ContainsKey(iid))
|
||||||
iid = Old2NewItem[iid];
|
iid = Old2NewItem[iid];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int oldid = iid;
|
int oldid = iid;
|
||||||
iid = pi.ItemID;
|
iid = pi.ItemID;
|
||||||
XmlAttribute xa = xd.CreateAttribute("ErrorSectionStart");
|
XmlAttribute xa = xd.CreateAttribute("ErrorSectionStart");
|
||||||
xa.InnerText = oldid.ToString();
|
xa.InnerText = oldid.ToString();
|
||||||
XmlNode xp = xd.SelectSingleNode("Config/Procedure");
|
XmlNode xp = xd.SelectSingleNode("Config/Procedure");
|
||||||
xp.Attributes.SetNamedItem(xa);
|
xp.Attributes.SetNamedItem(xa);
|
||||||
}
|
}
|
||||||
xn.InnerText = iid.ToString();
|
xn.InnerText = iid.ToString();
|
||||||
c.Config = xd.OuterXml;
|
c.Config = xd.OuterXml;
|
||||||
c.Save();
|
c.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void FixFloatingFoldouts()
|
private void FixFloatingFoldouts()
|
||||||
{
|
{
|
||||||
foreach (int key in floatFoldout.Keys)
|
foreach (int key in floatFoldout.Keys)
|
||||||
@ -699,24 +885,241 @@ namespace VEPROMS
|
|||||||
c.Save();
|
c.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private E_UCFImportOptions UCFImportDefaultFromSettings;
|
||||||
// note that his is only used when importing a folder
|
private E_UCFImportOptions UCFImportCase = E_UCFImportOptions.LoadOnlyImported;
|
||||||
private void LoadFormats(XmlDocument xd)
|
Dictionary<string, string> existingCopyFCName = new Dictionary<string, string>();
|
||||||
|
// note that this is used when importing a folder or a procedure (procedure was added for UCF changes)
|
||||||
|
private bool LoadFormats(XmlDocument xd, string xmlpath)
|
||||||
{
|
{
|
||||||
oldFormat = new Dictionary<int, string>();
|
existingFormat = new Dictionary<string, int>();
|
||||||
XmlNodeList nl = xd.SelectNodes("folder/formats/format");
|
FormatInfoList fil = FormatInfoList.Get();
|
||||||
foreach (XmlNode nd in nl)
|
foreach (FormatInfo fi in fil)
|
||||||
{
|
existingFormat.Add(fi.Name, fi.FormatID);
|
||||||
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
|
||||||
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
importedFormat = new Dictionary<int, string>();
|
||||||
oldFormat.Add(formatid, name);
|
XmlNodeList nl = xd.SelectNodes(xmlpath);
|
||||||
}
|
|
||||||
newFormat = new Dictionary<string, int>();
|
bool conflictingUCFdata = false;
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
List<string> existingFC = new List<string>();
|
||||||
foreach (FormatInfo fi in fil)
|
List<string> importedFC = new List<string>();
|
||||||
newFormat.Add(fi.Name, fi.FormatID);
|
List<string> fname = new List<string>();
|
||||||
|
|
||||||
|
foreach (XmlNode nd in nl)
|
||||||
|
{
|
||||||
|
string copyOfUCF = null;
|
||||||
|
// see if any of the imported formats are 'UCF' formats, i.e. have config data. If they are UCF,
|
||||||
|
// see if this is different that what is in the database. If it is, the user needs to decide
|
||||||
|
// whether to associate sections with existing UCF format or the new one. All UCF formats will be
|
||||||
|
// connected the same way, i.e. existing or new.
|
||||||
|
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
||||||
|
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
||||||
|
string config = null;
|
||||||
|
XmlNode cfg = nd.Attributes.GetNamedItem("config");
|
||||||
|
if (cfg != null) config = cfg.InnerText;
|
||||||
|
if (existingFormat.ContainsKey(name) && config != null && config != "")
|
||||||
|
{
|
||||||
|
FormatInfo exFI = FormatInfo.Get(existingFormat[name]);
|
||||||
|
if (exFI.Config != config && exFI.Config != "" && exFI.Config != null && config != "" && config != null)
|
||||||
|
{
|
||||||
|
// See if there are copies of this UCF format, if so, this may match (have same config) one of those and should
|
||||||
|
// use it before stating there is conflicting data.
|
||||||
|
copyOfUCF = ContentsOfUCFExists(name, config);
|
||||||
|
if (copyOfUCF == null)
|
||||||
|
{
|
||||||
|
existingFC.Add(exFI.Config);
|
||||||
|
importedFC.Add(config);
|
||||||
|
conflictingUCFdata = true;
|
||||||
|
fname.Add(name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
existingCopyFCName.Add(name, copyOfUCF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// there is a difference in UCF data, see if user wants sections to use the existing or new ucf data:
|
||||||
|
if (conflictingUCFdata)
|
||||||
|
{
|
||||||
|
// Bring up dialog to allow user to choose how the UCF data is handled:
|
||||||
|
// Importing of a procedure(s) (names of UCF exist in current DB and in exported DB)
|
||||||
|
//Case 0 - ignore (don't bring in new UCF)
|
||||||
|
//Case 1 - bringing in new UCF and not using it
|
||||||
|
//Case 2 - bringing in new UCF and only using it for imported data
|
||||||
|
//Case 3 - bringing in new UCF and using it across the board
|
||||||
|
//Case 4 - bringing in new UCF and using it for the current procedure set (not applicable for procedure sets)
|
||||||
|
UCFImportCase = UCFImportDefaultFromSettings; // from the options/settings
|
||||||
|
dlgUCFImportOptions ucfoptDlg = new dlgUCFImportOptions(fname, existingFC, importedFC, UCFImportCase, xmlpath);
|
||||||
|
DialogResult dr = ucfoptDlg.ShowDialog();
|
||||||
|
if (dr != DialogResult.OK) return false;
|
||||||
|
UCFImportCase = ucfoptDlg.UCFImportOptionsCase; // may be reset from dialog.
|
||||||
|
}
|
||||||
|
// first see if any of the imported formats have different data. If so,
|
||||||
|
foreach (XmlNode nd in nl)
|
||||||
|
{
|
||||||
|
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
||||||
|
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
||||||
|
string config = null;
|
||||||
|
XmlNode cfg = nd.Attributes.GetNamedItem("config");
|
||||||
|
if (cfg != null) config = cfg.InnerText;
|
||||||
|
string pname = nd.Attributes.GetNamedItem("pname").InnerText;
|
||||||
|
string description = null;
|
||||||
|
XmlNode descript = nd.Attributes.GetNamedItem("description");
|
||||||
|
if (descript != null) description = descript.InnerText;
|
||||||
|
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
||||||
|
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
||||||
|
// If the format that is being imported exists as a copy (already was imported and a 'Copy x of name' was created) and the imported and
|
||||||
|
// existing config match, use the existing (copied) format's name rather than importing it again (the dictionary was set up during
|
||||||
|
// the import formats process.
|
||||||
|
if (existingCopyFCName.ContainsKey(name)) name = existingCopyFCName[name];
|
||||||
|
|
||||||
|
// compare this imported format to the original in the database.
|
||||||
|
// If format name exists, or if it has same config data, just use it.
|
||||||
|
if (existingFormat.ContainsKey(name))
|
||||||
|
{
|
||||||
|
// Note that Data & Genmac fields can have different contents. The format information should always be used from
|
||||||
|
// the original database, not the export file. So no processing is done on these fields when exporting & importing.
|
||||||
|
// Data or Genmac can be different if formats were updated in one database & not the other.
|
||||||
|
FormatInfo exFI = FormatInfo.Get(existingFormat[name]);
|
||||||
|
if ((exFI.Config == config || ((exFI.Config == "" || exFI.Config == null) && (config == "" || config == null))))
|
||||||
|
{
|
||||||
|
// importedFormat is used to set correct formatid on imported sections (if different formatid <-> name between
|
||||||
|
// the current database and the one from which export came)
|
||||||
|
importedFormat.Add(formatid, name);
|
||||||
|
continue; // go on to next format in import list
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// parent format will always be in there, if it is a new format, it will be added before the child. Check just in case (no null reference).
|
||||||
|
if (!existingFormat.ContainsKey(pname)) break;
|
||||||
|
int pid = existingFormat[pname];
|
||||||
|
Format pformat = Format.Get(pid);
|
||||||
|
|
||||||
|
// if the new format doesn't exist, it will be added (after these other checks). Otherwise, handle the
|
||||||
|
// various cases listed above:
|
||||||
|
if (existingFormat.ContainsKey(name))
|
||||||
|
{
|
||||||
|
// if case 0 and this ucf already exists, ignore it:
|
||||||
|
if (UCFImportCase == E_UCFImportOptions.Ignore) continue;
|
||||||
|
|
||||||
|
// if case 1, 2, 4 and the name exists, make a 'copy' of the newly imported format:
|
||||||
|
// need to add this format - name must be unique so add 'COPY(x) of 'original name'' where x is unique number:
|
||||||
|
if (UCFImportCase == E_UCFImportOptions.LoadNotUsed || UCFImportCase == E_UCFImportOptions.LoadOnlyImported || UCFImportCase == E_UCFImportOptions.LoadForSetOnly)
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
foreach (FormatInfo fi in fil) if (fi.Name.EndsWith(name)) count++;
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
string origname = name;
|
||||||
|
name = string.Format("Copy {0} of {1}", count.ToString(), name);
|
||||||
|
if (UCFImportCase == E_UCFImportOptions.LoadOnlyImported || UCFImportCase == E_UCFImportOptions.LoadForSetOnly)
|
||||||
|
{
|
||||||
|
if (renamedUCFFormatName == null) renamedUCFFormatName = new Dictionary<string, string>();
|
||||||
|
renamedUCFFormatName.Add(origname, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if case 3, take the existing config data and create in a record whose name is Old(x) of 'original name' (the record
|
||||||
|
// creation gets done below). Then modify the existing record to have the config data. The result is that any
|
||||||
|
// sections that used this UCF throughout the database will have the new config data.
|
||||||
|
if (UCFImportCase == E_UCFImportOptions.LoadUseAll)
|
||||||
|
{
|
||||||
|
string savname = name;
|
||||||
|
int count = 0;
|
||||||
|
foreach (FormatInfo fi in fil) if (fi.Name.EndsWith(name)) count++;
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
name = string.Format("Old {0} of {1}", count.ToString(), name);
|
||||||
|
}
|
||||||
|
// update the 'old' record by getting the original config data.
|
||||||
|
string savdesc = null;
|
||||||
|
DateTime savdts = DateTime.Now;
|
||||||
|
string savuid = null;
|
||||||
|
int savpar = 0;
|
||||||
|
string savconfig = null;
|
||||||
|
using (Format origRecord = Format.Get(existingFormat[savname]))
|
||||||
|
{
|
||||||
|
savdesc = origRecord.Description;
|
||||||
|
savdts = origRecord.DTS;
|
||||||
|
savuid = origRecord.UserID;
|
||||||
|
savpar = origRecord.ParentID;
|
||||||
|
savconfig = origRecord.Config;
|
||||||
|
origRecord.Name = savname;
|
||||||
|
origRecord.Description = description;
|
||||||
|
origRecord.DTS = dts;
|
||||||
|
origRecord.UserID = userid;
|
||||||
|
origRecord.MyParent = pformat;
|
||||||
|
origRecord.Config = config;
|
||||||
|
origRecord.Save();
|
||||||
|
description = savdesc;
|
||||||
|
dts = savdts;
|
||||||
|
userid = savuid;
|
||||||
|
pformat = Format.Get(savpar);
|
||||||
|
config = savconfig;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (UCFImportCase == 0) // ignore it
|
||||||
|
{
|
||||||
|
importedFormat.Add(formatid, name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Format rec = Format.MakeFormat(pformat, name, description, null, null, dts, userid);
|
||||||
|
rec.Config = config;
|
||||||
|
rec.Save();
|
||||||
|
if (UCFImportCase == E_UCFImportOptions.LoadNotUsed || UCFImportCase == E_UCFImportOptions.LoadUseAll) // don't reset format id (case 1 don't use it, case 3 copies new data into original record
|
||||||
|
importedFormat.Add(formatid, name);
|
||||||
|
else if (UCFImportCase == E_UCFImportOptions.LoadOnlyImported || UCFImportCase == E_UCFImportOptions.LoadForSetOnly) // case 2 uses it for any items imported, case 4 uses it for any sections within current set
|
||||||
|
{
|
||||||
|
existingFormat.Add(name, rec.FormatID); // change to original name?
|
||||||
|
importedFormat.Add(rec.FormatID, name);
|
||||||
|
|
||||||
|
// get format id for the original named format
|
||||||
|
if (UCFImportCase == E_UCFImportOptions.LoadForSetOnly && renamedUCFFormatName != null)
|
||||||
|
{
|
||||||
|
int origformatid = -1;
|
||||||
|
foreach (var kvp in renamedUCFFormatName)
|
||||||
|
{
|
||||||
|
if (kvp.Value == name)
|
||||||
|
{
|
||||||
|
origformatid = existingFormat[kvp.Key];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (origformatid != -1)
|
||||||
|
{
|
||||||
|
if (renamedUCFFormatId == null) renamedUCFFormatId = new Dictionary<int, int>();
|
||||||
|
renamedUCFFormatId.Add(rec.FormatID, origformatid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FormatInfoList.Reset();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string ContentsOfUCFExists(string name, string config)
|
||||||
|
{
|
||||||
|
// See if there is an existing format file that was created as a copy. If so, check if the passed in format's
|
||||||
|
// config is the same as an existing 'Copy of' format - if so, use rather than importing the same format as
|
||||||
|
// defined by config.
|
||||||
|
foreach (var existname in existingFormat)
|
||||||
|
{
|
||||||
|
if (existname.Key.Contains(name))
|
||||||
|
{
|
||||||
|
string cpy = existname.Key;
|
||||||
|
if (cpy.StartsWith("Copy") && cpy.Contains("of " + name))
|
||||||
|
{
|
||||||
|
FormatInfo exFI = FormatInfo.Get(existingFormat[cpy]);
|
||||||
|
if (exFI.Config == config) return cpy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
//jsj 4-29-2016 appears to not be used
|
//jsj 4-29-2016 appears to not be used
|
||||||
//Dictionary<int, ItemInfo> dicParentItem = null;
|
//Dictionary<int, ItemInfo> dicParentItem = null;
|
||||||
//private void UpdateParentItem(int depth, ItemInfo ii)
|
//private void UpdateParentItem(int depth, ItemInfo ii)
|
||||||
@ -1257,6 +1660,13 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void btnImport_Click(object sender, EventArgs e)
|
private void btnImport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
|
{
|
||||||
|
ofd.Filter = "PROMS Procedure Export Files|*.pxml";
|
||||||
|
if (ofd.ShowDialog(this) == DialogResult.OK)
|
||||||
|
txtImport.Text = ofd.FileName;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (MyFolder != null)
|
if (MyFolder != null)
|
||||||
{
|
{
|
||||||
if (ofd.ShowDialog(this) == DialogResult.OK)
|
if (ofd.ShowDialog(this) == DialogResult.OK)
|
||||||
@ -1376,25 +1786,38 @@ namespace VEPROMS
|
|||||||
xe.Attributes.SetNamedItem(AddAttribute(xd, "formatfilename",formatFileName));
|
xe.Attributes.SetNamedItem(AddAttribute(xd, "formatfilename",formatFileName));
|
||||||
xd.AppendChild(xe);
|
xd.AppendChild(xe);
|
||||||
ExportAnnotationTypes(xe, "annotationtypes");
|
ExportAnnotationTypes(xe, "annotationtypes");
|
||||||
ExportFormats(xe, "formats");
|
ExportFormats(FormatInfoList.GetFormatInfoListUsed(), xe, "formats", true);
|
||||||
if (fi.FolderDocVersionCount > 0)
|
if (fi.FolderDocVersionCount > 0)
|
||||||
foreach (DocVersionInfo dvi in fi.FolderDocVersions)
|
foreach (DocVersionInfo dvi in fi.FolderDocVersions)
|
||||||
ExportDocVersion(xe, dvi, "docversion");
|
ExportDocVersion(xe, dvi, "docversion");
|
||||||
}
|
}
|
||||||
private void ExportFormats(XmlElement xn, string nodename)
|
private void ExportFormats(FormatInfoList fil, XmlElement xn, string nodename, bool doElement)
|
||||||
{
|
{
|
||||||
XmlElement xe = xn.OwnerDocument.CreateElement(nodename);
|
XmlElement xe = null;
|
||||||
FormatInfoList fil = FormatInfoList.Get();
|
if (doElement) xe = xn.OwnerDocument.CreateElement(nodename);
|
||||||
|
else xe = xn;
|
||||||
foreach (FormatInfo fi in fil)
|
foreach (FormatInfo fi in fil)
|
||||||
ExportFormat(xe, fi, "format");
|
ExportFormat(xe, fi, "format");
|
||||||
xn.AppendChild(xe);
|
if (doElement) xn.AppendChild(xe);
|
||||||
}
|
}
|
||||||
private void ExportFormat(XmlElement xn, FormatInfo fi, string nodename)
|
private void ExportFormat(XmlElement xn, FormatInfo fi, string nodename)
|
||||||
{
|
{
|
||||||
XmlElement xe = xn.OwnerDocument.CreateElement(nodename);
|
XmlElement xe = xn.OwnerDocument.CreateElement(nodename);
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", fi.FormatID.ToString()));
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", fi.FormatID.ToString()));
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", fi.Name));
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", fi.Name));
|
||||||
xn.AppendChild(xe);
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "pname", fi.MyParent==null?"null":fi.MyParent.Name));
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "description", fi.Description));
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", fi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")));
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", fi.UserID));
|
||||||
|
|
||||||
|
if (fi.Config != null && fi.Config != "")
|
||||||
|
{
|
||||||
|
FormatConfig MyFormatConfig = FormatConfig.Get(fi.Config);
|
||||||
|
string scf = MyFormatConfig.ConvertToString();
|
||||||
|
scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", "");
|
||||||
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", scf));
|
||||||
|
}
|
||||||
|
xn.AppendChild(xe);
|
||||||
}
|
}
|
||||||
private void ExportAnnotationTypes(XmlElement xn, string nodename)
|
private void ExportAnnotationTypes(XmlElement xn, string nodename)
|
||||||
{
|
{
|
||||||
@ -2931,10 +3354,11 @@ namespace VEPROMS
|
|||||||
string formatName = formatFileName; // B2016-103, new export files include the format filename use that if it exists
|
string formatName = formatFileName; // B2016-103, new export files include the format filename use that if it exists
|
||||||
if (formatFileName == string.Empty)
|
if (formatFileName == string.Empty)
|
||||||
{
|
{
|
||||||
if (formatID >= oldFormat.Count) return null; // formatID not found, use default file name
|
if (formatID >= importedFormat.Count) return null; // formatID not found, use default file name
|
||||||
formatName = oldFormat[formatID]; // for backwards compatibility with older export files
|
formatName = importedFormat[formatID]; // for backwards compatibility with older export files
|
||||||
}
|
}
|
||||||
formatID = newFormat[formatName];
|
if (renamedUCFFormatName != null && renamedUCFFormatName.ContainsKey(formatFileName)) formatName = renamedUCFFormatName[formatName];
|
||||||
|
formatID = existingFormat[formatName];
|
||||||
return Format.Get(formatID);
|
return Format.Get(formatID);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@ -3198,33 +3622,35 @@ namespace VEPROMS
|
|||||||
config = StripEnhanced(config);
|
config = StripEnhanced(config);
|
||||||
string userid = xc.Attributes.GetNamedItem("userid").InnerText;
|
string userid = xc.Attributes.GetNamedItem("userid").InnerText;
|
||||||
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
|
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
|
||||||
Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype);
|
using (Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype))
|
||||||
p.DTS = dts;
|
{
|
||||||
p.UserID = userid;
|
p.DTS = dts;
|
||||||
// check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute)
|
p.UserID = userid;
|
||||||
XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to
|
// check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute)
|
||||||
string formatfilename = (fnNode !=null)? fnNode.InnerText : "";
|
XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to
|
||||||
if (formatid != string.Empty)
|
string formatfilename = (fnNode != null) ? fnNode.InnerText : "";
|
||||||
p.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid),formatfilename);
|
if (formatid != string.Empty)
|
||||||
p.MyContent.Config = config;
|
p.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename);
|
||||||
p.MyContent.DTS = dts;
|
p.MyContent.Config = config;
|
||||||
p.MyContent.UserID = userid;
|
p.MyContent.DTS = dts;
|
||||||
p.Save();
|
p.MyContent.UserID = userid;
|
||||||
if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)))
|
p.Save();
|
||||||
Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), p.ItemID);
|
if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)))
|
||||||
else
|
Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), p.ItemID);
|
||||||
Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = p.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID
|
else
|
||||||
if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)))
|
Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = p.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID
|
||||||
Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), p.MyContent.ContentID);
|
if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)))
|
||||||
else
|
Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), p.MyContent.ContentID);
|
||||||
Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = p.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID
|
else
|
||||||
if (xn.SelectNodes("annotation").Count > 0)
|
Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = p.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID
|
||||||
AddAnnotations(p.ItemID, xn);
|
if (xn.SelectNodes("annotation").Count > 0)
|
||||||
if (xc.SelectNodes("rousage").Count > 0)
|
AddAnnotations(p.ItemID, xn);
|
||||||
AddROUsages(p.MyContent, xc);
|
if (xc.SelectNodes("rousage").Count > 0)
|
||||||
if (xc.SelectNodes("transition").Count > 0)
|
AddROUsages(p.MyContent, xc);
|
||||||
AddTransitions(p.MyContent, xc);
|
if (xc.SelectNodes("transition").Count > 0)
|
||||||
procInfo = ProcedureInfo.Get(p.ItemID);
|
AddTransitions(p.MyContent, xc);
|
||||||
|
procInfo = ProcedureInfo.Get(p.ItemID);
|
||||||
|
}
|
||||||
if (xc.HasChildNodes)
|
if (xc.HasChildNodes)
|
||||||
AddParts(xc, procInfo);
|
AddParts(xc, procInfo);
|
||||||
FixSectionStart(procInfo);
|
FixSectionStart(procInfo);
|
||||||
@ -4116,37 +4542,44 @@ namespace VEPROMS
|
|||||||
CheckForFloatingFoldout(contentid, config);
|
CheckForFloatingFoldout(contentid, config);
|
||||||
string userid = xc.Attributes.GetNamedItem("userid").InnerText;
|
string userid = xc.Attributes.GetNamedItem("userid").InnerText;
|
||||||
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
|
DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText);
|
||||||
sect = Section.MakeSection(parentInfo, prevInfo, number, text, sectiontype);
|
using (sect = Section.MakeSection(parentInfo, prevInfo, number, text, sectiontype))
|
||||||
sect.DTS = dts;
|
{
|
||||||
sect.UserID = userid;
|
sect.DTS = dts;
|
||||||
// check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute)
|
sect.UserID = userid;
|
||||||
XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to
|
// check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute)
|
||||||
string formatfilename = (fnNode != null) ? fnNode.InnerText : "";
|
XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to
|
||||||
if (formatid != string.Empty)
|
string formatfilename = (fnNode != null) ? fnNode.InnerText : "";
|
||||||
sect.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename);
|
// If this formatfile is a copy in this database (was not in exported database), use the copy name (note that the
|
||||||
sect.MyContent.Config = config;
|
// Config data must match and this was checked in the code that loads the formats:
|
||||||
sect.MyContent.DTS = dts;
|
if (formatid != string.Empty)
|
||||||
sect.MyContent.UserID = userid;
|
{
|
||||||
sect.Save();
|
if (existingCopyFCName.ContainsKey(formatfilename)) formatfilename = existingCopyFCName[formatfilename];
|
||||||
if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)))
|
sect.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename);
|
||||||
Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), sect.MyContent.ContentID);
|
}
|
||||||
else
|
sect.MyContent.Config = config;
|
||||||
Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = sect.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID
|
sect.MyContent.DTS = dts;
|
||||||
if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)))
|
sect.MyContent.UserID = userid;
|
||||||
Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), sect.ItemID);
|
sect.Save();
|
||||||
else
|
if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)))
|
||||||
Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = sect.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID
|
Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), sect.MyContent.ContentID);
|
||||||
if (xn.SelectNodes("annotation").Count > 0)
|
else
|
||||||
AddAnnotations(sect.ItemID, xn);
|
Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = sect.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID
|
||||||
if (xc.SelectNodes("entry").Count > 0)
|
if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)))
|
||||||
AddEntry(sect.MyContent, xc);
|
Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), sect.ItemID);
|
||||||
if (xc.SelectNodes("rousage").Count > 0)
|
else
|
||||||
AddROUsages(sect.MyContent, xc);
|
Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = sect.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID
|
||||||
if (xc.SelectNodes("transition").Count > 0)
|
if (xn.SelectNodes("annotation").Count > 0)
|
||||||
AddTransitions(sect.MyContent, xc);
|
AddAnnotations(sect.ItemID, xn);
|
||||||
prevInfo = SectionInfo.Get(sect.ItemID);
|
if (xc.SelectNodes("entry").Count > 0)
|
||||||
if (xc.HasChildNodes)
|
AddEntry(sect.MyContent, xc);
|
||||||
AddParts(xc, prevInfo);
|
if (xc.SelectNodes("rousage").Count > 0)
|
||||||
|
AddROUsages(sect.MyContent, xc);
|
||||||
|
if (xc.SelectNodes("transition").Count > 0)
|
||||||
|
AddTransitions(sect.MyContent, xc);
|
||||||
|
prevInfo = SectionInfo.Get(sect.ItemID);
|
||||||
|
if (xc.HasChildNodes)
|
||||||
|
AddParts(xc, prevInfo);
|
||||||
|
}
|
||||||
return prevInfo;
|
return prevInfo;
|
||||||
}
|
}
|
||||||
private string StripEnhanced(string config)
|
private string StripEnhanced(string config)
|
||||||
|
61
PROMS/VEPROMS User Interface/dlgUCFDetail.Designer.cs
generated
Normal file
61
PROMS/VEPROMS User Interface/dlgUCFDetail.Designer.cs
generated
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
namespace VEPROMS
|
||||||
|
{
|
||||||
|
partial class dlgUCFDetail
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.wbBrDet = new System.Windows.Forms.WebBrowser();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// wbBrDet
|
||||||
|
//
|
||||||
|
this.wbBrDet.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.wbBrDet.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.wbBrDet.MinimumSize = new System.Drawing.Size(20, 20);
|
||||||
|
this.wbBrDet.Name = "wbBrDet";
|
||||||
|
this.wbBrDet.Size = new System.Drawing.Size(897, 445);
|
||||||
|
this.wbBrDet.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// dlgUCFDetail
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(897, 445);
|
||||||
|
this.Controls.Add(this.wbBrDet);
|
||||||
|
this.Name = "dlgUCFDetail";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
|
this.Text = "User Control of Format Details";
|
||||||
|
this.Load += new System.EventHandler(this.dlgUCFDetail_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.WebBrowser wbBrDet;
|
||||||
|
}
|
||||||
|
}
|
77
PROMS/VEPROMS User Interface/dlgUCFDetail.cs
Normal file
77
PROMS/VEPROMS User Interface/dlgUCFDetail.cs
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Xml;
|
||||||
|
using System.IO;
|
||||||
|
using System.Xml.Xsl;
|
||||||
|
|
||||||
|
namespace VEPROMS
|
||||||
|
{
|
||||||
|
public partial class dlgUCFDetail : Form
|
||||||
|
{
|
||||||
|
private string MyFormatConfig;
|
||||||
|
private string UCFName;
|
||||||
|
private string Description;
|
||||||
|
// This brings up the dialog for displaying the details of what is contained in this User Control of Format
|
||||||
|
// as defined by the formatConfig. It uses XSL to display the xml. The XSL can be found in UCFDetails.xsl.
|
||||||
|
// The result is displayed in a web browser control on the dialog.
|
||||||
|
public dlgUCFDetail(string formatConfig, string name, string desc)
|
||||||
|
{
|
||||||
|
MyFormatConfig = formatConfig;
|
||||||
|
UCFName = name;
|
||||||
|
Description = desc;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
private void AddAttribute(XmlNode xn, string name, object value)
|
||||||
|
{
|
||||||
|
XmlAttribute xa = xn.OwnerDocument.CreateAttribute(name);
|
||||||
|
xa.Value = value.ToString();
|
||||||
|
xn.Attributes.Append(xa);
|
||||||
|
}
|
||||||
|
private void dlgUCFDetail_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//need to add the UCF name & description to this:
|
||||||
|
XmlDocument xd = new XmlDocument();
|
||||||
|
xd.LoadXml(MyFormatConfig);
|
||||||
|
XmlNodeList xnl = xd.GetElementsByTagName("FormatConfig");
|
||||||
|
if (xnl != null && xnl.Count > 0)
|
||||||
|
{
|
||||||
|
AddAttribute(xnl[0], "Name", UCFName);
|
||||||
|
AddAttribute(xnl[0], "Description", Description);
|
||||||
|
}
|
||||||
|
|
||||||
|
string sXSLSummary = System.IO.File.ReadAllText(Application.StartupPath + "\\" + "UCFDetails.xsl");
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
StringWriter xsw = new StringWriter();
|
||||||
|
using (XmlReader xrt = XmlReader.Create(new StringReader(sXSLSummary)))
|
||||||
|
{
|
||||||
|
XmlTextWriter tx = new XmlTextWriter(xsw);
|
||||||
|
xd.WriteTo(tx);
|
||||||
|
string tmp = sw.ToString();
|
||||||
|
tmp = xd.InnerXml;
|
||||||
|
using (XmlReader xri = XmlReader.Create(new StringReader(tmp)))
|
||||||
|
{
|
||||||
|
using (XmlWriter xwo = XmlWriter.Create(sw))
|
||||||
|
{
|
||||||
|
XslCompiledTransform xsl = new XslCompiledTransform();
|
||||||
|
xsl.Load(xrt);
|
||||||
|
xsl.Transform(xri, xwo); // Perform Transform
|
||||||
|
}
|
||||||
|
this.wbBrDet.DocumentText = sw.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Problem occurred displaying the details.", "UCF Warning", MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
PROMS/VEPROMS User Interface/dlgUCFDetail.resx
Normal file
120
PROMS/VEPROMS User Interface/dlgUCFDetail.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -130,6 +130,7 @@ namespace VEPROMS
|
|||||||
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
|
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
|
||||||
private StageInfoList myStageInfoList = null;
|
private StageInfoList myStageInfoList = null;
|
||||||
private LocalStageInfoList myLocalStageInfoList = null;
|
private LocalStageInfoList myLocalStageInfoList = null;
|
||||||
|
private int? _cmbxformatOriginal = null;
|
||||||
private void frmFolderProperties_Load(object sender, EventArgs e)
|
private void frmFolderProperties_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_Initializing = true;
|
_Initializing = true;
|
||||||
@ -150,6 +151,7 @@ namespace VEPROMS
|
|||||||
ppCmbxFormat.DisplayMember = "FullName";
|
ppCmbxFormat.DisplayMember = "FullName";
|
||||||
ppCmbxFormat.ValueMember = "FullName";
|
ppCmbxFormat.ValueMember = "FullName";
|
||||||
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
||||||
|
if (_FolderConfig != null && _FolderConfig.MyFolder != null) _cmbxformatOriginal = _FolderConfig.MyFolder.FormatID;
|
||||||
if (_FolderConfig.FormatSelection != null)
|
if (_FolderConfig.FormatSelection != null)
|
||||||
{
|
{
|
||||||
ppCmbxFormat.SelectedValue = _FolderConfig.FormatSelection;
|
ppCmbxFormat.SelectedValue = _FolderConfig.FormatSelection;
|
||||||
@ -350,6 +352,24 @@ namespace VEPROMS
|
|||||||
btnAnnoTypeUndo.PerformClick();
|
btnAnnoTypeUndo.PerformClick();
|
||||||
//if (btnAnnoTypeSave.Enabled) return;
|
//if (btnAnnoTypeSave.Enabled) return;
|
||||||
folderConfigBindingSource.EndEdit();
|
folderConfigBindingSource.EndEdit();
|
||||||
|
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
|
||||||
|
if (_FolderConfig.MyFolder.FormatID != _cmbxformatOriginal)
|
||||||
|
{
|
||||||
|
// clean up & then refresh the configs
|
||||||
|
using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByFolder(_FolderConfig.MyFolder.FolderID, _cmbxformatOriginal, _FolderConfig.MyFolder.FormatID))
|
||||||
|
{
|
||||||
|
foreach (ContentInfo ci in cil)
|
||||||
|
{
|
||||||
|
using (Content c = ci.Get())
|
||||||
|
{
|
||||||
|
// first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen
|
||||||
|
// and if configs aren't done first, the screen refresh, if based on config data, will not be correct.
|
||||||
|
foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig();
|
||||||
|
ContentInfo.Refresh(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Save Default settings for User
|
// Save Default settings for User
|
||||||
//
|
//
|
||||||
// Save whether we should display the default values on this property page
|
// Save whether we should display the default values on this property page
|
||||||
|
@ -72,6 +72,29 @@ namespace VEPROMS
|
|||||||
SaveText(ppProcTitleStpRTB);
|
SaveText(ppProcTitleStpRTB);
|
||||||
SaveText(ppProcNumStpRTB);
|
SaveText(ppProcNumStpRTB);
|
||||||
_ProcedureConfig.MyProcedure.MyProcedureInfo.CreateEnhanced = cbEnhanced.Checked;
|
_ProcedureConfig.MyProcedure.MyProcedureInfo.CreateEnhanced = cbEnhanced.Checked;
|
||||||
|
|
||||||
|
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
|
||||||
|
// To determine a change to the format, first see if selection changed in list and then see if the format selected does not match
|
||||||
|
// what was set on procedure, if necessary resolve for an inherited format.
|
||||||
|
|
||||||
|
if (_ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat != null &&
|
||||||
|
_ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat.FormatID != _cmbxformatOriginal)
|
||||||
|
{
|
||||||
|
// clean up & then refresh the configs
|
||||||
|
using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByItem(_ProcedureConfig.MyProcedure.ItemID, _cmbxformatOriginal, _ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat.FormatID))
|
||||||
|
{
|
||||||
|
foreach (ContentInfo ci in cil)
|
||||||
|
{
|
||||||
|
using (Content c = ci.Get())
|
||||||
|
{
|
||||||
|
// first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen
|
||||||
|
// and if configs aren't done first, the screen refresh, if based on config data, will not be correct.
|
||||||
|
foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig();
|
||||||
|
ContentInfo.Refresh(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
@ -149,7 +172,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
_ProcedureConfig.ParentLookup = false;
|
_ProcedureConfig.ParentLookup = false;
|
||||||
}
|
}
|
||||||
|
private int? _cmbxformatOriginal = null;
|
||||||
private void frmProcedureProperties_Load(object sender, EventArgs e)
|
private void frmProcedureProperties_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_Initializing = true;
|
_Initializing = true;
|
||||||
@ -161,10 +184,11 @@ namespace VEPROMS
|
|||||||
ppCmbxFormat.DisplayMember = "FullName";
|
ppCmbxFormat.DisplayMember = "FullName";
|
||||||
ppCmbxFormat.ValueMember = "FullName";
|
ppCmbxFormat.ValueMember = "FullName";
|
||||||
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
||||||
if (_ProcedureConfig.FormatSelection != null)
|
if (_ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat != null) _cmbxformatOriginal = _ProcedureConfig.MyProcedure.MyProcedureInfo.ActiveFormat.FormatID;
|
||||||
ppCmbxFormat.SelectedValue = _ProcedureConfig.FormatSelection;
|
if (_ProcedureConfig.FormatSelection != null)
|
||||||
else
|
ppCmbxFormat.SelectedValue = _ProcedureConfig.FormatSelection;
|
||||||
ppCmbxFormat.SelectedIndex = -1;
|
else
|
||||||
|
ppCmbxFormat.SelectedIndex = -1;
|
||||||
|
|
||||||
// Get the saved settings for this user
|
// Get the saved settings for this user
|
||||||
//
|
//
|
||||||
|
@ -121,10 +121,11 @@ namespace VEPROMS
|
|||||||
PlantFormat pf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
PlantFormat pf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
||||||
CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList;
|
CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList;
|
||||||
CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList;
|
CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList;
|
||||||
if (ppGpbxSignoffCheckoff.Enabled && (chkoffList != null && chkoffList.MaxIndex > 1)
|
int maxindx = pf.FormatData.ProcData.CheckOffUCF ? pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex : pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit;
|
||||||
|
if (ppGpbxSignoffCheckoff.Enabled && (chkoffList != null && maxindx > 1)
|
||||||
&& (ppCmbxCheckoffType.SelectedIndex != _SectionConfig.Section_CheckoffListSelection - (_hasSectionCheckoffDefault? 1:0)))
|
&& (ppCmbxCheckoffType.SelectedIndex != _SectionConfig.Section_CheckoffListSelection - (_hasSectionCheckoffDefault? 1:0)))
|
||||||
_SectionConfig.Section_CheckoffListSelection = ppCmbxCheckoffType.SelectedIndex + (_hasSectionCheckoffDefault? 1:0);
|
_SectionConfig.Section_CheckoffListSelection = ppCmbxCheckoffType.SelectedIndex + (_hasSectionCheckoffDefault? 1:0);
|
||||||
if (ppCmbxCheckoffHeading.Enabled && chkoffHeaderList != null && chkoffHeaderList.MaxIndex > 1)
|
if (ppCmbxCheckoffHeading.Enabled && chkoffHeaderList != null && chkoffHeaderList.MaxIndexNoInherit > 1)
|
||||||
_SectionConfig.Section_CheckoffHeaderSelection = ppCmbxCheckoffHeading.SelectedIndex;
|
_SectionConfig.Section_CheckoffHeaderSelection = ppCmbxCheckoffHeading.SelectedIndex;
|
||||||
|
|
||||||
if (ppCmbxSectPagination.SelectedValue == null)
|
if (ppCmbxSectPagination.SelectedValue == null)
|
||||||
@ -144,6 +145,28 @@ namespace VEPROMS
|
|||||||
DocumentInfo docinfo = DocumentInfo.Get(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.DocID);
|
DocumentInfo docinfo = DocumentInfo.Get(_SectionConfig.MySection.MyContent.MyEntry.MyDocument.DocID);
|
||||||
docinfo.RefreshDocumentEntries();
|
docinfo.RefreshDocumentEntries();
|
||||||
}
|
}
|
||||||
|
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
|
||||||
|
// To determine a change to the format, first see if selection changed in list and then see if the format selected does not match
|
||||||
|
// what was set on procedure, if necessary resolve for an inherited format.
|
||||||
|
if (_SectionConfig.MySection.MySectionInfo.ActiveFormat != null &&
|
||||||
|
_SectionConfig.MySection.MySectionInfo.ActiveFormat.FormatID != _cmbxformatOriginal)
|
||||||
|
{
|
||||||
|
// clean up & then refresh the configs
|
||||||
|
using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByItem(_SectionConfig.MySection.ItemID, _cmbxformatOriginal, _SectionConfig.MySection.MySectionInfo.ActiveFormat.FormatID))
|
||||||
|
{
|
||||||
|
foreach (ContentInfo ci in cil)
|
||||||
|
{
|
||||||
|
using (Content c = ci.Get())
|
||||||
|
{
|
||||||
|
// first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen
|
||||||
|
// and if configs aren't done first, the screen refresh, if based on config data, will not be correct.
|
||||||
|
foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig();
|
||||||
|
ContentInfo.Refresh(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if there was a document to delete, do it.
|
// if there was a document to delete, do it.
|
||||||
if (_DocumentToDelete != null)
|
if (_DocumentToDelete != null)
|
||||||
{
|
{
|
||||||
@ -301,6 +324,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private bool checkEnhancedSettings = false;
|
private bool checkEnhancedSettings = false;
|
||||||
|
private int? _cmbxformatOriginal = null;
|
||||||
private void frmSectionProperties_Load(object sender, EventArgs e)
|
private void frmSectionProperties_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_Initializing = true;
|
_Initializing = true;
|
||||||
@ -310,6 +334,7 @@ namespace VEPROMS
|
|||||||
ppCmbxFormat.DisplayMember = "FullName";
|
ppCmbxFormat.DisplayMember = "FullName";
|
||||||
ppCmbxFormat.ValueMember = "FullName";
|
ppCmbxFormat.ValueMember = "FullName";
|
||||||
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
||||||
|
if (_SectionConfig.MySection.MySectionInfo.ActiveFormat != null) _cmbxformatOriginal = (int)_SectionConfig.MySection.MySectionInfo.ActiveFormat.FormatID;
|
||||||
if (_SectionConfig.FormatSelection != null)
|
if (_SectionConfig.FormatSelection != null)
|
||||||
ppCmbxFormat.SelectedValue = _SectionConfig.FormatSelection;
|
ppCmbxFormat.SelectedValue = _SectionConfig.FormatSelection;
|
||||||
else
|
else
|
||||||
@ -680,7 +705,8 @@ namespace VEPROMS
|
|||||||
PlantFormat pf = _SectionConfig.MyFormat!=null?_SectionConfig.MyFormat.PlantFormat:_SectionConfig.MyDefaultFormat.PlantFormat;
|
PlantFormat pf = _SectionConfig.MyFormat!=null?_SectionConfig.MyFormat.PlantFormat:_SectionConfig.MyDefaultFormat.PlantFormat;
|
||||||
CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList;
|
CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList;
|
||||||
CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList;
|
CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList;
|
||||||
if (chkoffList != null && chkoffList.MaxIndex > 0 &&
|
int maxindx = pf.FormatData.ProcData.CheckOffUCF ? pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex : pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit;
|
||||||
|
if (chkoffList != null && maxindx > 0 &&
|
||||||
(pf.FormatData.ProcData.CheckOffData.Menu == "Signoff" || chkoffList[0].MenuItem.ToUpper().Equals("{SECTION DEFAULT}")))
|
(pf.FormatData.ProcData.CheckOffData.Menu == "Signoff" || chkoffList[0].MenuItem.ToUpper().Equals("{SECTION DEFAULT}")))
|
||||||
{
|
{
|
||||||
if (SectionPropertyCheckOffList!=null)SectionPropertyCheckOffList.Clear();
|
if (SectionPropertyCheckOffList!=null)SectionPropertyCheckOffList.Clear();
|
||||||
@ -688,10 +714,10 @@ namespace VEPROMS
|
|||||||
// Don't put up the first item in the chkoffList, it is '{Section Default}'.
|
// Don't put up the first item in the chkoffList, it is '{Section Default}'.
|
||||||
_hasSectionCheckoffDefault = false;
|
_hasSectionCheckoffDefault = false;
|
||||||
//for (int i = 1; i < chkoffList.Count; i++)
|
//for (int i = 1; i < chkoffList.Count; i++)
|
||||||
for (int i = 0; i < chkoffList.MaxIndex; i++)
|
foreach (CheckOff co in chkoffList)
|
||||||
{
|
{
|
||||||
if (!chkoffList[i].MenuItem.ToUpper().Equals("{SECTION DEFAULT}"))
|
if (!co.MenuItem.ToUpper().Equals("{SECTION DEFAULT}"))
|
||||||
SectionPropertyCheckOffList.Add(chkoffList[i]);
|
SectionPropertyCheckOffList.Add(co);
|
||||||
else
|
else
|
||||||
_hasSectionCheckoffDefault = true;
|
_hasSectionCheckoffDefault = true;
|
||||||
}
|
}
|
||||||
|
2076
PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs
generated
2076
PROMS/VEPROMS User Interface/frmSysOptions.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -70,6 +70,25 @@ namespace VEPROMS
|
|||||||
cbEnhancedDocumentSync.Checked = Settings.Default.SyncEnhancedDocuments;
|
cbEnhancedDocumentSync.Checked = Settings.Default.SyncEnhancedDocuments;
|
||||||
cbSeparateWindows.Checked = Settings.Default.SeparateWindows;
|
cbSeparateWindows.Checked = Settings.Default.SeparateWindows;
|
||||||
txbxVisioPath.Text = Settings.Default.VisioPath;
|
txbxVisioPath.Text = Settings.Default.VisioPath;
|
||||||
|
switch (Settings.Default.UCFImportOpt) // see dlgExportImport for descripton of these options.
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
cbUCFIgnore.Checked = true;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
cbUCFLNotUsed.Checked = true;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
cbUCFLOnlyImport.Checked = true;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
cbUCFLUseAll.Checked = true;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
cbUCFLForSetOnly.Checked = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private void cbEnhancedDocumentSync_CheckedChanged(object sender, System.EventArgs e)
|
private void cbEnhancedDocumentSync_CheckedChanged(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
@ -147,6 +166,7 @@ namespace VEPROMS
|
|||||||
private bool ss_SyncEnhancedDocuments;
|
private bool ss_SyncEnhancedDocuments;
|
||||||
private bool ss_SeparateWindows;
|
private bool ss_SeparateWindows;
|
||||||
private string ss_VisioPath;
|
private string ss_VisioPath;
|
||||||
|
private int ss_UCFImportOpt;
|
||||||
|
|
||||||
private void SaveStartingSettings()
|
private void SaveStartingSettings()
|
||||||
{
|
{
|
||||||
@ -161,6 +181,7 @@ namespace VEPROMS
|
|||||||
ss_SyncEnhancedDocuments = Settings.Default.SyncEnhancedDocuments;
|
ss_SyncEnhancedDocuments = Settings.Default.SyncEnhancedDocuments;
|
||||||
ss_SeparateWindows = Settings.Default.SeparateWindows;
|
ss_SeparateWindows = Settings.Default.SeparateWindows;
|
||||||
ss_VisioPath = Settings.Default.VisioPath;
|
ss_VisioPath = Settings.Default.VisioPath;
|
||||||
|
ss_UCFImportOpt = Settings.Default.UCFImportOpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RestoreStartingSettings() // used with the cancel button
|
private void RestoreStartingSettings() // used with the cancel button
|
||||||
@ -176,6 +197,7 @@ namespace VEPROMS
|
|||||||
Settings.Default.SyncEnhancedDocuments = ss_SyncEnhancedDocuments;
|
Settings.Default.SyncEnhancedDocuments = ss_SyncEnhancedDocuments;
|
||||||
Settings.Default.SeparateWindows = ss_SeparateWindows;
|
Settings.Default.SeparateWindows = ss_SeparateWindows;
|
||||||
Settings.Default.VisioPath = ss_VisioPath;
|
Settings.Default.VisioPath = ss_VisioPath;
|
||||||
|
Settings.Default.UCFImportOpt = ss_UCFImportOpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -262,5 +284,45 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
Settings.Default.VisioPath = txbxVisioPath.Text;
|
Settings.Default.VisioPath = txbxVisioPath.Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cbUCFIgnore_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!_initializing)
|
||||||
|
{
|
||||||
|
Settings.Default.UCFImportOpt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cbUCFLNotUsed_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!_initializing)
|
||||||
|
{
|
||||||
|
Settings.Default.UCFImportOpt = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cbUCFLOnlyImport_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!_initializing)
|
||||||
|
{
|
||||||
|
Settings.Default.UCFImportOpt = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cbUCFLUseAll_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!_initializing)
|
||||||
|
{
|
||||||
|
Settings.Default.UCFImportOpt = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cbUCFLForSetOnly_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!_initializing)
|
||||||
|
{
|
||||||
|
Settings.Default.UCFImportOpt = 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
966
PROMS/VEPROMS User Interface/frmUCF.cs
Normal file
966
PROMS/VEPROMS User Interface/frmUCF.cs
Normal file
@ -0,0 +1,966 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Xml;
|
||||||
|
using System.IO;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using VEPROMS.CSLA.Library;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Xml.Xsl;
|
||||||
|
|
||||||
|
|
||||||
|
namespace VEPROMS
|
||||||
|
{
|
||||||
|
// frmUCF is the main form for User Control of Format. It is accessible by Administrator & Set Administrator from the V button Administration
|
||||||
|
// menu. It uses the FormatConfig structure whose data is stored in the Config field of the Formats table. It uses XmlSerialization to
|
||||||
|
// store/retrieve the data from the database field and uses a Windows Property Grid to present the data, the data is tied to the
|
||||||
|
// Property Grid by setting the SelectedObject of the Property Grid to the FormatConfig. FormatConfig objects use TypeConverter(typeof(ExpandableObjectConverter)) on the
|
||||||
|
// fields to allow for accessing the data structures below the FormatConfig level (by default, fields are shown in the grid, Browsable(false) does
|
||||||
|
// not show the fields. NOTE that collection data uses the PropGridCollEditor, see that file for further information (in Volian.Base.Library)
|
||||||
|
//
|
||||||
|
public partial class frmUCF : Form
|
||||||
|
{
|
||||||
|
private bool _UcfForRepWords = false;
|
||||||
|
public bool UcfForRepWords // flags that UCF has changes to replace words - use for Reset button enabling
|
||||||
|
{
|
||||||
|
get { return _UcfForRepWords; }
|
||||||
|
set { _UcfForRepWords = value; }
|
||||||
|
}
|
||||||
|
private FormatConfig MyFormatConfig = new FormatConfig();
|
||||||
|
private PlantFormat OriginalPlantFormat;
|
||||||
|
private FormatInfo OriginalFormatInfo;
|
||||||
|
public frmUCF()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
private bool _Initializing = false;
|
||||||
|
private void frmUCF_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_Initializing = true;
|
||||||
|
PlantFormat.DoingUCFCheckOffs = true;
|
||||||
|
PlantFormat.DoingUCFCheckOffsUse = MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF ?? false;
|
||||||
|
cbxFormatList.DataSource = null;
|
||||||
|
cbxFormatList.DisplayMember = "FullName";
|
||||||
|
cbxFormatList.ValueMember = "FullName";
|
||||||
|
cbxFormatList.DataSource = FormatInfoList.GetFormatInfoListUsed();
|
||||||
|
cbxFormatList.SelectedIndex = -1;
|
||||||
|
MyFormatConfig = new FormatConfig();
|
||||||
|
PG.SelectedObject = MyFormatConfig;
|
||||||
|
PG.Enabled = false;
|
||||||
|
PG.SelectedGridItemChanged += PG_SelectedGridItemChanged;
|
||||||
|
PG.PropertyValueChanged += PG_PropertyValueChanged;
|
||||||
|
btnSaveAs.Enabled = false;
|
||||||
|
btnSaveClose.Enabled = false;
|
||||||
|
btnSave.Enabled = false;
|
||||||
|
btnReset.Enabled = false;
|
||||||
|
btnDelete.Enabled = false;
|
||||||
|
_Initializing = false;
|
||||||
|
}
|
||||||
|
void PG_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (SelectedGridField.EndsWith("Flags:UCF CheckOffs"))
|
||||||
|
{
|
||||||
|
// when changing whether the UCF format has the UCF checkoffs (there is a list of checkoffs/headers in the base format, when this
|
||||||
|
// flag is true, they get added to the list from the starting format), refresh the checkoff header & checkoff lists
|
||||||
|
if ((bool)e.OldValue != MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF)
|
||||||
|
{
|
||||||
|
// refresh the checkoff data in myformatconfig. Need to clear the checkoff header list & checkoff list before
|
||||||
|
// getting new data.
|
||||||
|
PlantFormat.DoingUCFCheckOffsUse = (bool)MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF;
|
||||||
|
GetUCFCheckOffDataForUCFGrid((bool)MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF);
|
||||||
|
PG.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string SelectedGridField = "Identification: Name"; // first field sectioned upon creation of form
|
||||||
|
void PG_SelectedGridItemChanged(object sender, SelectedGridItemChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (_Initializing || _formatListIndexChanging) return;
|
||||||
|
|
||||||
|
// refresh the summary data textbox data to show summary of what is in this UCF. This occurs when move off of a field which
|
||||||
|
// actually 'stores' the change.
|
||||||
|
FormatConfig tmpfc = GetChangesUCFForSave();
|
||||||
|
string scf = tmpfc.ConvertToString();
|
||||||
|
scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", "");
|
||||||
|
SetUCFSummary(scf);
|
||||||
|
|
||||||
|
// see if data has changed, and if so, enable the Reset button.
|
||||||
|
// Upon selection of a grid item, see if the grid item has data associated with it & if so, see if there has been
|
||||||
|
// a change. Code needs added here for any value listed on the main property grid, i.e. not part of a collection, or
|
||||||
|
// if the collection is reset in its entirety (replace words is an example of this).
|
||||||
|
bool enabled = false;
|
||||||
|
btnReset.Text = "Reset";
|
||||||
|
string previousSelectedGridField = SelectedGridField;
|
||||||
|
SelectedGridField = LabelPath(PG.SelectedGridItem);
|
||||||
|
// remove the following line before release:
|
||||||
|
lblPGItem.Text = SelectedGridField;
|
||||||
|
|
||||||
|
if (previousSelectedGridField.EndsWith("Identification: Name") && !SelectedGridField.EndsWith("Identification: Name")) SetButtonSaveAsEnabled();
|
||||||
|
if (previousSelectedGridField.EndsWith("Data:Plant Format:Step Settings:Replace Words List"))
|
||||||
|
{
|
||||||
|
// if moving off of the replace words, see if any changes exist so that Reset List button is enabled:
|
||||||
|
FormatConfig.ReplaceStrData rps = GetChangedReplaceListForSave();
|
||||||
|
UcfForRepWords = (rps != null && rps.Count > 0);
|
||||||
|
}
|
||||||
|
if (SelectedGridField.EndsWith("Identification: Name")) enabled = false;
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format")) enabled = false;
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Section Type Settings")) enabled = false;
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings")) enabled = false;
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags")) enabled = false;
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Compress Steps"))
|
||||||
|
{
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != null && MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps)
|
||||||
|
{
|
||||||
|
btnReset.Text = "Reset to " + OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps;
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Partial Step Compression"))
|
||||||
|
{
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != null && MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression)
|
||||||
|
{
|
||||||
|
btnReset.Text = "Reset to " + OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression;
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:UCF CheckOffs"))
|
||||||
|
{
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF != null && MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF != OriginalPlantFormat.FormatData.ProcData.CheckOffUCF)
|
||||||
|
{
|
||||||
|
btnReset.Text = "Reset to " + OriginalPlantFormat.FormatData.ProcData.CheckOffUCF;
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Replace Words List"))
|
||||||
|
{
|
||||||
|
if (UcfForRepWords) // flags that ucf data exists for replace words.
|
||||||
|
{
|
||||||
|
btnReset.Text = "Reset List";
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:CheckOff XOffset"))
|
||||||
|
{
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != null && MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != 0) // flags that ucf data exists for replace words.
|
||||||
|
{
|
||||||
|
btnReset.Text = "Reset to 0";
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Step List")) enabled = false;
|
||||||
|
else enabled = false;
|
||||||
|
|
||||||
|
btnReset.Enabled = enabled;
|
||||||
|
}
|
||||||
|
// remove the following method for release:
|
||||||
|
private string LabelPath(GridItem gi)
|
||||||
|
{
|
||||||
|
return (gi.Parent == null ? "" : LabelPath(gi.Parent) + ":" + gi.Label);
|
||||||
|
}
|
||||||
|
private void btnSaveClose_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// get a FormatConfig structure that only has differences from the original format. This is what gets saved.
|
||||||
|
FormatConfig tmpForSave = GetChangesUCFForSave();
|
||||||
|
string scf = tmpForSave.ConvertToString();
|
||||||
|
scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", "");
|
||||||
|
int fmtid = OriginalPlantFormat.MyFormat is Format ? (OriginalPlantFormat.MyFormat as Format).FormatID : (OriginalPlantFormat.MyFormat as FormatInfo).FormatID;
|
||||||
|
// for now, tell the user that changes don't take affect until reentry. This was done since the 'refresh' of FormatConfig was not
|
||||||
|
// working.
|
||||||
|
using (Format fmt = Format.Get(fmtid))
|
||||||
|
{
|
||||||
|
FormatInfo fi = FormatInfo.GetFormatNoUCFByFormatID(OriginalFormatInfo.FormatID);
|
||||||
|
if (fi.Data == "")
|
||||||
|
{
|
||||||
|
fmt.Data = "";
|
||||||
|
fmt.GenMac = "";
|
||||||
|
}
|
||||||
|
fmt.Config = scf;
|
||||||
|
fmt.Name = MyFormatConfig.Name;
|
||||||
|
fmt.Description = MyFormatConfig.Description;
|
||||||
|
fmt.Save(true);
|
||||||
|
MessageBox.Show(this, "Restart PROMS to have format changes take effect.", "", MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
|
OriginalPlantFormat.FormatData.ProcData.CheckOffData.ClearCheckOffAndHeaderLists();
|
||||||
|
PlantFormat.IgnoreUCF = false;
|
||||||
|
PlantFormat.DoingUCFCheckOffs = false;
|
||||||
|
}
|
||||||
|
private void btnCancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (OriginalPlantFormat != null) OriginalPlantFormat.FormatData.ProcData.CheckOffData.ClearCheckOffAndHeaderLists();
|
||||||
|
PlantFormat.IgnoreUCF = false;
|
||||||
|
PlantFormat.DoingUCFCheckOffs = false;
|
||||||
|
}
|
||||||
|
private bool _formatListIndexChanging = false; // don't change other selections when changing this index
|
||||||
|
private void cbxFormatList_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (_Initializing) return;
|
||||||
|
if (cbxFormatList.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
_formatListIndexChanging = true;
|
||||||
|
FormatInfoList fl = FormatInfoList.GetFormatInfoListUsed();
|
||||||
|
// Get the format data, the query in GetFormatInfoListUsed may have null for data/genmac which causes a
|
||||||
|
// problem when reading the 'parent' data for UCF saved as formats.
|
||||||
|
int i = -1;
|
||||||
|
FormatInfo finfo = cbxFormatList.SelectedItem as FormatInfo;
|
||||||
|
if (finfo == null) finfo = fl[cbxFormatList.SelectedIndex];
|
||||||
|
OriginalFormatInfo = FormatInfo.Get(finfo.FormatID);
|
||||||
|
OriginalPlantFormat = OriginalFormatInfo.PlantFormat;
|
||||||
|
|
||||||
|
// get original data when accessing the plant format data (not UCF because it UCF data is being modified):
|
||||||
|
PlantFormat.IgnoreUCF = true;
|
||||||
|
int formatid = OriginalPlantFormat.MyFormat is Format ? (OriginalPlantFormat.MyFormat as Format).FormatID : (OriginalPlantFormat.MyFormat as FormatInfo).FormatID;
|
||||||
|
FormatInfo fi = FormatInfo.Get(formatid);
|
||||||
|
// if this has config data it is a UCF format, the MyFormatConfig has the config data & see if doing additional checkoffs.
|
||||||
|
// Also, put out the summary of the changes if it is a 'UCF' and if no differences just state that.
|
||||||
|
btnDetails.Visible = true;
|
||||||
|
lblSummary.Visible = true;
|
||||||
|
tbUCFSummary.Visible = true;
|
||||||
|
if (fi.Config != null && fi.Config != "")
|
||||||
|
{
|
||||||
|
MyFormatConfig = FormatConfig.Get(fi.Config);
|
||||||
|
PlantFormat.DoingUCFCheckOffsUse = MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF ?? false;
|
||||||
|
btnSaveClose.Enabled = true; // UCF formats can be modified and saved.
|
||||||
|
btnSave.Enabled = true;
|
||||||
|
SetUCFSummary(fi.Config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MyFormatConfig = new FormatConfig();
|
||||||
|
btnSaveClose.Enabled = false;
|
||||||
|
btnSave.Enabled = false;
|
||||||
|
tbUCFSummary.Text = "No differences from original";
|
||||||
|
}
|
||||||
|
// initialize the data based on the selected format with any changes from the FormatConfig.
|
||||||
|
GetUCFDataForUCFGrid();
|
||||||
|
PG.Enabled = true;
|
||||||
|
PG.SelectedObject = MyFormatConfig;
|
||||||
|
btnSaveAs.Enabled = false;
|
||||||
|
SetDeleteOrResetAllButton();
|
||||||
|
|
||||||
|
// set derived from if there is a parent:
|
||||||
|
if (OriginalFormatInfo.MyParent.FormatID == 1)
|
||||||
|
{
|
||||||
|
lblDerFrom.Visible = false;
|
||||||
|
lblDerivedFrom.Visible = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get to top parent format:
|
||||||
|
FormatInfo p = OriginalFormatInfo;
|
||||||
|
while (p.MyParent.FormatID != 1) p = p.MyParent;
|
||||||
|
lblDerFrom.Visible = true;
|
||||||
|
lblDerivedFrom.Visible = true;
|
||||||
|
lblDerivedFrom.Text = p.Name.Replace("_UCF", "") + "->" + OriginalFormatInfo.MyParent.Name.Replace("_UCF", "") + ":" + OriginalFormatInfo.MyParent.Description;
|
||||||
|
}
|
||||||
|
_formatListIndexChanging = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetUCFSummary(string formatConfig)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string sXSLSummary = System.IO.File.ReadAllText(Application.StartupPath + "\\" + "UCFSummary.xsl");
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
using (XmlReader xrt = XmlReader.Create(new StringReader(sXSLSummary)))
|
||||||
|
{
|
||||||
|
using (XmlReader xri = XmlReader.Create(new StringReader(formatConfig)))
|
||||||
|
{
|
||||||
|
using (XmlWriter xwo = XmlWriter.Create(sw))
|
||||||
|
{
|
||||||
|
XslCompiledTransform xsl = new XslCompiledTransform();
|
||||||
|
xsl.Load(xrt);
|
||||||
|
xsl.Transform(xri, null, sw);
|
||||||
|
}
|
||||||
|
if (sw == null || sw.ToString() == "")
|
||||||
|
tbUCFSummary.Text = "No differences from original";
|
||||||
|
else
|
||||||
|
tbUCFSummary.Text = sw.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Error getting summary for UCF differences", MessageBoxButtons.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// The SaveAs Button should only be enabled if the user has given this format change a unique 'Name'.
|
||||||
|
private void SetButtonSaveAsEnabled()
|
||||||
|
{
|
||||||
|
btnSaveAs.Enabled = false;
|
||||||
|
if (MyFormatConfig.Name == null || MyFormatConfig.Name == "") return;
|
||||||
|
// See if Name has been changed:
|
||||||
|
if (MyFormatConfig.Name == OriginalFormatInfo.Name) return;
|
||||||
|
|
||||||
|
// See if the Name is unique
|
||||||
|
foreach (FormatInfo fi in FormatInfoList.SortedFormatInfoList)
|
||||||
|
{
|
||||||
|
if (MyFormatConfig.Name == fi.Name && MyFormatConfig.Name != savDBFormatConfig.Name)
|
||||||
|
{
|
||||||
|
MessageBox.Show("A format with Name " + MyFormatConfig.Name + " already exists. Name must be unique. Change the name before a Save As can be done.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
btnSaveAs.Enabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// If the selected format is a UCF 'Save As', then possibly allow delete (if not used). Otherwise, if selected format
|
||||||
|
// has Config data, i.e. UCF data, then change button text to 'Revert to Original'. In both cases, enable button, otherwise it is disabled.
|
||||||
|
private void SetDeleteOrResetAllButton()
|
||||||
|
{
|
||||||
|
btnDelete.Enabled = false;
|
||||||
|
// See if UCF Save As, i.e. Data/Genmac are null and that the format is not used.
|
||||||
|
FormatInfo fi = FormatInfo.GetFormatNoUCFByFormatID(OriginalFormatInfo.FormatID);
|
||||||
|
if (fi.Data == "")
|
||||||
|
{
|
||||||
|
if (OriginalFormatInfo.ChildFormatCount == 0 && OriginalFormatInfo.FormatContentCount == 0 && OriginalFormatInfo.FormatDocVersionCount == 0 && OriginalFormatInfo.FormatFolderCount == 0)
|
||||||
|
{
|
||||||
|
btnDelete.Enabled = true;
|
||||||
|
btnDelete.Text = "Delete";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (OriginalFormatInfo.Config != null && OriginalFormatInfo.Config != "")
|
||||||
|
{
|
||||||
|
btnDelete.Enabled = true;
|
||||||
|
btnDelete.Text = "Revert to Original";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// GetChangeUCFForSave compares UCF data in FormatConfig to the original PlantFormat data to see if there
|
||||||
|
// are changes that need to be saved to the database.
|
||||||
|
private FormatConfig savDBFormatConfig;
|
||||||
|
private FormatConfig GetChangesUCFForSave()
|
||||||
|
{
|
||||||
|
FormatConfig changesOnly = new FormatConfig();
|
||||||
|
|
||||||
|
// Flags
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != null && MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps)
|
||||||
|
changesOnly.PlantFormat.FormatData.Flags.CompressSteps = MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps;
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != null && MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression != OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression)
|
||||||
|
changesOnly.PlantFormat.FormatData.Flags.PartialStepCompression = MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression;
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF != null && MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF == true) // save if true (original format is always false)
|
||||||
|
changesOnly.PlantFormat.FormatData.Flags.CheckOffUCF = MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF;
|
||||||
|
|
||||||
|
// CheckOff Headers
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList != null) changesOnly.PlantFormat.FormatData.CheckOffHeaderList = GetChangeCheckOffHeaderListForSave();
|
||||||
|
|
||||||
|
// CheckOffs
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.CheckOffList != null) changesOnly.PlantFormat.FormatData.CheckOffList = GetChangeCheckOffListForSave();
|
||||||
|
|
||||||
|
// Checkoff xoffset adjustment
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != null && MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj != 0) // save if not zero (original format is always zero)
|
||||||
|
changesOnly.PlantFormat.FormatData.CheckOffXOffAdj = MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj;
|
||||||
|
|
||||||
|
// steps
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.StepData != null) changesOnly.PlantFormat.FormatData.StepData = GetChangeStepListForSave();
|
||||||
|
|
||||||
|
// replace words - just store them all, if there are differences... can't handle deleted unless doing this.
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.ReplaceStrData != null) changesOnly.PlantFormat.FormatData.ReplaceStrData = GetChangedReplaceListForSave();
|
||||||
|
|
||||||
|
// docstyles
|
||||||
|
FormatConfig.DocStyles retds = new FormatConfig.DocStyles();
|
||||||
|
foreach (DocStyle dsorig in OriginalPlantFormat.DocStyles.DocStyleList)
|
||||||
|
{
|
||||||
|
if (!dsorig.Inactive && dsorig.IsStepSection)
|
||||||
|
{
|
||||||
|
FormatConfig.DocStyle ds = new FormatConfig.DocStyle();
|
||||||
|
ds.Index = dsorig.Index.ToString();
|
||||||
|
ds.Name = dsorig.Name;
|
||||||
|
if (ds.Layout == null) ds.Layout = new FormatConfig.Layout();
|
||||||
|
// See if in the FormatConfig, use it
|
||||||
|
FormatConfig.DocStyle found = null;
|
||||||
|
if (MyFormatConfig.PlantFormat.DocStyles != null)
|
||||||
|
{
|
||||||
|
foreach (FormatConfig.DocStyle fcds in MyFormatConfig.PlantFormat.DocStyles)
|
||||||
|
{
|
||||||
|
float? difl = Math.Abs((float)((fcds.Layout.LeftMargin * 72) - dsorig.Layout.LeftMargin));
|
||||||
|
float? difp = Math.Abs((float)((fcds.Layout.PageLength * 72) - dsorig.Layout.PageLength));
|
||||||
|
if (fcds.Index == dsorig.Index.ToString() && (difl > 1 || difp > 1))
|
||||||
|
{
|
||||||
|
found = fcds;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found != null) // save it values are different.
|
||||||
|
{
|
||||||
|
if ((found.Layout.LeftMargin * 72) != dsorig.Layout.LeftMargin) ds.Layout.LeftMargin = found.Layout.LeftMargin * 72;
|
||||||
|
else ds.Layout.LeftMargin = null;
|
||||||
|
if ((found.Layout.PageLength * 72) != dsorig.Layout.PageLength) ds.Layout.PageLength = found.Layout.PageLength * 72;
|
||||||
|
else ds.Layout.PageLength = null;
|
||||||
|
retds.Add(ds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (retds.Count > 0) changesOnly.PlantFormat.DocStyles = retds;
|
||||||
|
return changesOnly;
|
||||||
|
}
|
||||||
|
// Check for differences in the checkoffheaderlist & checkofflist. Only Active flag is used:
|
||||||
|
private FormatConfig.CheckOffHeaderList GetChangeCheckOffHeaderListForSave()
|
||||||
|
{
|
||||||
|
FormatConfig.CheckOffHeaderList cohlist = new FormatConfig.CheckOffHeaderList();
|
||||||
|
foreach (FormatConfig.CheckOffHeader coh in MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList)
|
||||||
|
{
|
||||||
|
if (!(bool)coh.Active) cohlist.Add(coh);
|
||||||
|
}
|
||||||
|
return cohlist;
|
||||||
|
}
|
||||||
|
private FormatConfig.CheckOffList GetChangeCheckOffListForSave()
|
||||||
|
{
|
||||||
|
FormatConfig.CheckOffList colist = new FormatConfig.CheckOffList();
|
||||||
|
foreach (FormatConfig.CheckOff co in MyFormatConfig.PlantFormat.FormatData.CheckOffList)
|
||||||
|
{
|
||||||
|
if (!(bool)co.Active) colist.Add(co);
|
||||||
|
}
|
||||||
|
return colist;
|
||||||
|
}
|
||||||
|
// Check for differences in the StepDataList between UCF and original data for saving of data to database:
|
||||||
|
private FormatConfig.StepData GetChangeStepListForSave()
|
||||||
|
{
|
||||||
|
FormatConfig.StepData sdlist = new FormatConfig.StepData();
|
||||||
|
foreach (StepData sdorig in OriginalPlantFormat.FormatData.StepDataList)
|
||||||
|
{
|
||||||
|
if (!sdorig.Inactive)
|
||||||
|
{
|
||||||
|
// find this step in the config data:
|
||||||
|
foreach (FormatConfig.Step fcstp in MyFormatConfig.PlantFormat.FormatData.StepData)
|
||||||
|
{
|
||||||
|
if (fcstp.Index == sdorig.Index.ToString())
|
||||||
|
{
|
||||||
|
// see if data is different and if so, add it to the return list:
|
||||||
|
System.Drawing.FontConverter cvt = new System.Drawing.FontConverter();
|
||||||
|
string origFont = cvt.ConvertToString(sdorig.Font.WindowsFont);
|
||||||
|
string newFont = cvt.ConvertToString(fcstp.FontDesc.WindowsFont);
|
||||||
|
if (origFont != newFont)
|
||||||
|
{
|
||||||
|
FormatConfig.Step stp = fcstp;
|
||||||
|
sdlist.Add(stp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sdlist;
|
||||||
|
}
|
||||||
|
// Check for differences in the ReplaceWords between UCF and original data for saving of data to database:
|
||||||
|
private FormatConfig.ReplaceStrData GetChangedReplaceListForSave()
|
||||||
|
{
|
||||||
|
// only saving the differences
|
||||||
|
// need to compare the original format list with the list as it is stored for UCF, i.e.working with property grid and save differences.
|
||||||
|
// Note that check for 'bad' data such as no flags, or null/empty replace with/word strings - don't use those.
|
||||||
|
// States for replacewords: 0 = no change, -1 deleted, 1 added, 2 modified
|
||||||
|
FormatConfig.ReplaceStrData retlist = new FormatConfig.ReplaceStrData(); // list of changes
|
||||||
|
foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData)
|
||||||
|
{
|
||||||
|
// Modified
|
||||||
|
foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList)
|
||||||
|
{
|
||||||
|
if (origrepstr.ReplaceWord.Replace("{Backspace}", "") == ucfrepstr.ReplaceWord.Replace("{Backspace}", ""))
|
||||||
|
{
|
||||||
|
// if deleted or if anything is different, save it
|
||||||
|
if (((E_ReplaceFlags)ucfrepstr.Flag != origrepstr.Flag || ucfrepstr.ReplaceWith != origrepstr.ReplaceWith) && ucfrepstr.Flag != 0 && ucfrepstr.ReplaceWith != "")
|
||||||
|
{
|
||||||
|
ucfrepstr.State = 2;
|
||||||
|
retlist.Add(ucfrepstr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Added:
|
||||||
|
List<string> origstrList = new List<string>(); // used to find added, (see later in this method)
|
||||||
|
foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList) origstrList.Add(origrepstr.ReplaceWord);
|
||||||
|
foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData)
|
||||||
|
{
|
||||||
|
if (!origstrList.Contains(ucfrepstr.ReplaceWord))
|
||||||
|
{
|
||||||
|
// check for valid data, i.e. flag set & both replaceword & with not blank
|
||||||
|
//if (ucfrepstr.Flag != 0 && ucfrepstr.ReplaceWith != null && ucfrepstr.ReplaceWith != "" && ucfrepstr.ReplaceWord != null && ucfrepstr.ReplaceWord != "")
|
||||||
|
if (ucfrepstr.Flag != 0 && ucfrepstr.ReplaceWith != null && ucfrepstr.ReplaceWith != "" && ucfrepstr.ReplaceWord != null && ucfrepstr.ReplaceWord != "")
|
||||||
|
{
|
||||||
|
ucfrepstr.State = 1;
|
||||||
|
retlist.Add(ucfrepstr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Deleted:
|
||||||
|
List<string> ucfList = new List<string>(); // used to find deleted
|
||||||
|
foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData) ucfList.Add(ucfrepstr.ReplaceWord);
|
||||||
|
foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList)
|
||||||
|
{
|
||||||
|
if (!ucfList.Contains(origrepstr.ReplaceWord))
|
||||||
|
{
|
||||||
|
if (!((origrepstr.ReplaceWith.Contains("$1") && origrepstr.ReplaceWord.Contains("w*")) || origrepstr.ReplaceWith.Contains("{Backspace}")))
|
||||||
|
{
|
||||||
|
// make a deleted replacestr to save
|
||||||
|
FormatConfig.ReplaceStr del = new FormatConfig.ReplaceStr();
|
||||||
|
del.State = -1;
|
||||||
|
del.Flag = (FormatConfig.E_ReplaceFlagsUCF)origrepstr.Flag;
|
||||||
|
del.ReplaceWord = origrepstr.ReplaceWord;
|
||||||
|
del.ReplaceWith = origrepstr.ReplaceWith;
|
||||||
|
//del.ReplaceWith = origrepstr.ReplaceWith;
|
||||||
|
retlist.Add(del);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retlist;
|
||||||
|
}
|
||||||
|
// The following uses the original format's ReplaceWords list and applies any changes made from the UCF ReplaceWords list.
|
||||||
|
private FormatConfig.ReplaceStrData GetMergedReplaceList()
|
||||||
|
{
|
||||||
|
// need to compare the original format list with the list as it is stored for working with property grid.
|
||||||
|
FormatConfig.ReplaceStrData retlist = new FormatConfig.ReplaceStrData(); // merged list
|
||||||
|
List<string> inoriglist = new List<string>(); // use this list to find new items in formatconfig (see below)
|
||||||
|
foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList)
|
||||||
|
{
|
||||||
|
// In the format config list (UCF), find the 'ReplaceWord'. This is the 'key' for defining whether the
|
||||||
|
// replace word has been overwridden by UCF data. If it exists, use it:
|
||||||
|
FormatConfig.ReplaceStr usethisone = null;
|
||||||
|
bool deleted = false;
|
||||||
|
// States for replacewords: 0 = no change, -1 deleted, 1 added, 2 modified
|
||||||
|
foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData)
|
||||||
|
{
|
||||||
|
if (ucfrepstr.ReplaceWord == origrepstr.ReplaceWord)
|
||||||
|
{
|
||||||
|
if (ucfrepstr.State == -1) deleted = true;
|
||||||
|
else usethisone = ucfrepstr;
|
||||||
|
ucfrepstr.State = 2;
|
||||||
|
inoriglist.Add(origrepstr.ReplaceWord);
|
||||||
|
UcfForRepWords = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// don't add in the replacewords that use 'Backspace' and regular expressions:
|
||||||
|
bool supported = true;
|
||||||
|
if (!deleted && usethisone == null)
|
||||||
|
{
|
||||||
|
if ((origrepstr.ReplaceWith.Contains("$1") || origrepstr.ReplaceWord.Contains("w*")) || origrepstr.ReplaceWith.Contains("{Backspace}"))
|
||||||
|
supported = false;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
usethisone = new FormatConfig.ReplaceStr();
|
||||||
|
usethisone.Flag = (FormatConfig.E_ReplaceFlagsUCF)origrepstr.Flag;
|
||||||
|
usethisone.State = 0; // no change
|
||||||
|
usethisone.ReplaceWith = origrepstr.ReplaceWith;
|
||||||
|
usethisone.ReplaceWord = origrepstr.ReplaceWord;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!deleted && supported) retlist.Add(usethisone);
|
||||||
|
}
|
||||||
|
// now add in any ucf only replacements, any that are not in the inoriglist
|
||||||
|
foreach (FormatConfig.ReplaceStr ucfrepstr in MyFormatConfig.PlantFormat.FormatData.ReplaceStrData)
|
||||||
|
{
|
||||||
|
if (!inoriglist.Contains(ucfrepstr.ReplaceWord))
|
||||||
|
{
|
||||||
|
FormatConfig.ReplaceStr newone = new FormatConfig.ReplaceStr();
|
||||||
|
newone.Flag = (FormatConfig.E_ReplaceFlagsUCF)ucfrepstr.Flag;
|
||||||
|
newone.State = 1;
|
||||||
|
//newone.ReplaceWith = ucfrepstr.ReplaceWith;
|
||||||
|
newone.ReplaceWith = ucfrepstr.ReplaceWith;
|
||||||
|
newone.ReplaceWord = ucfrepstr.ReplaceWord;
|
||||||
|
retlist.Add(newone);
|
||||||
|
UcfForRepWords = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (retlist);
|
||||||
|
}
|
||||||
|
// This method reads in the format items, merging any changes from UCF into original format. It sets MyFormatConfig, which
|
||||||
|
// is the structure that gets used by the PropertyGrid
|
||||||
|
private void GetUCFDataForUCFGrid()
|
||||||
|
{
|
||||||
|
// name/description is only stored as format record fields. There are attributes in formatconfig xml that are used for defining these
|
||||||
|
// when new UCFs are defined or allowing for updates.
|
||||||
|
MyFormatConfig.Name = OriginalFormatInfo.Name;
|
||||||
|
MyFormatConfig.Description = OriginalFormatInfo.Description;
|
||||||
|
|
||||||
|
// Store original (currently saved FormatConfig) to be used for comparison when saving.
|
||||||
|
savDBFormatConfig = MyFormatConfig;
|
||||||
|
|
||||||
|
// Flags
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps == null) MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps;
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression == null) MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression;
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF == null) MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF = OriginalPlantFormat.FormatData.ProcData.CheckOffUCF;
|
||||||
|
|
||||||
|
// checkoff xoffset adjustment
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj == null) MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj = 0;
|
||||||
|
|
||||||
|
GetUCFCheckOffDataForUCFGrid((bool)MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF);
|
||||||
|
|
||||||
|
// StepData: If there is no UCF data for steps, copy over from selected format
|
||||||
|
FormatConfig.StepData sdlMerged = new FormatConfig.StepData();
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.StepData == null || MyFormatConfig.PlantFormat.FormatData.StepData.Count == 0)
|
||||||
|
{
|
||||||
|
foreach (StepData sdorig in OriginalPlantFormat.FormatData.StepDataList)
|
||||||
|
{
|
||||||
|
if (!sdorig.Inactive && sdorig.Index != 0)
|
||||||
|
{
|
||||||
|
FormatConfig.Step stp = new FormatConfig.Step();
|
||||||
|
stp.Index = sdorig.Index.ToString();
|
||||||
|
stp.Type = sdorig.Type;
|
||||||
|
stp.FontDesc = new FormatConfig.FontDesc();
|
||||||
|
stp.FontDesc.OrigWindowsFont = sdorig.Font.WindowsFont;
|
||||||
|
stp.FontDesc.WindowsFont = sdorig.Font.WindowsFont;
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.StepData == null) MyFormatConfig.PlantFormat.FormatData.StepData = new FormatConfig.StepData();
|
||||||
|
sdlMerged.Add(stp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (StepData sdorig in OriginalPlantFormat.FormatData.StepDataList)
|
||||||
|
{
|
||||||
|
if (!sdorig.Inactive && sdorig.Index != 0)
|
||||||
|
{
|
||||||
|
FormatConfig.Step stp = new FormatConfig.Step();
|
||||||
|
stp.Index = sdorig.Index.ToString();
|
||||||
|
stp.Type = sdorig.Type;
|
||||||
|
stp.FontDesc = new FormatConfig.FontDesc();
|
||||||
|
// See if in the FormatConfig, use it
|
||||||
|
FormatConfig.Step foundinFC = null;
|
||||||
|
foreach (FormatConfig.Step fcstp in MyFormatConfig.PlantFormat.FormatData.StepData)
|
||||||
|
{
|
||||||
|
if (fcstp.Index == sdorig.Index.ToString())
|
||||||
|
{
|
||||||
|
foundinFC = fcstp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stp.FontDesc.OrigWindowsFont = new System.Drawing.Font(sdorig.Font.Family, (float)sdorig.Font.Size, sdorig.Font.WindowsFont.Style);
|
||||||
|
if (foundinFC != null)
|
||||||
|
stp.FontDesc.WindowsFont = new System.Drawing.Font(foundinFC.FontDesc.WindowsFont.Name, foundinFC.FontDesc.WindowsFont.Size, foundinFC.FontDesc.WindowsFont.Style);
|
||||||
|
else
|
||||||
|
stp.FontDesc.WindowsFont = new System.Drawing.Font(sdorig.Font.Family, (float)sdorig.Font.Size, sdorig.Font.WindowsFont.Style);
|
||||||
|
sdlMerged.Add(stp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.StepData = sdlMerged;
|
||||||
|
|
||||||
|
// ReplacWords
|
||||||
|
// if there are no replace str entries in sc, add from the selected format:
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.ReplaceStrData == null || MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Count == 0)
|
||||||
|
{
|
||||||
|
foreach (ReplaceStr repstrorig in OriginalPlantFormat.FormatData.SectData.ReplaceStrList)
|
||||||
|
{
|
||||||
|
if (!((repstrorig.ReplaceWith.Contains("$1") && repstrorig.ReplaceWord.Contains("w*")) || repstrorig.ReplaceWith.Contains("{Backspace}")))
|
||||||
|
{
|
||||||
|
FormatConfig.ReplaceStr rsfc = new FormatConfig.ReplaceStr();
|
||||||
|
rsfc.Flag = (FormatConfig.E_ReplaceFlagsUCF)repstrorig.Flag;
|
||||||
|
rsfc.State = 0;
|
||||||
|
rsfc.ReplaceWith = repstrorig.ReplaceWith;
|
||||||
|
rsfc.ReplaceWord = repstrorig.ReplaceWord;
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Add(rsfc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.ReplaceStrData = GetMergedReplaceList();
|
||||||
|
}
|
||||||
|
// Document Style (section) Data (docstyles). Get step editor type only
|
||||||
|
if (MyFormatConfig.PlantFormat.DocStyles == null || MyFormatConfig.PlantFormat.DocStyles.Count == 0)
|
||||||
|
{
|
||||||
|
foreach (DocStyle dsorig in OriginalPlantFormat.DocStyles.DocStyleList)
|
||||||
|
{
|
||||||
|
if (!dsorig.Inactive && dsorig.IsStepSection)
|
||||||
|
{
|
||||||
|
FormatConfig.DocStyle ds = new FormatConfig.DocStyle();
|
||||||
|
ds.Index = dsorig.Index.ToString();
|
||||||
|
ds.Name = dsorig.Name;
|
||||||
|
if (ds.Layout == null) ds.Layout = new FormatConfig.Layout();
|
||||||
|
ds.Layout.PageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2);
|
||||||
|
ds.Layout.OrigPageLength = ds.Layout.PageLength;
|
||||||
|
ds.Layout.LeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2);
|
||||||
|
ds.Layout.OrigLeftMargin = ds.Layout.LeftMargin;
|
||||||
|
if (MyFormatConfig.PlantFormat.DocStyles == null) MyFormatConfig.PlantFormat.DocStyles = new FormatConfig.DocStyles();
|
||||||
|
MyFormatConfig.PlantFormat.DocStyles.Add(ds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (DocStyle dsorig in OriginalPlantFormat.DocStyles.DocStyleList)
|
||||||
|
{
|
||||||
|
if (!dsorig.Inactive && dsorig.IsStepSection)
|
||||||
|
{
|
||||||
|
FormatConfig.DocStyle ds = new FormatConfig.DocStyle();
|
||||||
|
ds.Index = dsorig.Index.ToString();
|
||||||
|
ds.Name = dsorig.Name;
|
||||||
|
if (ds.Layout == null) ds.Layout = new FormatConfig.Layout();
|
||||||
|
// See if in the FormatConfig, use it
|
||||||
|
FormatConfig.DocStyle foundinFC = null;
|
||||||
|
foreach (FormatConfig.DocStyle fcds in MyFormatConfig.PlantFormat.DocStyles)
|
||||||
|
{
|
||||||
|
if (fcds.Index == dsorig.Index.ToString())
|
||||||
|
{
|
||||||
|
foundinFC = fcds;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (foundinFC != null)
|
||||||
|
{
|
||||||
|
if (foundinFC.Layout.LeftMargin == null) foundinFC.Layout.LeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2);
|
||||||
|
else foundinFC.Layout.LeftMargin = (float)Math.Round((float)foundinFC.Layout.LeftMargin / 72, 2);
|
||||||
|
foundinFC.Layout.OrigLeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2);
|
||||||
|
if (foundinFC.Layout.PageLength == null) foundinFC.Layout.PageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2);
|
||||||
|
else foundinFC.Layout.PageLength = (float)Math.Round((float)foundinFC.Layout.PageLength / 72, 2);
|
||||||
|
foundinFC.Layout.OrigPageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ds.Layout.OrigLeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2);
|
||||||
|
ds.Layout.OrigPageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2);
|
||||||
|
ds.Layout.LeftMargin = (float)Math.Round((float)dsorig.Layout.LeftMargin / 72, 2);
|
||||||
|
ds.Layout.PageLength = (float)Math.Round((float)dsorig.Layout.PageLength / 72, 2);
|
||||||
|
MyFormatConfig.PlantFormat.DocStyles.Add(ds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetUCFCheckOffDataForUCFGrid(bool ucfcheckof)
|
||||||
|
{
|
||||||
|
OriginalPlantFormat.FormatData.ProcData.CheckOffData.ClearCheckOffAndHeaderLists();
|
||||||
|
// CheckOffHeaders: If there is no UCF data, use from the selected format, otherwise merge:
|
||||||
|
FormatConfig.CheckOffHeaderList cohdrsMerged = new FormatConfig.CheckOffHeaderList();
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList == null || MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList.Count == 0)
|
||||||
|
{
|
||||||
|
foreach (CheckOffHeader cohorig in OriginalPlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList)
|
||||||
|
{
|
||||||
|
// do inactive::
|
||||||
|
FormatConfig.CheckOffHeader coh = new FormatConfig.CheckOffHeader();
|
||||||
|
coh.Index = cohorig.Index.ToString();
|
||||||
|
coh.CheckOffHeading = cohorig.CheckOffHeading;
|
||||||
|
coh.Active = true;
|
||||||
|
coh.OrigActive = true;
|
||||||
|
cohdrsMerged.Add(coh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (CheckOffHeader cohorig in OriginalPlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList)
|
||||||
|
{
|
||||||
|
FormatConfig.CheckOffHeader coh = new FormatConfig.CheckOffHeader();
|
||||||
|
coh.Index = cohorig.Index.ToString();
|
||||||
|
coh.CheckOffHeading = cohorig.CheckOffHeading;
|
||||||
|
coh.Active = true;
|
||||||
|
coh.OrigActive = true;
|
||||||
|
// See if in the FormatConfig, to check its inactive flag:
|
||||||
|
foreach (FormatConfig.CheckOffHeader fccoh in MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList)
|
||||||
|
{
|
||||||
|
if (fccoh.Index == cohorig.Index.ToString())
|
||||||
|
{
|
||||||
|
coh.Active = fccoh.Active;
|
||||||
|
coh.OrigActive = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cohdrsMerged.Add(coh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.CheckOffHeaderList = cohdrsMerged;
|
||||||
|
|
||||||
|
// CheckOffs: If there is no UCF data, use from the selected format, otherwise merge:
|
||||||
|
FormatConfig.CheckOffList cosMerged = new FormatConfig.CheckOffList();
|
||||||
|
// clear the lists so that correct lists will be initialized
|
||||||
|
foreach (CheckOff coorig in OriginalPlantFormat.FormatData.ProcData.CheckOffData.CheckOffList)
|
||||||
|
{
|
||||||
|
FormatConfig.CheckOff co = new FormatConfig.CheckOff();
|
||||||
|
co.Index = coorig.Index.ToString();
|
||||||
|
co.MenuItem = coorig.MenuItem;
|
||||||
|
co.Active = true;
|
||||||
|
co.OrigActive = true;
|
||||||
|
// See if in the FormatConfig, to check its inactive flag:
|
||||||
|
if (MyFormatConfig.PlantFormat.FormatData.CheckOffList != null)
|
||||||
|
{
|
||||||
|
foreach (FormatConfig.CheckOff fcco in MyFormatConfig.PlantFormat.FormatData.CheckOffList)
|
||||||
|
{
|
||||||
|
if (fcco.Index == coorig.Index.ToString())
|
||||||
|
{
|
||||||
|
co.Active = fcco.Active;
|
||||||
|
co.OrigActive = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cosMerged.Add(co);
|
||||||
|
}
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.CheckOffList = cosMerged;
|
||||||
|
}
|
||||||
|
// The Reset button is used to reset a UCF change from the original data. If a field is added to UCF, code needs
|
||||||
|
// added here for the field:
|
||||||
|
private void btnReset_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// The code that enables the Reset button checks if a change (UCF) exists. So no need to check here.
|
||||||
|
if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Compress Steps"))
|
||||||
|
{
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.Flags.CompressSteps = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CompressSteps;
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:Partial Step Compression"))
|
||||||
|
{
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.Flags.PartialStepCompression = OriginalPlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PartialStepCompression;
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Flags:UCF CheckOffs"))
|
||||||
|
{
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.Flags.CheckOffUCF = OriginalPlantFormat.FormatData.ProcData.CheckOffUCF;
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:CheckOff XOffset"))
|
||||||
|
{
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.CheckOffXOffAdj = 0;
|
||||||
|
}
|
||||||
|
else if (SelectedGridField.EndsWith("Data:Plant Format:Step Settings:Replace Words List"))
|
||||||
|
{
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Clear();
|
||||||
|
foreach (ReplaceStr repstrorig in OriginalPlantFormat.FormatData.SectData.ReplaceStrList)
|
||||||
|
{
|
||||||
|
if (!((repstrorig.ReplaceWith.Contains("$1") && repstrorig.ReplaceWord.Contains("w*")) || repstrorig.ReplaceWith.Contains("{Backspace}")))
|
||||||
|
{
|
||||||
|
FormatConfig.ReplaceStr rsfc = new FormatConfig.ReplaceStr();
|
||||||
|
rsfc.Flag = (FormatConfig.E_ReplaceFlagsUCF)repstrorig.Flag;
|
||||||
|
rsfc.State = 0;
|
||||||
|
rsfc.ReplaceWith = repstrorig.ReplaceWith;
|
||||||
|
rsfc.ReplaceWord = repstrorig.ReplaceWord;
|
||||||
|
MyFormatConfig.PlantFormat.FormatData.ReplaceStrData.Add(rsfc);
|
||||||
|
UcfForRepWords = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
btnReset.Enabled = false;
|
||||||
|
btnReset.Text = "Reset";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSaveAs_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Name must be unique - description can be null.
|
||||||
|
// Append a '_UCF' at end of all user control of format formats.
|
||||||
|
// add a format record for this:
|
||||||
|
// FormatID - next ID, db creates on new format
|
||||||
|
// ParentID - format id of the format that was used as a base for this user control of format
|
||||||
|
// Name - user defined
|
||||||
|
// Description - user defined - if none specified by user, use the original's description
|
||||||
|
// Data - null: flags that a UCF was saved as and use the parent and config from this.
|
||||||
|
//
|
||||||
|
|
||||||
|
// check for unique name.
|
||||||
|
foreach (FormatInfo fi in FormatInfoList.SortedFormatInfoList)
|
||||||
|
{
|
||||||
|
if (MyFormatConfig.Name == fi.Name || MyFormatConfig.Name + "_UCF" == fi.Name)
|
||||||
|
{
|
||||||
|
MessageBox.Show("A format with Name " + MyFormatConfig.Name + " already exists. Name must be unique. Save As cannot be done.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
using (Format tmp = Format.Get(OriginalFormatInfo.FormatID))
|
||||||
|
{
|
||||||
|
string fname = MyFormatConfig.Name + (MyFormatConfig.Name.EndsWith("_UCF") ? "" : "_UCF");
|
||||||
|
Format fmt = Format.MakeFormat(tmp, fname, MyFormatConfig.Description == OriginalFormatInfo.Description || MyFormatConfig.Description == "" || MyFormatConfig.Description == null ? OriginalFormatInfo.Description : MyFormatConfig.Description, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
||||||
|
FormatConfig tmpForSave = GetChangesUCFForSave();
|
||||||
|
string scf = tmpForSave.ConvertToString();
|
||||||
|
scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", "");
|
||||||
|
// for now, tell the user that changes don't take affect until reentry. This was done since the 'refresh' of FormatConfig was not
|
||||||
|
// working.
|
||||||
|
fmt.Config = scf;
|
||||||
|
fmt.Description = MyFormatConfig.Description;
|
||||||
|
fmt.Save(true);
|
||||||
|
MessageBox.Show(this, "Restart PROMS to have format changes take effect.", "", MessageBoxButtons.OK);
|
||||||
|
btnSaveAs.Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnDelete_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// delete this format OR (the button text is set to 'delete...' if no item or version uses it)
|
||||||
|
// revert to the original
|
||||||
|
string msg = btnDelete.Text == "Revert to Original" ? "revert to the original?" : "delete this format?";
|
||||||
|
if (MessageBox.Show(this, "Are you sure you want to " + msg, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
PlantFormat.IgnoreUCF = true;
|
||||||
|
// the button is either 'Revert to Original' for a format that is the original and has config data, or 'Delete' for a UCF that
|
||||||
|
// was created by a 'Save As'.
|
||||||
|
// so do either a clear of the config data, or delete the format record depending on button's text
|
||||||
|
if (btnDelete.Text == "Revert to Original")
|
||||||
|
{
|
||||||
|
using (Format fmt = Format.Get(OriginalFormatInfo.FormatID))
|
||||||
|
{
|
||||||
|
fmt.Config = "";
|
||||||
|
fmt.Save(true);
|
||||||
|
MessageBox.Show(this, "The changes that have been made to the format will take affect after reentry to PROMS", "", MessageBoxButtons.OK);
|
||||||
|
MyFormatConfig = new FormatConfig();
|
||||||
|
PG.SelectedObject = MyFormatConfig;
|
||||||
|
PG.Enabled = false;
|
||||||
|
btnSaveAs.Enabled = false;
|
||||||
|
btnDelete.Enabled = false;
|
||||||
|
btnSaveClose.Enabled = false;
|
||||||
|
btnSave.Enabled = false;
|
||||||
|
btnReset.Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Format.Delete(OriginalFormatInfo.FormatID);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Could not delete the format");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cbxFormatList.DataSource = FormatInfoList.GetFormatInfoListUsed();
|
||||||
|
cbxFormatList.SelectedIndex = -1;
|
||||||
|
MyFormatConfig = new FormatConfig();
|
||||||
|
PG.SelectedObject = MyFormatConfig;
|
||||||
|
PG.Enabled = false;
|
||||||
|
btnSaveAs.Enabled = false;
|
||||||
|
btnDelete.Enabled = false;
|
||||||
|
btnSaveClose.Enabled = false;
|
||||||
|
btnSave.Enabled = false;
|
||||||
|
btnReset.Enabled = false;
|
||||||
|
}
|
||||||
|
PlantFormat.IgnoreUCF = false;
|
||||||
|
PlantFormat.DoingUCFCheckOffs = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnDetails_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
FormatConfig tmpfc = GetChangesUCFForSave();
|
||||||
|
string scf = tmpfc.ConvertToString();
|
||||||
|
scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", "");
|
||||||
|
dlgUCFDetail dtl = new dlgUCFDetail(scf, MyFormatConfig.Name, MyFormatConfig.Description);
|
||||||
|
dtl.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// get a FormatConfig structure that only has differences from the original format. This is what gets saved.
|
||||||
|
FormatConfig tmpForSave = GetChangesUCFForSave();
|
||||||
|
string scf = tmpForSave.ConvertToString();
|
||||||
|
scf = Regex.Replace(scf, " *<[a-zA-Z ]+/>\r\n", "");
|
||||||
|
int fmtid = OriginalPlantFormat.MyFormat is Format ? (OriginalPlantFormat.MyFormat as Format).FormatID : (OriginalPlantFormat.MyFormat as FormatInfo).FormatID;
|
||||||
|
// for now, tell the user that changes don't take affect until reentry. This was done since the 'refresh' of FormatConfig was not
|
||||||
|
// working.
|
||||||
|
using (Format fmt = Format.Get(fmtid))
|
||||||
|
{
|
||||||
|
FormatInfo fi = FormatInfo.GetFormatNoUCFByFormatID(OriginalFormatInfo.FormatID);
|
||||||
|
if (fi.Data == "")
|
||||||
|
{
|
||||||
|
fmt.Data = "";
|
||||||
|
fmt.GenMac = "";
|
||||||
|
}
|
||||||
|
fmt.Config = scf;
|
||||||
|
fmt.Name = MyFormatConfig.Name;
|
||||||
|
fmt.Description = MyFormatConfig.Description;
|
||||||
|
fmt.Save(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
287
PROMS/VEPROMS User Interface/frmUCF.designer.cs
generated
Normal file
287
PROMS/VEPROMS User Interface/frmUCF.designer.cs
generated
Normal file
@ -0,0 +1,287 @@
|
|||||||
|
namespace VEPROMS
|
||||||
|
{
|
||||||
|
partial class frmUCF
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
//protected override void Dispose(bool disposing)
|
||||||
|
//{
|
||||||
|
// if (disposing && (components != null))
|
||||||
|
// {
|
||||||
|
// components.Dispose();
|
||||||
|
// }
|
||||||
|
// base.Dispose(disposing);
|
||||||
|
//}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.PGpanelBtm = new System.Windows.Forms.Panel();
|
||||||
|
this.btnSave = new System.Windows.Forms.Button();
|
||||||
|
this.btnDelete = new System.Windows.Forms.Button();
|
||||||
|
this.btnReset = new System.Windows.Forms.Button();
|
||||||
|
this.btnSaveAs = new System.Windows.Forms.Button();
|
||||||
|
this.lblPGItem = new System.Windows.Forms.Label();
|
||||||
|
this.btnSaveClose = new System.Windows.Forms.Button();
|
||||||
|
this.btnCancel = new System.Windows.Forms.Button();
|
||||||
|
this.PG = new System.Windows.Forms.PropertyGrid();
|
||||||
|
this.pnlFormatList = new System.Windows.Forms.Panel();
|
||||||
|
this.tbUCFSummary = new System.Windows.Forms.TextBox();
|
||||||
|
this.btnDetails = new System.Windows.Forms.Button();
|
||||||
|
this.lblSummary = new System.Windows.Forms.Label();
|
||||||
|
this.lblDerivedFrom = new System.Windows.Forms.Label();
|
||||||
|
this.lblDerFrom = new System.Windows.Forms.Label();
|
||||||
|
this.cbxFormatList = new System.Windows.Forms.ComboBox();
|
||||||
|
this.lblFormatList = new System.Windows.Forms.Label();
|
||||||
|
this.PGpanelBtm.SuspendLayout();
|
||||||
|
this.pnlFormatList.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// PGpanelBtm
|
||||||
|
//
|
||||||
|
this.PGpanelBtm.Controls.Add(this.btnSave);
|
||||||
|
this.PGpanelBtm.Controls.Add(this.btnDelete);
|
||||||
|
this.PGpanelBtm.Controls.Add(this.btnReset);
|
||||||
|
this.PGpanelBtm.Controls.Add(this.btnSaveAs);
|
||||||
|
this.PGpanelBtm.Controls.Add(this.lblPGItem);
|
||||||
|
this.PGpanelBtm.Controls.Add(this.btnSaveClose);
|
||||||
|
this.PGpanelBtm.Controls.Add(this.btnCancel);
|
||||||
|
this.PGpanelBtm.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.PGpanelBtm.Location = new System.Drawing.Point(0, 560);
|
||||||
|
this.PGpanelBtm.Name = "PGpanelBtm";
|
||||||
|
this.PGpanelBtm.Size = new System.Drawing.Size(614, 68);
|
||||||
|
this.PGpanelBtm.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
this.btnSave.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.btnSave.Enabled = false;
|
||||||
|
this.btnSave.Location = new System.Drawing.Point(164, 0);
|
||||||
|
this.btnSave.Name = "btnSave";
|
||||||
|
this.btnSave.Size = new System.Drawing.Size(75, 68);
|
||||||
|
this.btnSave.TabIndex = 6;
|
||||||
|
this.btnSave.Text = "Save";
|
||||||
|
this.btnSave.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSave.Visible = false;
|
||||||
|
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||||
|
//
|
||||||
|
// btnDelete
|
||||||
|
//
|
||||||
|
this.btnDelete.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.btnDelete.Enabled = false;
|
||||||
|
this.btnDelete.Location = new System.Drawing.Point(239, 0);
|
||||||
|
this.btnDelete.Name = "btnDelete";
|
||||||
|
this.btnDelete.Size = new System.Drawing.Size(75, 68);
|
||||||
|
this.btnDelete.TabIndex = 5;
|
||||||
|
this.btnDelete.Text = "Delete";
|
||||||
|
this.btnDelete.UseVisualStyleBackColor = true;
|
||||||
|
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
|
||||||
|
//
|
||||||
|
// btnReset
|
||||||
|
//
|
||||||
|
this.btnReset.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.btnReset.Enabled = false;
|
||||||
|
this.btnReset.Location = new System.Drawing.Point(314, 0);
|
||||||
|
this.btnReset.Name = "btnReset";
|
||||||
|
this.btnReset.Size = new System.Drawing.Size(75, 68);
|
||||||
|
this.btnReset.TabIndex = 4;
|
||||||
|
this.btnReset.Text = "Reset";
|
||||||
|
this.btnReset.UseVisualStyleBackColor = true;
|
||||||
|
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
|
||||||
|
//
|
||||||
|
// btnSaveAs
|
||||||
|
//
|
||||||
|
this.btnSaveAs.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.btnSaveAs.Enabled = false;
|
||||||
|
this.btnSaveAs.Location = new System.Drawing.Point(389, 0);
|
||||||
|
this.btnSaveAs.Name = "btnSaveAs";
|
||||||
|
this.btnSaveAs.Size = new System.Drawing.Size(75, 68);
|
||||||
|
this.btnSaveAs.TabIndex = 3;
|
||||||
|
this.btnSaveAs.Text = "Save As";
|
||||||
|
this.btnSaveAs.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click);
|
||||||
|
//
|
||||||
|
// lblPGItem
|
||||||
|
//
|
||||||
|
this.lblPGItem.AutoSize = true;
|
||||||
|
this.lblPGItem.Location = new System.Drawing.Point(39, 20);
|
||||||
|
this.lblPGItem.Name = "lblPGItem";
|
||||||
|
this.lblPGItem.Size = new System.Drawing.Size(46, 17);
|
||||||
|
this.lblPGItem.TabIndex = 2;
|
||||||
|
this.lblPGItem.Text = "label1";
|
||||||
|
this.lblPGItem.Visible = false;
|
||||||
|
//
|
||||||
|
// btnSaveClose
|
||||||
|
//
|
||||||
|
this.btnSaveClose.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||||
|
this.btnSaveClose.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.btnSaveClose.Enabled = false;
|
||||||
|
this.btnSaveClose.Location = new System.Drawing.Point(464, 0);
|
||||||
|
this.btnSaveClose.Name = "btnSaveClose";
|
||||||
|
this.btnSaveClose.Size = new System.Drawing.Size(75, 68);
|
||||||
|
this.btnSaveClose.TabIndex = 1;
|
||||||
|
this.btnSaveClose.Text = "Save and Close";
|
||||||
|
this.btnSaveClose.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSaveClose.Click += new System.EventHandler(this.btnSaveClose_Click);
|
||||||
|
//
|
||||||
|
// btnCancel
|
||||||
|
//
|
||||||
|
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.btnCancel.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.btnCancel.Location = new System.Drawing.Point(539, 0);
|
||||||
|
this.btnCancel.Name = "btnCancel";
|
||||||
|
this.btnCancel.Size = new System.Drawing.Size(75, 68);
|
||||||
|
this.btnCancel.TabIndex = 0;
|
||||||
|
this.btnCancel.Text = "Cancel";
|
||||||
|
this.btnCancel.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||||
|
//
|
||||||
|
// PG
|
||||||
|
//
|
||||||
|
this.PG.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.PG.Font = new System.Drawing.Font("Arial Rounded MT Bold", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.PG.LineColor = System.Drawing.SystemColors.ControlDark;
|
||||||
|
this.PG.Location = new System.Drawing.Point(0, 155);
|
||||||
|
this.PG.Name = "PG";
|
||||||
|
this.PG.Size = new System.Drawing.Size(614, 405);
|
||||||
|
this.PG.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// pnlFormatList
|
||||||
|
//
|
||||||
|
this.pnlFormatList.Controls.Add(this.tbUCFSummary);
|
||||||
|
this.pnlFormatList.Controls.Add(this.btnDetails);
|
||||||
|
this.pnlFormatList.Controls.Add(this.lblSummary);
|
||||||
|
this.pnlFormatList.Controls.Add(this.lblDerivedFrom);
|
||||||
|
this.pnlFormatList.Controls.Add(this.lblDerFrom);
|
||||||
|
this.pnlFormatList.Controls.Add(this.cbxFormatList);
|
||||||
|
this.pnlFormatList.Controls.Add(this.lblFormatList);
|
||||||
|
this.pnlFormatList.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.pnlFormatList.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.pnlFormatList.Name = "pnlFormatList";
|
||||||
|
this.pnlFormatList.Size = new System.Drawing.Size(614, 149);
|
||||||
|
this.pnlFormatList.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// tbUCFSummary
|
||||||
|
//
|
||||||
|
this.tbUCFSummary.BackColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.tbUCFSummary.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.tbUCFSummary.Location = new System.Drawing.Point(33, 120);
|
||||||
|
this.tbUCFSummary.Name = "tbUCFSummary";
|
||||||
|
this.tbUCFSummary.Size = new System.Drawing.Size(485, 15);
|
||||||
|
this.tbUCFSummary.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// btnDetails
|
||||||
|
//
|
||||||
|
this.btnDetails.Location = new System.Drawing.Point(539, 112);
|
||||||
|
this.btnDetails.Name = "btnDetails";
|
||||||
|
this.btnDetails.Size = new System.Drawing.Size(63, 33);
|
||||||
|
this.btnDetails.TabIndex = 6;
|
||||||
|
this.btnDetails.Text = "Details";
|
||||||
|
this.btnDetails.UseVisualStyleBackColor = true;
|
||||||
|
this.btnDetails.Visible = false;
|
||||||
|
this.btnDetails.Click += new System.EventHandler(this.btnDetails_Click);
|
||||||
|
//
|
||||||
|
// lblSummary
|
||||||
|
//
|
||||||
|
this.lblSummary.AutoSize = true;
|
||||||
|
this.lblSummary.Location = new System.Drawing.Point(5, 96);
|
||||||
|
this.lblSummary.Name = "lblSummary";
|
||||||
|
this.lblSummary.Size = new System.Drawing.Size(71, 17);
|
||||||
|
this.lblSummary.TabIndex = 4;
|
||||||
|
this.lblSummary.Text = "Summary:";
|
||||||
|
this.lblSummary.Visible = false;
|
||||||
|
//
|
||||||
|
// lblDerivedFrom
|
||||||
|
//
|
||||||
|
this.lblDerivedFrom.AutoSize = true;
|
||||||
|
this.lblDerivedFrom.Location = new System.Drawing.Point(33, 75);
|
||||||
|
this.lblDerivedFrom.Name = "lblDerivedFrom";
|
||||||
|
this.lblDerivedFrom.Size = new System.Drawing.Size(0, 17);
|
||||||
|
this.lblDerivedFrom.TabIndex = 3;
|
||||||
|
this.lblDerivedFrom.Visible = false;
|
||||||
|
//
|
||||||
|
// lblDerFrom
|
||||||
|
//
|
||||||
|
this.lblDerFrom.AutoSize = true;
|
||||||
|
this.lblDerFrom.Location = new System.Drawing.Point(3, 52);
|
||||||
|
this.lblDerFrom.Name = "lblDerFrom";
|
||||||
|
this.lblDerFrom.Size = new System.Drawing.Size(97, 17);
|
||||||
|
this.lblDerFrom.TabIndex = 2;
|
||||||
|
this.lblDerFrom.Text = "Derived From:";
|
||||||
|
this.lblDerFrom.Visible = false;
|
||||||
|
//
|
||||||
|
// cbxFormatList
|
||||||
|
//
|
||||||
|
this.cbxFormatList.FormattingEnabled = true;
|
||||||
|
this.cbxFormatList.Location = new System.Drawing.Point(23, 25);
|
||||||
|
this.cbxFormatList.Name = "cbxFormatList";
|
||||||
|
this.cbxFormatList.Size = new System.Drawing.Size(550, 24);
|
||||||
|
this.cbxFormatList.Sorted = true;
|
||||||
|
this.cbxFormatList.TabIndex = 1;
|
||||||
|
this.cbxFormatList.SelectedIndexChanged += new System.EventHandler(this.cbxFormatList_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// lblFormatList
|
||||||
|
//
|
||||||
|
this.lblFormatList.AutoSize = true;
|
||||||
|
this.lblFormatList.Location = new System.Drawing.Point(5, 4);
|
||||||
|
this.lblFormatList.Name = "lblFormatList";
|
||||||
|
this.lblFormatList.Size = new System.Drawing.Size(115, 17);
|
||||||
|
this.lblFormatList.TabIndex = 0;
|
||||||
|
this.lblFormatList.Text = "Selected Format:";
|
||||||
|
//
|
||||||
|
// frmUCF
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(614, 628);
|
||||||
|
this.Controls.Add(this.pnlFormatList);
|
||||||
|
this.Controls.Add(this.PG);
|
||||||
|
this.Controls.Add(this.PGpanelBtm);
|
||||||
|
this.Name = "frmUCF";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
|
this.Text = "User Control of Format";
|
||||||
|
this.Load += new System.EventHandler(this.frmUCF_Load);
|
||||||
|
this.PGpanelBtm.ResumeLayout(false);
|
||||||
|
this.PGpanelBtm.PerformLayout();
|
||||||
|
this.pnlFormatList.ResumeLayout(false);
|
||||||
|
this.pnlFormatList.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Panel PGpanelBtm;
|
||||||
|
private System.Windows.Forms.Button btnSaveClose;
|
||||||
|
private System.Windows.Forms.Button btnCancel;
|
||||||
|
private System.Windows.Forms.PropertyGrid PG;
|
||||||
|
private System.Windows.Forms.Panel pnlFormatList;
|
||||||
|
private System.Windows.Forms.Label lblFormatList;
|
||||||
|
private System.Windows.Forms.ComboBox cbxFormatList;
|
||||||
|
private System.Windows.Forms.Label lblPGItem;
|
||||||
|
private System.Windows.Forms.Button btnSaveAs;
|
||||||
|
private System.Windows.Forms.Button btnReset;
|
||||||
|
private System.Windows.Forms.Button btnDelete;
|
||||||
|
private System.Windows.Forms.Label lblDerivedFrom;
|
||||||
|
private System.Windows.Forms.Label lblDerFrom;
|
||||||
|
private System.Windows.Forms.Button btnDetails;
|
||||||
|
private System.Windows.Forms.Label lblSummary;
|
||||||
|
private System.Windows.Forms.TextBox tbUCFSummary;
|
||||||
|
private System.Windows.Forms.Button btnSave;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
120
PROMS/VEPROMS User Interface/frmUCF.resx
Normal file
120
PROMS/VEPROMS User Interface/frmUCF.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -197,6 +197,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
tc.RefreshItem(myItemInfo);
|
tc.RefreshItem(myItemInfo);
|
||||||
}
|
}
|
||||||
|
private E_UCFImportOptions _UCFImportOptionsFromSettings;
|
||||||
public frmVEPROMS()
|
public frmVEPROMS()
|
||||||
{
|
{
|
||||||
// The following Try/Catch was added to protect against a problem seen by Kathy and Michelle
|
// The following Try/Catch was added to protect against a problem seen by Kathy and Michelle
|
||||||
@ -550,7 +551,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, CheckOutType.Session);
|
int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, CheckOutType.Session);
|
||||||
//int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, (args.Index == 0) ? CheckOutType.Folder : CheckOutType.Session);
|
//int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, (args.Index == 0) ? CheckOutType.Folder : CheckOutType.Session);
|
||||||
dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this);//Added frmVEPROMS Parameter
|
dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this, (E_UCFImportOptions)Properties.Settings.Default.UCFImportOpt);//Added frmVEPROMS Parameter
|
||||||
dlg.ShowDialog(this);
|
dlg.ShowDialog(this);
|
||||||
MySessionInfo.CheckInItem(ownerid);
|
MySessionInfo.CheckInItem(ownerid);
|
||||||
if (args.Index == 1 && dlg.MyNewFolder != null)
|
if (args.Index == 1 && dlg.MyNewFolder != null)
|
||||||
@ -575,7 +576,7 @@ namespace VEPROMS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int ownerid = MySessionInfo.CheckOutItem(dvi.VersionID, CheckOutType.DocVersion);
|
int ownerid = MySessionInfo.CheckOutItem(dvi.VersionID, CheckOutType.DocVersion);
|
||||||
dlgExportImport dlg = new dlgExportImport("Import", dvi, this);//Added frmVEPROMS Parameter
|
dlgExportImport dlg = new dlgExportImport("Import", dvi, this, (E_UCFImportOptions)Properties.Settings.Default.UCFImportOpt);//Added frmVEPROMS Parameter
|
||||||
dlg.MyNewProcedure = null;
|
dlg.MyNewProcedure = null;
|
||||||
dlg.ExternalTransitionItem = null;
|
dlg.ExternalTransitionItem = null;
|
||||||
dlg.ShowDialog(this);
|
dlg.ShowDialog(this);
|
||||||
@ -597,7 +598,7 @@ namespace VEPROMS
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int ownerid = MySessionInfo.CheckOutItem(pi.ItemID, CheckOutType.Procedure);
|
int ownerid = MySessionInfo.CheckOutItem(pi.ItemID, CheckOutType.Procedure);
|
||||||
dlgExportImport dlg = new dlgExportImport("Export", pi, this);//Added frmVEPROMS Parameter
|
dlgExportImport dlg = new dlgExportImport("Export", pi, this, (E_UCFImportOptions)0);//Added frmVEPROMS Parameter
|
||||||
dlg.ShowDialog(this);
|
dlg.ShowDialog(this);
|
||||||
MySessionInfo.CheckInItem(ownerid);
|
MySessionInfo.CheckInItem(ownerid);
|
||||||
}
|
}
|
||||||
@ -1351,6 +1352,9 @@ namespace VEPROMS
|
|||||||
private DevComponents.DotNetBar.ButtonItem btnManageSecurity;
|
private DevComponents.DotNetBar.ButtonItem btnManageSecurity;
|
||||||
private DevComponents.DotNetBar.ButtonItem btnResetSecurity;
|
private DevComponents.DotNetBar.ButtonItem btnResetSecurity;
|
||||||
private DevComponents.DotNetBar.ButtonItem btnAdministrativeTools;
|
private DevComponents.DotNetBar.ButtonItem btnAdministrativeTools;
|
||||||
|
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormats;
|
||||||
|
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsExport;
|
||||||
|
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsImport;
|
||||||
private TabItemsToClose _MyCloseTabList = new TabItemsToClose();
|
private TabItemsToClose _MyCloseTabList = new TabItemsToClose();
|
||||||
public TabItemsToClose MyCloseTabList
|
public TabItemsToClose MyCloseTabList
|
||||||
{
|
{
|
||||||
@ -1497,6 +1501,16 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
InitializeSecurity();
|
InitializeSecurity();
|
||||||
UpdateUser();
|
UpdateUser();
|
||||||
|
|
||||||
|
btnUserControlOfFormats = new ButtonItem("btnUserControlOfFormats", "User Control of Formats");
|
||||||
|
btnAdmin.SubItems.Add(btnUserControlOfFormats);
|
||||||
|
btnUserControlOfFormats.Click += new EventHandler(btnUserControlOfFormats_Click);
|
||||||
|
btnUserControlOfFormatsExport = new ButtonItem("btnUserControlOfFormatsExport", "Export User Control of Formats");
|
||||||
|
btnAdmin.SubItems.Add(btnUserControlOfFormatsExport);
|
||||||
|
btnUserControlOfFormatsExport.Click += new EventHandler(btnUserControlOfFormatsExport_Click);
|
||||||
|
btnUserControlOfFormatsImport = new ButtonItem("btnUserControlOfFormatsImport", "Import User Control of Formats");
|
||||||
|
btnAdmin.SubItems.Add(btnUserControlOfFormatsImport);
|
||||||
|
btnUserControlOfFormatsImport.Click += new EventHandler(btnUserControlOfFormatsImport_Click);
|
||||||
btnManageSecurity = new ButtonItem("btnManageSecurity", "Manage Security");
|
btnManageSecurity = new ButtonItem("btnManageSecurity", "Manage Security");
|
||||||
btnAdmin.SubItems.Add(btnManageSecurity);
|
btnAdmin.SubItems.Add(btnManageSecurity);
|
||||||
btnManageSecurity.Click += new EventHandler(btnManageSecurity_Click);
|
btnManageSecurity.Click += new EventHandler(btnManageSecurity_Click);
|
||||||
@ -1513,8 +1527,9 @@ namespace VEPROMS
|
|||||||
btnAdmin.SubItems.Add(btnAdministrativeTools);
|
btnAdmin.SubItems.Add(btnAdministrativeTools);
|
||||||
this.superTooltip1.SetSuperTooltip(btnPrint, new SuperTooltipInfo("Create PDF", null, null, null, null, eTooltipColor.Gray));
|
this.superTooltip1.SetSuperTooltip(btnPrint, new SuperTooltipInfo("Create PDF", null, null, null, null, eTooltipColor.Gray));
|
||||||
this.superTooltip1.SetSuperTooltip(btnExit, new SuperTooltipInfo("Exit", null, null, null, null, eTooltipColor.Gray));
|
this.superTooltip1.SetSuperTooltip(btnExit, new SuperTooltipInfo("Exit", null, null, null, null, eTooltipColor.Gray));
|
||||||
this.superTooltip1.SetSuperTooltip(btnOptions, new SuperTooltipInfo("Options", null, null, null, null, eTooltipColor.Gray));
|
this.superTooltip1.SetSuperTooltip(btnOptions, new SuperTooltipInfo("Options", null, null, null, null, eTooltipColor.Gray));
|
||||||
this.superTooltip1.SetSuperTooltip(btnManageSecurity, new SuperTooltipInfo("Manage Security", null, null, null, null, eTooltipColor.Gray));
|
this.superTooltip1.SetSuperTooltip(btnManageSecurity, new SuperTooltipInfo("Manage Security", null, null, null, null, eTooltipColor.Gray));
|
||||||
|
this.superTooltip1.SetSuperTooltip(btnUserControlOfFormats, new SuperTooltipInfo("User Control Of Formats", null, null, null, null, eTooltipColor.Gray));
|
||||||
this.superTooltip1.SetSuperTooltip(btnResetSecurity, new SuperTooltipInfo("Reset Security",null, null, null, null, eTooltipColor.Gray));
|
this.superTooltip1.SetSuperTooltip(btnResetSecurity, new SuperTooltipInfo("Reset Security",null, null, null, null, eTooltipColor.Gray));
|
||||||
this.superTooltip1.SetSuperTooltip(btnAdministrativeTools, new SuperTooltipInfo("Administrative Tools",null, null, null, null, eTooltipColor.Gray));
|
this.superTooltip1.SetSuperTooltip(btnAdministrativeTools, new SuperTooltipInfo("Administrative Tools",null, null, null, null, eTooltipColor.Gray));
|
||||||
this.superTooltip1.SetSuperTooltip(btnUpdateFormats, new SuperTooltipInfo("Update Formats",null, null, null, null, eTooltipColor.Gray));
|
this.superTooltip1.SetSuperTooltip(btnUpdateFormats, new SuperTooltipInfo("Update Formats",null, null, null, null, eTooltipColor.Gray));
|
||||||
@ -1545,6 +1560,9 @@ namespace VEPROMS
|
|||||||
StepRTB.MyUserInfo = MyUserInfo; // set the user's security information in the StepRTB
|
StepRTB.MyUserInfo = MyUserInfo; // set the user's security information in the StepRTB
|
||||||
VlnFlexGrid.MyUserInfo = MyUserInfo; // set the user's security information in the VlnFlexGrid
|
VlnFlexGrid.MyUserInfo = MyUserInfo; // set the user's security information in the VlnFlexGrid
|
||||||
bool isVisible = MyUserInfo.IsAdministrator();
|
bool isVisible = MyUserInfo.IsAdministrator();
|
||||||
|
btnUserControlOfFormats.Visible = isVisible;
|
||||||
|
btnUserControlOfFormatsExport.Visible = isVisible;
|
||||||
|
btnUserControlOfFormatsImport.Visible = isVisible;
|
||||||
btnManageSecurity.Visible = isVisible;
|
btnManageSecurity.Visible = isVisible;
|
||||||
btnUpdateFormats.Visible = isVisible;
|
btnUpdateFormats.Visible = isVisible;
|
||||||
btnResetSecurity.Visible = isVisible;
|
btnResetSecurity.Visible = isVisible;
|
||||||
@ -2191,6 +2209,27 @@ namespace VEPROMS
|
|||||||
proxyUser = ui.UserID;
|
proxyUser = ui.UserID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void btnUserControlOfFormats_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
frmUCF frmucf = new frmUCF();
|
||||||
|
DialogResult dr = frmucf.ShowDialog(this);
|
||||||
|
}
|
||||||
|
void btnUserControlOfFormatsExport_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DocVersionInfo dvi = null;
|
||||||
|
dlgExportImport dlg = new dlgExportImport("Export Formats", dvi, this, (E_UCFImportOptions)0);
|
||||||
|
dlg.MyNewProcedure = null;
|
||||||
|
dlg.ExternalTransitionItem = null;
|
||||||
|
dlg.ShowDialog(this);
|
||||||
|
}
|
||||||
|
void btnUserControlOfFormatsImport_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DocVersionInfo dvi = null;
|
||||||
|
dlgExportImport dlg = new dlgExportImport("Import Formats", dvi, this, (E_UCFImportOptions)0);
|
||||||
|
dlg.MyNewProcedure = null;
|
||||||
|
dlg.ExternalTransitionItem = null;
|
||||||
|
dlg.ShowDialog(this);
|
||||||
|
}
|
||||||
void btnManageSecurity_Click(object sender, EventArgs e)
|
void btnManageSecurity_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
dlgManageSecurity dlg = new dlgManageSecurity();
|
dlgManageSecurity dlg = new dlgManageSecurity();
|
||||||
@ -4022,7 +4061,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private void btnUpdateFormat_Click(object sender, EventArgs e)
|
private void btnUpdateFormat_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
UpdateFormats(null);
|
UpdateFormats(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateFormats(string mypath)
|
private void UpdateFormats(string mypath)
|
||||||
|
@ -113,6 +113,26 @@ namespace VEPROMS
|
|||||||
private void btnVersionsPropOK_Click(object sender, EventArgs e)
|
private void btnVersionsPropOK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
docVersionConfigBindingSource.EndEdit(); // need to end the edit session first or any format selection chanage will not stick B2015-157
|
docVersionConfigBindingSource.EndEdit(); // need to end the edit session first or any format selection chanage will not stick B2015-157
|
||||||
|
|
||||||
|
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
|
||||||
|
if (_DocVersionConfig.MyDocVersion.FormatID != _cmbxformatOriginal)
|
||||||
|
{
|
||||||
|
// clean up & then refresh the configs
|
||||||
|
string strdv = _DocVersionConfig.MyDocVersion.VersionID.ToString();
|
||||||
|
using (ContentInfoList cil = ContentInfoList.ClearOverrideFormatsByDocVersion(strdv, _cmbxformatOriginal, _DocVersionConfig.MyDocVersion.FormatID))
|
||||||
|
{
|
||||||
|
foreach (ContentInfo ci in cil)
|
||||||
|
{
|
||||||
|
using (Content c = ci.Get())
|
||||||
|
{
|
||||||
|
// first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen
|
||||||
|
// and if configs aren't done first, the screen refresh, if based on config data, will not be correct.
|
||||||
|
foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig();
|
||||||
|
ContentInfo.Refresh(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (_DocVersionConfig.Unit_Count > 0 || (_Apples != null && _Apples.Count > 0))
|
if (_DocVersionConfig.Unit_Count > 0 || (_Apples != null && _Apples.Count > 0))
|
||||||
{
|
{
|
||||||
if (_DeletedApples != null && _DeletedApples.Count > 0)
|
if (_DeletedApples != null && _DeletedApples.Count > 0)
|
||||||
@ -315,7 +335,7 @@ namespace VEPROMS
|
|||||||
_DocVersionConfig.ParentLookup = false;
|
_DocVersionConfig.ParentLookup = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int? _cmbxformatOriginal = null;
|
||||||
private void frmVersionsProperties_Load(object sender, EventArgs e)
|
private void frmVersionsProperties_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_Initializing = true;
|
_Initializing = true;
|
||||||
@ -328,6 +348,7 @@ namespace VEPROMS
|
|||||||
ppCmbxFormat.DisplayMember = "FullName";
|
ppCmbxFormat.DisplayMember = "FullName";
|
||||||
ppCmbxFormat.ValueMember = "FullName";
|
ppCmbxFormat.ValueMember = "FullName";
|
||||||
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList;
|
||||||
|
_cmbxformatOriginal = _DocVersionConfig.MyDocVersion.FormatID;
|
||||||
if (_DocVersionConfig.FormatSelection != null)
|
if (_DocVersionConfig.FormatSelection != null)
|
||||||
{
|
{
|
||||||
ppCmbxFormat.SelectedValue = _DocVersionConfig.FormatSelection;
|
ppCmbxFormat.SelectedValue = _DocVersionConfig.FormatSelection;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user