public GetRestaurantListResponse(DbOpertion.Models.Restaurant restaurant, double CoordX, double CoordY, int SeachRange) { address = restaurant.address; consumption = restaurant.consumption; discount = restaurant.discount; id = restaurant.id; if (!restaurant.images.IsNullOrEmpty()) { titleImage = ImageUrl + restaurant.images.Split('|')[0]; } else { titleImage = " "; } name = restaurant.name; phone = restaurant.phone; sales = restaurant.sales; category = restaurant.category; string[] coordinate = restaurant.coordinate.Split(','); double coordX = double.Parse(coordinate[0]); double coordY = double.Parse(coordinate[1]); var Distance = BaiduMapHelper.Instance.getDistance(CoordX, CoordY, coordX, coordY); if (Distance < SeachRange) { distance = Math.Round(Distance); } }
public GetRestaurantItemtResponse(DbOpertion.Models.Restaurant restaurant, double CoordX, double CoordY, int SeachRange, List <DataDictionary> List_DataDictionary) { address = restaurant.address; consumption = restaurant.consumption; discount = restaurant.discount; id = restaurant.id; if (!restaurant.images.IsNullOrEmpty()) { images = new ArrayList(); foreach (var item in restaurant.images.Split('|')) { images.Add(AppSetting.ImageUrl + item); } } name = restaurant.name; phone = restaurant.phone; sales = restaurant.sales; foreach (var item in List_DataDictionary) { if (restaurant.category == item.id.ToString()) { category = item.typeValue; } } string[] coordinate = restaurant.coordinate.Split(','); double coordX = double.Parse(coordinate[0]); double coordY = double.Parse(coordinate[1]); var Distance = BaiduMapHelper.Instance.getDistance(CoordX, CoordY, coordX, coordY); if (Distance < SeachRange) { distance = Math.Round(Distance); } }