diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index 72f658d0..6f30d870 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -369,7 +369,7 @@ namespace Volian.Controls.Library } private static Regex _RegExGetNumber = new Regex(@"^ *[+-]?[.,0-9/]+(E[+-]?[0-9]+)?"); // Sort by numeric value if possible, Otherwise sort alphabetically. - private bool GreaterValue(string value1, string value2) + public static bool GreaterValue(string value1, string value2) { Match match1 = _RegExGetNumber.Match(value1); Match match2 = _RegExGetNumber.Match(value2); diff --git a/PROMS/Volian.Controls.Library/DisplayReports.cs b/PROMS/Volian.Controls.Library/DisplayReports.cs index 88a44562..7e126b83 100644 --- a/PROMS/Volian.Controls.Library/DisplayReports.cs +++ b/PROMS/Volian.Controls.Library/DisplayReports.cs @@ -608,7 +608,9 @@ namespace Volian.Controls.Library tmp.Text = chld[i].title; tmp.Tag = chld[i]; tmp.CheckBoxVisible = true; - tn.Nodes.Add(tmp); + int index = FindIndex(tn.Nodes, tmp.Text); + tn.Nodes.Insert(index, tmp); + //tn.Nodes.Add(tmp); DevComponents.AdvTree.Node sub = new DevComponents.AdvTree.Node(); sub.Text = "VLN_DUMMY_FOR_TREE"; tmp.Nodes.Add(sub); @@ -676,18 +678,19 @@ namespace Volian.Controls.Library } return index; } - private static Regex _RegExGetNumber = new Regex(@"^ *[+-]?[.,0-9]+(E[+-]?[0-9]+)?"); + //private static Regex _RegExGetNumber = new Regex(@"^ *[+-]?[.,0-9]+(E[+-]?[0-9]+)?"); private bool GreaterValue(string value1, string value2) { - Match match1 = _RegExGetNumber.Match(value1); - Match match2 = _RegExGetNumber.Match(value2); - if (match1.Success && match2.Success) // Compare the numeric value - { - double dbl1 = double.Parse(match1.ToString()); - double dbl2 = double.Parse(match2.ToString()); - return dbl1 > dbl2; - } - return String.Compare(value1, value2, true) > 0; + return DisplayRO.GreaterValue(value1, value2); + // Match match1 = _RegExGetNumber.Match(value1); + // Match match2 = _RegExGetNumber.Match(value2); + // if (match1.Success && match2.Success) // Compare the numeric value + // { + // double dbl1 = double.Parse(match1.ToString()); + // double dbl2 = double.Parse(match2.ToString()); + // return dbl1 > dbl2; + // } + // return String.Compare(value1, value2, true) > 0; } diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index afb3240e..cf800026 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -561,7 +561,9 @@ namespace Volian.Controls.Library tmp = new DevComponents.AdvTree.Node(); tmp.Text = chld[i].title; tmp.Tag = chld[i]; - tn.Nodes.Add(tmp); + int index = FindIndex(tn.Nodes, tmp.Text); + tn.Nodes.Insert(index, tmp); + //tn.Nodes.Add(tmp); DevComponents.AdvTree.Node sub = new DevComponents.AdvTree.Node(); sub.Text = "VLN_DUMMY_FOR_TREE"; tmp.Nodes.Add(sub); @@ -590,18 +592,19 @@ namespace Volian.Controls.Library } return index; } - private static Regex _RegExGetNumber = new Regex(@"^ *[+-]?[.,0-9]+(E[+-]?[0-9]+)?"); +// private static Regex _RegExGetNumber = new Regex(@"^ *[+-]?[.,0-9]+(E[+-]?[0-9]+)?"); private bool GreaterValue(string value1, string value2) { - Match match1 = _RegExGetNumber.Match(value1); - Match match2 = _RegExGetNumber.Match(value2); - if (match1.Success && match2.Success) // Compare the numeric value - { - double dbl1 = double.Parse(match1.ToString()); - double dbl2 = double.Parse(match2.ToString()); - return dbl1 > dbl2; - } - return String.Compare(value1, value2, true) > 0; + return DisplayRO.GreaterValue(value1, value2); + //Match match1 = _RegExGetNumber.Match(value1); + //Match match2 = _RegExGetNumber.Match(value2); + //if (match1.Success && match2.Success) // Compare the numeric value + //{ + // double dbl1 = double.Parse(match1.ToString()); + // double dbl2 = double.Parse(match2.ToString()); + // return dbl1 > dbl2; + //} + //return String.Compare(value1, value2, true) > 0; } private void cmboTreeROs_SelectedIndexChanged(object sender, EventArgs e) diff --git a/PROMS/Volian.Controls.Library/DisplayTabItem.cs b/PROMS/Volian.Controls.Library/DisplayTabItem.cs index 91e2558e..dba634b8 100644 --- a/PROMS/Volian.Controls.Library/DisplayTabItem.cs +++ b/PROMS/Volian.Controls.Library/DisplayTabItem.cs @@ -94,7 +94,7 @@ namespace Volian.Controls.Library OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure); else OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyContent.MyEntry.DocID, CheckOutType.Document); - Console.WriteLine("DisplayTabItem"); + //Console.WriteLine("DisplayTabItem"); _MyKey = myKey; _MyDisplayTabControl = myDisplayTabControl; container.Add(this);