mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
Merge pull request #649 from agimofcarmen/CA-181316
CA-181316: Sort by description is now working correctly.
This commit is contained in:
commit
7d750dd080
@ -216,7 +216,7 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
else if (dataGridViewPatches.SortedColumn.Index == ColumnDate.Index)
|
||||
updates.Sort(Alert.CompareOnDate);
|
||||
else if (dataGridViewPatches.SortedColumn.Index == ColumnDescription.Index)
|
||||
updates.Sort(Alert.CompareOnAppliesTo);
|
||||
updates.Sort(Alert.CompareOnDescription);
|
||||
|
||||
if (dataGridViewPatches.SortOrder == SortOrder.Descending)
|
||||
updates.Reverse();
|
||||
|
@ -308,6 +308,16 @@ namespace XenAdmin.Alerts
|
||||
return sortResult;
|
||||
}
|
||||
|
||||
public static int CompareOnDescription(Alert alert1, Alert alert2)
|
||||
{
|
||||
int sortResult = string.Compare(alert1.Description, alert2.Description);
|
||||
if (sortResult == 0)
|
||||
sortResult = string.Compare(alert1.Name, alert2.Name);
|
||||
if (sortResult == 0)
|
||||
sortResult = string.Compare(alert1.uuid, alert2.uuid);
|
||||
return sortResult;
|
||||
}
|
||||
|
||||
public static int CompareOnName(Alert alert1, Alert alert2)
|
||||
{
|
||||
int sortResult = string.Compare(alert1.Name, alert2.Name);
|
||||
|
Loading…
Reference in New Issue
Block a user