Use ActiveFormat rather than FormatStepData.MyFormat (this works for Steps/Sections and Procedures)
This commit is contained in:
parent
45e663f2d3
commit
ba4f16b7e1
@ -3619,19 +3619,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public bool IsInTemplate() // is this step defined by template, i.e. included in template list
|
public bool IsInTemplate() // is this step defined by template, i.e. included in template list
|
||||||
{
|
{
|
||||||
if (IsStep && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes != null && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes.ContainsKey((int)MyContent.Type - 20001)) return true;
|
if (IsStep && ActiveFormat.PlantFormat.FormatData.TopTemplateTypes != null && ActiveFormat.PlantFormat.FormatData.TopTemplateTypes.ContainsKey((int)MyContent.Type - 20001)) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public bool IsWithInSingleColumnTemplate() // is this step within a step defined by a 'single-column' template item
|
public bool IsWithInSingleColumnTemplate() // is this step within a step defined by a 'single-column' template item
|
||||||
{
|
{
|
||||||
if (IsStep && FormatStepData.MyFormat.PlantFormat.FormatData.TopTemplateTypes != null)
|
if (IsStep && ActiveFormat.PlantFormat.FormatData.TopTemplateTypes != null)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = this;
|
ItemInfo tmp = this;
|
||||||
while (tmp.IsStep)
|
while (tmp.IsStep)
|
||||||
{
|
{
|
||||||
if (tmp.TemplateIndex > 0)
|
if (tmp.TemplateIndex > 0)
|
||||||
{
|
{
|
||||||
if (FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tmp.TemplateIndex].nocolm==0) return true;
|
if (ActiveFormat.PlantFormat.FormatData.Templates[tmp.TemplateIndex].nocolm == 0) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tmp = tmp.MyParent;
|
tmp = tmp.MyParent;
|
||||||
@ -3641,8 +3641,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public int GetSmartTemplateTopLevelIndxOfThisType(int oftype) // used for inserting steps
|
public int GetSmartTemplateTopLevelIndxOfThisType(int oftype) // used for inserting steps
|
||||||
{
|
{
|
||||||
if (FormatStepData == null) return -1;
|
if (ActiveFormat == null) return -1;
|
||||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||||
if (formatData.TopTemplateTypes.ContainsKey(oftype - 20001)) return formatData.TopTemplateTypes[oftype - 20001];
|
if (formatData.TopTemplateTypes.ContainsKey(oftype - 20001)) return formatData.TopTemplateTypes[oftype - 20001];
|
||||||
return -1;
|
return -1;
|
||||||
@ -3650,7 +3650,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public int GetSmartTemplateTopLevelIndx()
|
public int GetSmartTemplateTopLevelIndx()
|
||||||
{
|
{
|
||||||
if (FormatStepData == null) return -1;
|
if (FormatStepData == null) return -1;
|
||||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||||
ItemInfo tmp = this;
|
ItemInfo tmp = this;
|
||||||
while (!tmp.IsSection)
|
while (!tmp.IsSection)
|
||||||
@ -3662,7 +3662,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public int GetSmartTemplateIndex(int topIndx, int curStepType)
|
public int GetSmartTemplateIndex(int topIndx, int curStepType)
|
||||||
{
|
{
|
||||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||||
int indx = topIndx;
|
int indx = topIndx;
|
||||||
int curType = curStepType - 20001;
|
int curType = curStepType - 20001;
|
||||||
@ -3681,8 +3681,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public int GetSmartTemplateIndex(int topIndx, string strtxt)
|
public int GetSmartTemplateIndex(int topIndx, string strtxt)
|
||||||
{
|
{
|
||||||
string txt = strtxt.Replace(@"\u160?"," ");
|
string txt = strtxt.Replace(@"\u160?"," ");
|
||||||
if (FormatStepData == null) return -1;
|
if (ActiveFormat == null) return -1;
|
||||||
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
|
FormatData formatData = ActiveFormat.PlantFormat.FormatData;
|
||||||
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
|
||||||
int indx = topIndx;
|
int indx = topIndx;
|
||||||
while (indx < formatData.Templates.Count)
|
while (indx < formatData.Templates.Count)
|
||||||
|
@ -312,8 +312,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
ItemInfo siblingSmart = null;
|
ItemInfo siblingSmart = null;
|
||||||
ItemInfo firstSmart = null;
|
ItemInfo firstSmart = null;
|
||||||
int level = FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].level;
|
int level = ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].level;
|
||||||
string tmptext = FormatStepData.MyFormat.PlantFormat.FormatData.NewTemplateFormat ? text : FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
string tmptext = ActiveFormat.PlantFormat.FormatData.NewTemplateFormat ? text : ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
||||||
int prevlevel = level;
|
int prevlevel = level;
|
||||||
while (level > 0)
|
while (level > 0)
|
||||||
{
|
{
|
||||||
@ -331,7 +331,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (level == prevlevel) addPart = EAddpingPart.After;
|
if (level == prevlevel) addPart = EAddpingPart.After;
|
||||||
if (level < prevlevel)
|
if (level < prevlevel)
|
||||||
{
|
{
|
||||||
if (FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].type == 39)
|
if (ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].type == 39)
|
||||||
{
|
{
|
||||||
fromType = E_FromType.RNO;
|
fromType = E_FromType.RNO;
|
||||||
addPart = EAddpingPart.Child;
|
addPart = EAddpingPart.Child;
|
||||||
@ -343,15 +343,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
newItemID = siblingSmart.ItemID;
|
newItemID = siblingSmart.ItemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmptext = /*FormatStepData.MyFormat.PlantFormat.FormatData.NewTemplateFormat ? " ": */FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
tmptext = /*ActiveFormat.PlantFormat.FormatData.NewTemplateFormat ? " ": */ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
||||||
tmp = NewItemInfoFetch(newItemID, addPart, null, tmptext, FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].type + 20001, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
tmp = NewItemInfoFetch(newItemID, addPart, null, tmptext, ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].type + 20001, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
||||||
newItemID = tmp.ItemID;
|
newItemID = tmp.ItemID;
|
||||||
if (level < prevlevel) siblingSmart = tmp;
|
if (level < prevlevel) siblingSmart = tmp;
|
||||||
}
|
}
|
||||||
tpIndx++;
|
tpIndx++;
|
||||||
prevlevel = level;
|
prevlevel = level;
|
||||||
level = tpIndx < FormatStepData.MyFormat.PlantFormat.FormatData.Templates.Count ?
|
level = tpIndx < ActiveFormat.PlantFormat.FormatData.Templates.Count ?
|
||||||
FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].level : -1;
|
ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].level : -1;
|
||||||
}
|
}
|
||||||
tmp = firstSmart;
|
tmp = firstSmart;
|
||||||
}
|
}
|
||||||
@ -368,8 +368,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
ItemInfo siblingSmart = null;
|
ItemInfo siblingSmart = null;
|
||||||
ItemInfo firstSmart = null;
|
ItemInfo firstSmart = null;
|
||||||
int level = FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].level;
|
int level = ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].level;
|
||||||
string tmptext = FormatStepData.MyFormat.PlantFormat.FormatData.NewTemplateFormat?text:FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
string tmptext = ActiveFormat.PlantFormat.FormatData.NewTemplateFormat ? text : ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
||||||
int prevlevel = level;
|
int prevlevel = level;
|
||||||
while (level > 0)
|
while (level > 0)
|
||||||
{
|
{
|
||||||
@ -386,7 +386,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (level == prevlevel) addPart = EAddpingPart.After;
|
if (level == prevlevel) addPart = EAddpingPart.After;
|
||||||
if (level < prevlevel)
|
if (level < prevlevel)
|
||||||
{
|
{
|
||||||
if (FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].type == 39)
|
if (ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].type == 39)
|
||||||
{
|
{
|
||||||
fromType = E_FromType.RNO;
|
fromType = E_FromType.RNO;
|
||||||
addPart = EAddpingPart.Child;
|
addPart = EAddpingPart.Child;
|
||||||
@ -398,15 +398,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
newItemID = siblingSmart.ItemID;
|
newItemID = siblingSmart.ItemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmptext = /*FormatStepData.MyFormat.PlantFormat.FormatData.NewTemplateFormat ? " ": */FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
tmptext = /*ActiveFormat.PlantFormat.FormatData.NewTemplateFormat ? " ": */ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].text;
|
||||||
tmp = NewItemInfoFetch(newItemID, addPart, null, tmptext, FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].type + 20001, (int ?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
tmp = NewItemInfoFetch(newItemID, addPart, null, tmptext, ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].type + 20001, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
|
||||||
newItemID = tmp.ItemID;
|
newItemID = tmp.ItemID;
|
||||||
if (level < prevlevel) siblingSmart = tmp;
|
if (level < prevlevel) siblingSmart = tmp;
|
||||||
}
|
}
|
||||||
tpIndx++;
|
tpIndx++;
|
||||||
prevlevel = level;
|
prevlevel = level;
|
||||||
level = tpIndx < FormatStepData.MyFormat.PlantFormat.FormatData.Templates.Count ?
|
level = tpIndx < ActiveFormat.PlantFormat.FormatData.Templates.Count ?
|
||||||
FormatStepData.MyFormat.PlantFormat.FormatData.Templates[tpIndx].level : -1;
|
ActiveFormat.PlantFormat.FormatData.Templates[tpIndx].level : -1;
|
||||||
}
|
}
|
||||||
tmp = firstSmart;
|
tmp = firstSmart;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user