Exemplo n.º 1
0
        /// <summary>
        /// Gets the hotel comm list.
        /// 酒店详细页
        /// 酒店评论列表
        /// 分页的哦
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="take">The take.</param>
        /// <param name="total">The total.</param>
        /// <returns></returns>
        public List <iPow.Domain.Dto.Sys_HotelCommDto> GetHotelCommPageListByHotelId(int id, int pageIndex, int take, ref int total)
        {
            IQueryable <iPow.Infrastructure.Data.DataSys.Sys_HotelComm> hc = null;

            total = hotelCommRepository.GetList(e => e.HotelID == id).Count();
            hc    = hotelCommRepository.GetList(e => e.HotelID == id)
                    .OrderByDescending(e => e.AddTime)
                    .Skip((pageIndex - 1 < 0 ? pageIndex : pageIndex - 1) * take)
                    .Take(take).AsQueryable();
            return(hc.ToDto().ToList());
        }
Exemplo n.º 2
0
        public bool DeleteTrue(IList <int> idList, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser)
        {
            var res = false;

            if (idList != null && idList.Count > 0)
            {
                var delete = hotelCommRepository.GetList(e => idList.Contains(e.CommID)).ToList();
                if (delete != null && delete.Count > 0)
                {
                    res = DeleteTrue(delete, operUser);
                }
            }
            return(res);
        }
Exemplo n.º 3
0
        //版本改变,这方法不用,原来用自己的数据的时候用的,现在,用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);
        }