This commit is contained in:
		@@ -218,6 +218,116 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
			}
 | 
			
		||||
			set { _StepDataList = value; }
 | 
			
		||||
		}
 | 
			
		||||
		public List<StepDataRetval> GetSearchableSteps()
 | 
			
		||||
		{
 | 
			
		||||
			List<StepDataRetval> sds = new List<StepDataRetval>();
 | 
			
		||||
			foreach (StepData sd in StepDataList)
 | 
			
		||||
			{
 | 
			
		||||
				if (!sd.Inactive && sd.StepEditData.Searchable) sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index)));
 | 
			
		||||
			}
 | 
			
		||||
			return sds;
 | 
			
		||||
		}
 | 
			
		||||
		public StepData StepTopUnderBase(StepData sd, int formatStepType)
 | 
			
		||||
		{
 | 
			
		||||
			StepData top = sd;
 | 
			
		||||
			while (top.ParentType != "Base")
 | 
			
		||||
			{
 | 
			
		||||
				string sParStp = StepDataList[formatStepType].ParentType;
 | 
			
		||||
				foreach (StepData stp in StepDataList)
 | 
			
		||||
				{
 | 
			
		||||
					if (top.ParentType == stp.Type)
 | 
			
		||||
					{
 | 
			
		||||
						top = stp;
 | 
			
		||||
						break;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return top;
 | 
			
		||||
		}
 | 
			
		||||
		public List<StepDataRetval> StepGetLevelTypes(StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo)
 | 
			
		||||
		{
 | 
			
		||||
			List<StepDataRetval> sds = new List<StepDataRetval>();
 | 
			
		||||
			int retval = -1;
 | 
			
		||||
			int cntitm = 0;
 | 
			
		||||
			// if there are alternatenames for this item, use that list, otherwise, get list from
 | 
			
		||||
			// xml for current node & its children....  
 | 
			
		||||
			if (topType.StepEditData.TypeMenu.AlternateNameList != null && topType.StepEditData.TypeMenu.AlternateNameList != "")
 | 
			
		||||
			{
 | 
			
		||||
				// loop through the AlternateName string, it has indices for step types..
 | 
			
		||||
				string[] split = topType.StepEditData.TypeMenu.AlternateNameList.Split(new Char[] { ',' });
 | 
			
		||||
				foreach (string s in split)
 | 
			
		||||
				{
 | 
			
		||||
					foreach (StepData sd in this.StepDataList)
 | 
			
		||||
					{
 | 
			
		||||
						if (sd.Type == s && !sd.Inactive)
 | 
			
		||||
						{
 | 
			
		||||
							sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index)));
 | 
			
		||||
							if (topType.Type == sd.Type) retval = cntitm;
 | 
			
		||||
							cntitm++;
 | 
			
		||||
							break;
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			// some menu items (step change types) can only be done in aer column, check for that....
 | 
			
		||||
			else if ((topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu) ||
 | 
			
		||||
				(topType.StepEditData.TypeMenu.InMenu && !topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO) ||
 | 
			
		||||
				(topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO))
 | 
			
		||||
			{
 | 
			
		||||
				if (!topType.Inactive)
 | 
			
		||||
				{
 | 
			
		||||
					if (_CurItemInfo.IsInRNO && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")
 | 
			
		||||
						sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index)));
 | 
			
		||||
					else
 | 
			
		||||
						sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index)));
 | 
			
		||||
 | 
			
		||||
					if (topType.Type == curType) retval = cntitm;
 | 
			
		||||
					cntitm++;
 | 
			
		||||
				}
 | 
			
		||||
				foreach (StepData sd in StepDataList)
 | 
			
		||||
				{
 | 
			
		||||
					if (sd.ParentType == topType.Type)
 | 
			
		||||
					{
 | 
			
		||||
						int tmpindx = DoListChildStepTypes(ref sds, sd, curType, _CurItemInfo, ref cntitm);
 | 
			
		||||
						if (sd.Type == curType) retval = tmpindx;
 | 
			
		||||
						if (retval < 0 && tmpindx > 0) retval = tmpindx;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			cursel = retval;
 | 
			
		||||
			return sds;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		private int DoListChildStepTypes(ref List<StepDataRetval> sds, StepData topType, string curType, ItemInfo _CurItemInfo, ref int cntitm)
 | 
			
		||||
		{
 | 
			
		||||
			int retval = -1;
 | 
			
		||||
			if ((topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu) ||
 | 
			
		||||
				(topType.StepEditData.TypeMenu.InMenu && !topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO) ||
 | 
			
		||||
				(topType.StepEditData.TypeMenu.InMenu && topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO))
 | 
			
		||||
			{
 | 
			
		||||
				if (!topType.Inactive)
 | 
			
		||||
				{
 | 
			
		||||
					if (_CurItemInfo.IsInRNO && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "")
 | 
			
		||||
						sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index)));
 | 
			
		||||
					else
 | 
			
		||||
						sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index)));
 | 
			
		||||
 | 
			
		||||
					if (topType.Type == curType) retval = cntitm;
 | 
			
		||||
					cntitm++;
 | 
			
		||||
				}
 | 
			
		||||
				foreach (StepData sd in StepDataList)
 | 
			
		||||
				{
 | 
			
		||||
					if (sd.ParentType == topType.Type)
 | 
			
		||||
					{
 | 
			
		||||
						int tmpindx = DoListChildStepTypes(ref sds, sd, curType, _CurItemInfo, ref cntitm);
 | 
			
		||||
						if (sd.Type == curType) retval = tmpindx;
 | 
			
		||||
						if (retval < 0 && tmpindx > 0) retval = tmpindx;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return retval;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	#endregion
 | 
			
		||||
	#region Symbols
 | 
			
		||||
@@ -2863,6 +2973,14 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
				return LazyLoad(ref _ParentType, "@ParentType");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<bool> _Inactive;
 | 
			
		||||
		public bool Inactive
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _Inactive, "@Inactive");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _StepTypeColOverride;
 | 
			
		||||
		public string StepTypeColOverride
 | 
			
		||||
		{ 
 | 
			
		||||
@@ -2880,14 +2998,6 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
				return LazyLoad(ref _Sep, "@Sep");
 | 
			
		||||
			} 
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _AlternateName;
 | 
			
		||||
		public string AlternateName
 | 
			
		||||
		{ 
 | 
			
		||||
			get 
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _AlternateName, "@AlternateName");
 | 
			
		||||
			} 
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _Prefix;
 | 
			
		||||
		public string Prefix
 | 
			
		||||
		{ 
 | 
			
		||||
@@ -3497,6 +3607,14 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
			: base(xmlNode)
 | 
			
		||||
		{
 | 
			
		||||
		}
 | 
			
		||||
		private TypeMenu _TypeMenu;
 | 
			
		||||
		public TypeMenu TypeMenu
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return (_TypeMenu == null) ? _TypeMenu = new TypeMenu(base.XmlNode) : _TypeMenu;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _ForeColor;
 | 
			
		||||
		public string ForeColor
 | 
			
		||||
		{
 | 
			
		||||
@@ -3521,6 +3639,72 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
				return LazyLoad<E_AccStep>(ref _AcTable, "StepEditData/@AcTable");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<bool> _Searchable;
 | 
			
		||||
		public bool Searchable
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _Searchable, "StepEditData/@Searchable");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	#endregion
 | 
			
		||||
	#region TypeMenu
 | 
			
		||||
	[TypeConverter(typeof(ExpandableObjectConverter))]
 | 
			
		||||
	public class TypeMenu : vlnFormatItem
 | 
			
		||||
	{
 | 
			
		||||
		public TypeMenu(XmlNode xmlNode)
 | 
			
		||||
			: base(xmlNode)
 | 
			
		||||
		{
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<bool> _InMenu;
 | 
			
		||||
		public bool InMenu
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _InMenu, "StepEditData/TypeMenu/@InMenu");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<bool> _RnoInMenu;
 | 
			
		||||
		public bool RnoInMenu
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _RnoInMenu, "StepEditData/TypeMenu/@RnoInMenu");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _MenuItem;
 | 
			
		||||
		public string MenuItem
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _MenuItem, "StepEditData/TypeMenu/@MenuItem");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _RnoMenuItem;
 | 
			
		||||
		public string RnoMenuItem
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _RnoMenuItem, "StepEditData/TypeMenu/@RnoMenuItem");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _NoChgReason;
 | 
			
		||||
		public string NoChgReason
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _NoChgReason, "StepEditData/TypeMenu/@NoChgReason");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		private LazyLoad<string> _AlternateNameList;
 | 
			
		||||
		public string AlternateNameList
 | 
			
		||||
		{
 | 
			
		||||
			get
 | 
			
		||||
			{
 | 
			
		||||
				return LazyLoad(ref _AlternateNameList, "StepEditData/TypeMenu/@AlternateNameList");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	#endregion
 | 
			
		||||
	#region StepTab
 | 
			
		||||
@@ -4071,5 +4255,27 @@ namespace VEPROMS.CSLA.Library
 | 
			
		||||
	}
 | 
			
		||||
	#endregion
 | 
			
		||||
	#endregion
 | 
			
		||||
	#region SupportClasses
 | 
			
		||||
	public class StepDataRetval
 | 
			
		||||
	{
 | 
			
		||||
		private string _Name;
 | 
			
		||||
		public string Name
 | 
			
		||||
		{
 | 
			
		||||
			get { return _Name; }
 | 
			
		||||
			set { _Name = value; }
 | 
			
		||||
		}
 | 
			
		||||
		private int _Index;
 | 
			
		||||
		public int Index
 | 
			
		||||
		{
 | 
			
		||||
			get { return _Index; }
 | 
			
		||||
			set { _Index = value; }
 | 
			
		||||
		}
 | 
			
		||||
		public StepDataRetval(string name, int index)
 | 
			
		||||
		{
 | 
			
		||||
			Name = name;
 | 
			
		||||
			Index = index;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	#endregion
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user