本文整理汇总了C#中LocationCollection.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# LocationCollection.Sort方法的具体用法?C# LocationCollection.Sort怎么用?C# LocationCollection.Sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocationCollection
的用法示例。
在下文中一共展示了LocationCollection.Sort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LocationsBySearch
/// <summary>
/// Return a merged set of User's Locations and Searched Locations if Merge=1
/// Else, returns Locations By City & Region
/// </summary>
/// <param name="RegionID"></param>
/// <param name="City"></param>
/// <returns></returns>
public ActionResult LocationsBySearch(int RegionID, string City, int Merge)
{
LocationCollection unionLS = new LocationCollection();
try
{
bool bMerge = Convert.ToBoolean(Merge);
List<ViewLocation> vls = new List<ViewLocation>();
LocationCollection ls = BizMgr.GetLocationsByCityRegionID(City, RegionID);
LocationCollection uls = new LocationCollection();
if (bMerge)
{
uls = BizMgr.GetLocationsBySystemUserID(this.CurrentUser.SystemUserID);
}
unionLS = LAAF.Common.Helper.Union(uls, ls, "LocationID");
string[] arrSort = new string[] { "RegionAbbrev", "City" };
unionLS.Sort(arrSort, LAAF.Common.Helper.SortDirection.Ascending);
}
catch (Exception ex)
{
LogController.LogError(ex, LogEntryType.NormalError, "", "", "SystemUserID=" + this.CurrentUser.SystemUserID.ToString(), "");
}
return PartialView("_SelectLocations", GetViewLocationsFromLocations(unionLS));
}