public bool Delete(IList <int> idList, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser) { var res = false; if (idList != null && idList.Count > 0) { var delete = sightInfoSortRepository.GetList(e => idList.Contains(e.Id)).ToList(); if (delete != null && delete.Count > 0) { res = Delete(delete, operUser); } } return(res); }
/// <summary> /// Adds the sort sight info by city. /// 根据城市添加,要排序的城市不为0的景区 /// 这个的优级和省的优做级一样 /// sourceInfo 根据城市选出来的景区 /// aim 要添加排名的景区 /// </summary> /// <param name="sourceInfo">The source info.</param> /// <param name="city">The city.</param> /// <param name="pi">Index of the page.</param> /// <param name="take">Size of the page.</param> public int AddSortSightInfoByCity(List <DefaultSightInfoDto> sourceInfo, string city, int pi, int take) { var citySortSightInfoList = sightInfoSortRepository.GetList(e => e.Target.Contains(city) && e.Type == 1).OrderBy(e => e.SortNum); foreach (var item in citySortSightInfoList) { var temp = sightInfoRepository.GetList(e => e.ParkID == item.SightId); var newTemp = SelectSightInfo(temp).FirstOrDefault(); if (sourceInfo.Contains(newTemp)) { sourceInfo.Remove(newTemp); } AddSortBase(sourceInfo, newTemp, (int)item.SortNum, pi, take); } return(citySortSightInfoList.Count()); }
/// <summary> /// Adds the global to top class. /// </summary> /// <param name="source">The source.</param> /// <returns></returns> public List <TopClassDto> AddGlobalToTopClass(List <TopClassDto> source) { var globalSightIdList = sightInfoSortRepository.GetList(e => e.Type == 3).Select(e => e.SightId); var temp = (from e in sightInfoRepository.GetList() where globalSightIdList.Contains(e.ParkID) && e.IsDelete == 0 orderby e.ParkID descending group e by e.ClassID into g select new TopClassDto { count = g.Count(), name = (from s in sightClassRepository.GetList() where s.ClassID == g.Key select s).FirstOrDefault().ClassName, Type = g.Key }).ToList(); return(UpdateTopClassTwo(source, temp)); }
public bool SightIsInSort(int id) { var res = sightSortRepository.GetList(e => e.SightId == id).Any(); return(res); }