//版本改变,这方法不用,原来用自己的数据的时候用的,现在,用union数据 /// <summary> /// Gets the map hotel info by tour id and day. /// </summary> /// <param name="id">The id.</param> /// <param name="day">The day.</param> /// <returns></returns> public IQueryable <Dto.MapHotelInfoDto> GetMapHotelInfoByTourIdAndDay(int id, int day) { IQueryable <Dto.MapHotelInfoDto> data = null; var trueSightList = GetSightOrHotelIdList(id, "hotel", day); var nearHotelList = hotelPropertyInfoRepository.GetList(e => trueSightList.Contains(e.ID)) .Select(e => e.CirHotelID); List <int?> hotelIdList = new List <int?>(); if (nearHotelList != null && nearHotelList.Count() > 0) { string[] array = null; foreach (var item in nearHotelList) { array = item.Split(','); if (array.Length > 0) { for (int i = 0; i < array.Length; i++) { if (!string.IsNullOrEmpty(array[i])) { try { hotelIdList.Add(int.Parse(array[i])); } catch { continue; } } } } } } hotelIdList.AddRange(trueSightList); data = hotelPropertyInfoRepository.GetList(e => hotelIdList.Contains(e.ID)) .Select(e => new Dto.MapHotelInfoDto { Name = e.HotelName, Address = e.Address, Type = e.HotelClass, Lat = e.latitude, Long = e.longitude, CommCount = hotelCommRepository.GetList(d => d.HotelID == e.ID).Count(), HotelId = e.HotelID, IdentityId = e.ID, MinPrice = e.MinPrice == null ? 0 : e.MinPrice, PicCount = hotelPicRepository.GetList(d => d.HotelID == e.HotelID).Count() }).AsQueryable(); return(data); }
public bool DeleteTrue(IList <int> idList, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser) { var res = false; if (idList != null && idList.Count > 0) { var delete = hotelPicRepository.GetList(e => idList.Contains(e.PicID)).ToList(); if (delete != null && delete.Count > 0) { res = DeleteTrue(delete, operUser); } } return(res); }