Merge pull request #649 from agimofcarmen/CA-181316

CA-181316: Sort by description is now working correctly.
This commit is contained in:
Mihaela Stoica 2015-09-04 12:17:52 +01:00
commit 7d750dd080
2 changed files with 11 additions and 1 deletions

View File

@ -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();

View File

@ -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);