Improved conversion ot Referenced Objects and Transitions to text
Added code to implement deleting pdfs Fixed problems with searching by Textm Annotations, Referenced Objects and Transitions
This commit is contained in:
parent
f16fcf1470
commit
cb52bad3e9
@ -32,13 +32,25 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// if (g.ToString() != transText)
|
// if (g.ToString() != transText)
|
||||||
// Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
// Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
||||||
//}
|
//}
|
||||||
string newvalue = tran.ResolvePathTo();
|
string newvalue = tran != null ? tran.ResolvePathTo() : string.Empty;
|
||||||
if (forceConvertToText)
|
if (forceConvertToText)
|
||||||
newvalue = "?";
|
newvalue = "?";
|
||||||
string findLink = @"<START\].*?\[END>";
|
string findLink = @"<START\].*?\[END>";
|
||||||
MatchCollection ms = Regex.Matches(Text, findLink);
|
MatchCollection ms = Regex.Matches(Text, findLink);
|
||||||
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
|
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
|
||||||
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
string lookFor;
|
||||||
|
if (tran == null)
|
||||||
|
{
|
||||||
|
int loc1 = Text.IndexOf("#Link:Transition:", 0) + ("#Link:Transition:").Length;
|
||||||
|
int loc2 = Text.IndexOf(" ", loc1);
|
||||||
|
string trantype = Text.Substring(loc1, loc2 - loc1);
|
||||||
|
loc1 = loc2 + 1;
|
||||||
|
loc2 = Text.IndexOf(" ", loc1);
|
||||||
|
string tranid = Text.Substring(loc1, loc2 - loc1);
|
||||||
|
lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", trantype, tranid);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
||||||
foreach (Match mm in ms)
|
foreach (Match mm in ms)
|
||||||
{
|
{
|
||||||
Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline);
|
Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline);
|
||||||
@ -57,7 +69,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
string rv = ConvertTransitionToText(tran, newvalue);
|
string rv = ConvertTransitionToText(tran, newvalue);
|
||||||
//Text = Text.Substring(0, myIndex - 14) + gg + Text.Substring(myIndex + myLength);
|
//Text = Text.Substring(0, myIndex - 14) + gg + Text.Substring(myIndex + myLength);
|
||||||
Annotation.MakeAnnotation(this.ContentItems[0].MyItem, ItemInfo.VolianCommentType, "", string.Format("Transition ({0}) converted to text", ItemInfo.ConvertToDisplayText(gg)), null);
|
Annotation.MakeAnnotation(this.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("Transition ({0}) converted to text", ItemInfo.ConvertToDisplayText(gg)), null);
|
||||||
|
if(tran != null)
|
||||||
Transition.Delete(tran.TransitionID);
|
Transition.Delete(tran.TransitionID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -69,7 +82,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// see if there is a grid to update too.
|
// see if there is a grid to update too.
|
||||||
if (tran.MyContent.MyGrid != null)
|
if (tran != null && tran.MyContent.MyGrid != null)
|
||||||
{
|
{
|
||||||
//string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
//string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
||||||
//Match mg = Regex.Match(MyGrid.Data, lookForXml);
|
//Match mg = Regex.Match(MyGrid.Data, lookForXml);
|
||||||
@ -128,7 +141,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
MatchCollection ms = Regex.Matches(Text, findLink);
|
MatchCollection ms = Regex.Matches(Text, findLink);
|
||||||
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
|
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
|
||||||
//string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousg.ROUsageID);
|
//string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousg.ROUsageID);
|
||||||
string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
string lookFor;
|
||||||
|
if (tran == null)
|
||||||
|
{
|
||||||
|
int loc1 = Text.IndexOf("#Link:Transition:", 0) + ("#Link:Transition:").Length;
|
||||||
|
int loc2 = Text.IndexOf(" ", loc1);
|
||||||
|
string trantype = Text.Substring(loc1, loc2 - loc1);
|
||||||
|
loc1 = loc2 + 1;
|
||||||
|
loc2 = Text.IndexOf(" ", loc1);
|
||||||
|
string tranid = Text.Substring(loc1, loc2 - loc1);
|
||||||
|
lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", trantype, tranid);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
||||||
int lastIndex = 0;
|
int lastIndex = 0;
|
||||||
string newText = Text;
|
string newText = Text;
|
||||||
foreach (Match mm in ms)
|
foreach (Match mm in ms)
|
||||||
@ -403,7 +428,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (value == "?")
|
if (value == "?")
|
||||||
{
|
{
|
||||||
retval = this.ConvertROToText(rousg, value, rotype, origROFstInfo);
|
retval = this.ConvertROToText(rousg, value, rotype, origROFstInfo);
|
||||||
Annotation.MakeAnnotation(this.ContentItems[0].MyItem, ItemInfo.VolianCommentType, "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(retval)), null);
|
Annotation.MakeAnnotation(this.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(retval)), null);
|
||||||
RoUsage.Delete(rousg.ROUsageID);
|
RoUsage.Delete(rousg.ROUsageID);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -545,9 +570,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii)
|
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii)
|
||||||
{
|
{
|
||||||
FixTransitionText(tran, tranLookup, ii, false);
|
FixTransitionText(tran, tranLookup, ii, "");
|
||||||
}
|
}
|
||||||
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii, bool forceConvertToText)
|
public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup, ItemInfo ii, string forceConvertToText)
|
||||||
{
|
{
|
||||||
//string transText = tran.ResolvePathTo();
|
//string transText = tran.ResolvePathTo();
|
||||||
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
//string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID);
|
||||||
@ -565,7 +590,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
newvalue = tran.ResolvePathTo();
|
newvalue = tran.ResolvePathTo();
|
||||||
else
|
else
|
||||||
newvalue = tran.ResolvePathTo(tranLookup);
|
newvalue = tran.ResolvePathTo(tranLookup);
|
||||||
if (forceConvertToText)
|
if (forceConvertToText != string.Empty)
|
||||||
newvalue = "?";
|
newvalue = "?";
|
||||||
string findLink = @"<START\].*?\[END>";
|
string findLink = @"<START\].*?\[END>";
|
||||||
MatchCollection ms = Regex.Matches(Text, findLink);
|
MatchCollection ms = Regex.Matches(Text, findLink);
|
||||||
@ -592,7 +617,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (newvalue == "?")
|
if (newvalue == "?")
|
||||||
{
|
{
|
||||||
gg = ItemInfo.ConvertToDisplayText(gg);
|
gg = ItemInfo.ConvertToDisplayText(gg);
|
||||||
newvalue = "Invalid Transition";
|
newvalue = forceConvertToText;
|
||||||
OnStaticContentInfoChange(ii, new StaticContentInfoEventArgs(gg, newvalue, "TX"));
|
OnStaticContentInfoChange(ii, new StaticContentInfoEventArgs(gg, newvalue, "TX"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -666,9 +691,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public void FixTransitionText(TransitionInfo tran, ItemInfo ii)
|
public void FixTransitionText(TransitionInfo tran, ItemInfo ii)
|
||||||
{
|
{
|
||||||
FixTransitionText(tran, ii, false);
|
FixTransitionText(tran, ii, "");
|
||||||
}
|
}
|
||||||
public void FixTransitionText(TransitionInfo tran, ItemInfo ii, bool forceConvertToText)
|
public void FixTransitionText(TransitionInfo tran, ItemInfo ii, string forceConvertToText)
|
||||||
{
|
{
|
||||||
FixTransitionText(tran, null, ii, forceConvertToText);
|
FixTransitionText(tran, null, ii, forceConvertToText);
|
||||||
//string transText = tran.ResolvePathTo(tranLookup);
|
//string transText = tran.ResolvePathTo(tranLookup);
|
||||||
|
@ -585,26 +585,26 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
bool forceConvertToText = false;
|
bool forceConvertToText = false;
|
||||||
TranCheckCount++;
|
TranCheckCount++;
|
||||||
if (TransitionsToNonEditable != null)
|
//if (TransitionsToNonEditable != null)
|
||||||
{
|
//{
|
||||||
if (IsTransitionToNonEditable(traninfo))
|
// if (IsTransitionToNonEditable(traninfo))
|
||||||
{
|
// {
|
||||||
forceConvertToText = true;
|
// forceConvertToText = true;
|
||||||
TranFixCount++;
|
// TranFixCount++;
|
||||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, true);
|
// itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Non-Editable Step");
|
||||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
// Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||||
content.FixTransitionText(traninfo, true);
|
// content.FixTransitionText(traninfo, true);
|
||||||
content.Save();
|
// content.Save();
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
else
|
if (!forceConvertToText)
|
||||||
{
|
{
|
||||||
SectionConfig sc = traninfo.MyItemToID.ActiveSection.MyConfig as SectionConfig;
|
SectionConfig sc = traninfo.MyItemToID.ActiveSection.MyConfig as SectionConfig;
|
||||||
forceConvertToText = (sc.SubSection_Edit == "N");
|
forceConvertToText = (sc.SubSection_Edit == "N");
|
||||||
if (forceConvertToText)
|
if (forceConvertToText)
|
||||||
{
|
{
|
||||||
TranFixCount++;
|
TranFixCount++;
|
||||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, true);
|
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Non-Editable Step");
|
||||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||||
content.FixTransitionText(traninfo, true);
|
content.FixTransitionText(traninfo, true);
|
||||||
content.Save();
|
content.Save();
|
||||||
@ -617,7 +617,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
forceConvertToText = true;
|
forceConvertToText = true;
|
||||||
TranFixCount++;
|
TranFixCount++;
|
||||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, true);
|
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to External Procedure using Internal Format");
|
||||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||||
content.FixTransitionText(traninfo, true);
|
content.FixTransitionText(traninfo, true);
|
||||||
content.Save();
|
content.Save();
|
||||||
@ -626,15 +626,18 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!forceConvertToText)
|
if (!forceConvertToText)
|
||||||
{
|
{
|
||||||
if (itemInfo.MyDocVersion.VersionID != traninfo.MyItemToID.MyDocVersion.VersionID) //different doc version
|
if (itemInfo.MyDocVersion.VersionID != traninfo.MyItemToID.MyDocVersion.VersionID) //different doc version
|
||||||
|
{
|
||||||
|
if (!itemInfo.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[traninfo.TranType].TransMenu.Contains("Proc")) //internal format
|
||||||
{
|
{
|
||||||
forceConvertToText = true;
|
forceConvertToText = true;
|
||||||
TranFixCount++;
|
TranFixCount++;
|
||||||
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, true);
|
itemInfo.MyContent.FixTransitionText(traninfo, itemInfo, "Reason for Change: Transition to Outside Procedure using Internal Format");
|
||||||
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
Content content = Content.Get(itemInfo.MyContent.ContentID);
|
||||||
content.FixTransitionText(traninfo, true);
|
content.FixTransitionText(traninfo, true);
|
||||||
content.Save();
|
content.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!forceConvertToText)
|
if (!forceConvertToText)
|
||||||
{
|
{
|
||||||
string oldText = itemInfo.MyContent.Text;
|
string oldText = itemInfo.MyContent.Text;
|
||||||
@ -710,7 +713,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (roval == "?")
|
if (roval == "?")
|
||||||
{
|
{
|
||||||
oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo);
|
oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo);
|
||||||
Annotation.MakeAnnotation(content.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null);
|
Annotation.MakeAnnotation(content.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
content.FixContentText(rousage, roval, roch.type, rofstinfo);
|
content.FixContentText(rousage, roval, roch.type, rofstinfo);
|
||||||
@ -748,7 +751,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (roval == "?")
|
if (roval == "?")
|
||||||
{
|
{
|
||||||
oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo);
|
oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo);
|
||||||
Annotation.MakeAnnotation(content.ContentItems[0].MyItem, VolianCommentType, "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null);
|
Annotation.MakeAnnotation(content.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
content.FixContentText(rousage, roval, roch.type, rofstinfo);
|
content.FixContentText(rousage, roval, roch.type, rofstinfo);
|
||||||
@ -5559,14 +5562,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
return (Procedure)(_Editable = Procedure.Get(ItemID));
|
return (Procedure)(_Editable = Procedure.Get(ItemID));
|
||||||
}
|
}
|
||||||
public static void RefreshTransitions(ProcedureInfo tmp)
|
//public static void RefreshTransitions(ProcedureInfo tmp)
|
||||||
|
//{
|
||||||
|
// RefreshTransitions(tmp, null, null);
|
||||||
|
//}
|
||||||
|
public static void RefreshTransitions(ProcedureInfo tmp)//, TransitionInfoList transitionToDisconnected, TransitionInfoList transitionsToNonEditable)
|
||||||
{
|
{
|
||||||
RefreshTransitions(tmp, null, null);
|
//TransitionsToDisconnected = transitionToDisconnected;
|
||||||
}
|
//TransitionsToNonEditable = transitionsToNonEditable;
|
||||||
public static void RefreshTransitions(ProcedureInfo tmp, TransitionInfoList transitionToDisconnected, TransitionInfoList transitionsToNonEditable)
|
|
||||||
{
|
|
||||||
TransitionsToDisconnected = transitionToDisconnected;
|
|
||||||
TransitionsToNonEditable = transitionsToNonEditable;
|
|
||||||
TransitionLookup tranLookup = new TransitionLookup(0, tmp.ItemID, tmp.MyLookup);
|
TransitionLookup tranLookup = new TransitionLookup(0, tmp.ItemID, tmp.MyLookup);
|
||||||
tranLookup.ApplicabilityUnit = tmp.MyDocVersion.DocVersionConfig.SelectedSlave;
|
tranLookup.ApplicabilityUnit = tmp.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||||
tranLookup.NewLookupNeeded += new TransitionLookupEvent(GetNewLookup);
|
tranLookup.NewLookupNeeded += new TransitionLookupEvent(GetNewLookup);
|
||||||
|
@ -92,4 +92,51 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public partial class PdfInfoList
|
public partial class PdfInfoList
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
public class ExecuteStoredProcedure : CommandBase
|
||||||
|
{
|
||||||
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
#region Factory Methods
|
||||||
|
private string _StoredProcedure;
|
||||||
|
public string StoredProcedure
|
||||||
|
{
|
||||||
|
get { return _StoredProcedure; }
|
||||||
|
set { _StoredProcedure = value; }
|
||||||
|
}
|
||||||
|
private int _AffectedRows;
|
||||||
|
public int AffectedRows
|
||||||
|
{
|
||||||
|
get { return _AffectedRows; }
|
||||||
|
set { _AffectedRows = value; }
|
||||||
|
}
|
||||||
|
public static int Execute(string storedProcedure)
|
||||||
|
{
|
||||||
|
ExecuteStoredProcedure cmd = new ExecuteStoredProcedure();
|
||||||
|
cmd.StoredProcedure = storedProcedure;
|
||||||
|
DataPortal.Execute<ExecuteStoredProcedure>(cmd);
|
||||||
|
return cmd.AffectedRows;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region Server-Side code
|
||||||
|
protected override void DataPortal_Execute()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cmd = new SqlCommand(StoredProcedure, cn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
cmd.CommandTimeout = 0;
|
||||||
|
AffectedRows = cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (_MyLog.IsErrorEnabled) _MyLog.Error("ExecuteStoredProcedure Error", ex);
|
||||||
|
throw new ApplicationException("Failure on ExecuteStoredProcedure", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,6 +150,21 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (e.NewTab == tabTranSearch)
|
if (e.NewTab == tabTranSearch)
|
||||||
{
|
{
|
||||||
|
//enable-disable doc version nodes based on version type if selected
|
||||||
|
if (cbxTranVersion.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
if (dicExpandedDocVersionNodes.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DevComponents.AdvTree.Node n in dicExpandedDocVersionNodes.Keys)
|
||||||
|
{
|
||||||
|
DocVersionInfo dvi = (DocVersionInfo)n.Tag;
|
||||||
|
if(cbxTranVersion.Tag.ToString().Contains(dvi.VersionID.ToString()))
|
||||||
|
n.Enabled = true;
|
||||||
|
else
|
||||||
|
n.Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//setup transition format versions
|
//setup transition format versions
|
||||||
this.Cursor = Cursors.WaitCursor;
|
this.Cursor = Cursors.WaitCursor;
|
||||||
if (myFormatVersionList == null)
|
if (myFormatVersionList == null)
|
||||||
@ -170,6 +185,19 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
this.Cursor = Cursors.Default;
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (DevComponents.AdvTree.Node n in dicExpandedDocVersionNodes.Keys)
|
||||||
|
n.Enabled = true;
|
||||||
|
if (dicSelectedDocVersionNodes.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DevComponents.AdvTree.Node n in dicSelectedDocVersionNodes.Keys)
|
||||||
|
{
|
||||||
|
n.Enabled = true;
|
||||||
|
}
|
||||||
|
dicSelectedDocVersionNodes.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cbxTranFormat_SelectedIndexChanged(object sender, EventArgs e)
|
void cbxTranFormat_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
@ -254,6 +282,18 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
cbxTranVersion.Tag = versionList;
|
cbxTranVersion.Tag = versionList;
|
||||||
cbxTranFormatFillIn(versionList);
|
cbxTranFormatFillIn(versionList);
|
||||||
|
if (dicExpandedDocVersionNodes.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DevComponents.AdvTree.Node n in dicExpandedDocVersionNodes.Keys)
|
||||||
|
{
|
||||||
|
DocVersionInfo dvi = (DocVersionInfo)n.Tag;
|
||||||
|
if (cbxTranVersion.Tag.ToString().Contains(dvi.VersionID.ToString()))
|
||||||
|
n.Enabled = true;
|
||||||
|
else
|
||||||
|
n.Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<DevComponents.AdvTree.Node> uncheckNodes = new List<Node>();
|
List<DevComponents.AdvTree.Node> uncheckNodes = new List<Node>();
|
||||||
foreach (DevComponents.AdvTree.Node n in dicSelectedDocVersionNodes.Keys)
|
foreach (DevComponents.AdvTree.Node n in dicSelectedDocVersionNodes.Keys)
|
||||||
{
|
{
|
||||||
@ -456,6 +496,7 @@ namespace Volian.Controls.Library
|
|||||||
// vlnStackTrace.ShowStackLocal(e.Node.Text,1,10);
|
// vlnStackTrace.ShowStackLocal(e.Node.Text,1,10);
|
||||||
//}
|
//}
|
||||||
private Dictionary<DevComponents.AdvTree.Node, bool> dicSelectedDocVersionNodes = new Dictionary<DevComponents.AdvTree.Node, bool>();
|
private Dictionary<DevComponents.AdvTree.Node, bool> dicSelectedDocVersionNodes = new Dictionary<DevComponents.AdvTree.Node, bool>();
|
||||||
|
private Dictionary<DevComponents.AdvTree.Node, bool> dicExpandedDocVersionNodes = new Dictionary<DevComponents.AdvTree.Node, bool>();
|
||||||
void advTreeProcSets_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e)
|
void advTreeProcSets_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e)
|
||||||
{
|
{
|
||||||
DevComponents.AdvTree.Node par = e.Node;
|
DevComponents.AdvTree.Node par = e.Node;
|
||||||
@ -498,10 +539,15 @@ namespace Volian.Controls.Library
|
|||||||
newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox;
|
newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox;
|
||||||
newnode.CheckBoxThreeState = false;
|
newnode.CheckBoxThreeState = false;
|
||||||
newnode.CheckBoxVisible = true;
|
newnode.CheckBoxVisible = true;
|
||||||
|
if (tabSearchTypes.SelectedTab == tabTranSearch)
|
||||||
|
{
|
||||||
if (!dicSelectedDocVersionNodes.ContainsKey(newnode)) dicSelectedDocVersionNodes.Add(newnode, false);
|
if (!dicSelectedDocVersionNodes.ContainsKey(newnode)) dicSelectedDocVersionNodes.Add(newnode, false);
|
||||||
|
|
||||||
newnode.Enabled = cbxTranVersion.Tag != null ? cbxTranVersion.Tag.ToString().Contains(dv.VersionID.ToString()) : false;
|
newnode.Enabled = cbxTranVersion.Tag != null ? cbxTranVersion.Tag.ToString().Contains(dv.VersionID.ToString()) : false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
newnode.Enabled = true;
|
||||||
par.Nodes.Add(newnode);
|
par.Nodes.Add(newnode);
|
||||||
|
dicExpandedDocVersionNodes.Add(newnode, newnode.Enabled);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user