B2022-083: Support Conditional RO Values
This commit is contained in:
@@ -68,6 +68,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class DVEnhancedDocument
|
||||
{
|
||||
private string _Name;
|
||||
@@ -114,6 +115,7 @@ namespace VEPROMS.CSLA.Library
|
||||
return string.Format("{0}.ItemID={1}", Name,VersionID);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public class DocVersionConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||
@@ -123,6 +125,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
_MyEnhancedDocuments = null;
|
||||
}
|
||||
|
||||
public void RemoveEnhancedLink(int dvid)
|
||||
{
|
||||
// from this config, remove the link to the input dvid (DocVersionId:
|
||||
@@ -130,6 +133,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (xnx == null) return; // B2020-069: check for null reference before accessing xnx.
|
||||
xnx.ParentNode.RemoveChild(xnx);
|
||||
}
|
||||
|
||||
private DVEnhancedDocuments _MyEnhancedDocuments = null;
|
||||
public DVEnhancedDocuments MyEnhancedDocuments
|
||||
{
|
||||
@@ -143,15 +147,16 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
set { _MyEnhancedDocuments = value; }
|
||||
}
|
||||
|
||||
public void SaveDVEnhancedDocuments()
|
||||
{
|
||||
// get all of the current enhanced links from datastructure in code. This list may have been
|
||||
// get all of the current enhanced links from data structure in code. This list may have been
|
||||
// modified by adding items during code execution by associating source <--> background etc.
|
||||
DVEnhancedDocuments edsToAdd = new DVEnhancedDocuments();
|
||||
foreach (DVEnhancedDocument ed in MyEnhancedDocuments)
|
||||
edsToAdd.Add(ed);
|
||||
|
||||
// from the existing list in xml, remove any that are in the 'editted (edsToAdd) list
|
||||
// from the existing list in xml, remove any that are in the 'edited (edsToAdd) list
|
||||
// so that what remains are those that need added to xml that will then be written to database
|
||||
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
|
||||
{
|
||||
@@ -192,12 +197,14 @@ namespace VEPROMS.CSLA.Library
|
||||
xa.Value = edadd.PdfToken;
|
||||
}
|
||||
}
|
||||
|
||||
#region DynamicTypeDescriptor
|
||||
internal override bool IsReadOnly
|
||||
{
|
||||
get { return _DocVersion == null; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region XML
|
||||
private XMLProperties _Xp;
|
||||
private XMLProperties Xp
|
||||
@@ -205,6 +212,7 @@ namespace VEPROMS.CSLA.Library
|
||||
get { return _Xp; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
//PROPGRID: Hide ParentLookup
|
||||
[Browsable(false)]
|
||||
@@ -230,6 +238,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_Xp = new XMLProperties(xml);
|
||||
if (docVersion.MyDocVersionInfo.MyFolder != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
|
||||
}
|
||||
|
||||
private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args)
|
||||
{
|
||||
if (args.AncestorLookup || ParentLookup)
|
||||
@@ -242,6 +251,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
//private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args)
|
||||
//{
|
||||
// if (args.AncestorLookup || ParentLookup)
|
||||
@@ -282,6 +292,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_Xp[group, item] = newvalue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Local Properties
|
||||
[Category("General")]
|
||||
[DisplayName("Name")]
|
||||
@@ -360,6 +371,7 @@ namespace VEPROMS.CSLA.Library
|
||||
set { _SaveChangesToDocVersionConfig = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ToString
|
||||
public override string ToString()
|
||||
{
|
||||
@@ -368,6 +380,7 @@ namespace VEPROMS.CSLA.Library
|
||||
return s;
|
||||
}
|
||||
#endregion
|
||||
|
||||
//<Config><RODefaults Setpoint="SP1" Graphics="IG1" ROPATH="g:\ops\vehlp\ro" /><PrintSettings ChangeBar="3" ChangeBarLoc="1" ChangeBarText="3" numcopies="1" Watermark="1" userformat=" " disableduplex="False" /><format plant="OHLP" /></Config>
|
||||
|
||||
#region RODefaults // From proc.ini
|
||||
@@ -446,6 +459,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PrintSettingsCategory // From curset.dat
|
||||
[Category("Print Settings")]
|
||||
//PROPGRID: Hide Printer
|
||||
@@ -1466,6 +1480,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Unit // From PROC.INI
|
||||
//MultiUnitCount
|
||||
[Category("Unit")]
|
||||
@@ -1479,6 +1494,8 @@ namespace VEPROMS.CSLA.Library
|
||||
return _Xp.XmlContents.SelectNodes("//Slave").Count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int _SelectedSlave = 0;
|
||||
//[Browsable(false)]
|
||||
public int SelectedSlave
|
||||
@@ -1560,8 +1577,10 @@ namespace VEPROMS.CSLA.Library
|
||||
get
|
||||
{
|
||||
string s = GetCombinedSlaveValue("Name") ?? _Xp["Unit", "Name"];// get the saved value
|
||||
|
||||
if (SelectedSlave > 0)
|
||||
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Name"];
|
||||
|
||||
return s;
|
||||
}
|
||||
set
|
||||
@@ -1570,9 +1589,11 @@ namespace VEPROMS.CSLA.Library
|
||||
_Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Name"] = value; // save selected value
|
||||
else
|
||||
_Xp["Unit", "Name"] = value;
|
||||
|
||||
OnPropertyChanged("Unit_Name");
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Unit")]
|
||||
[DisplayName("Other Unit Name")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
@@ -2369,4 +2390,4 @@ OnPropertyChanged("Default_BkColor");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user