コード例 #1
0
 /// <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));
 }