private List<MVTour> CheckTourType(IList<TourXML> Tours) { List<MVTour> TourInfos = new List<MVTour>(); //XML����Tour���� for (int i = 0; i < Tours.Count; i++) { MVTour tour = new MVTour(); tour.Name = Tours[i].Name; tour.CNName = Tours[i].CNName; tour.Image = Tours[i].Image; tour.Code = string.Empty; tour.TourArea = Tours[i].TourArea; //ÿ��Tour���������ij��� foreach (string city in Tours[i].Citys) { for (int index = 0; index < tourMerchandise.Items.Count; index++) { if (((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).StartCity.Code.Equals(city) && ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).EndCity != null && ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).EndCity.Country != null) { if (ExceptionViewCode(((TourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).Code)) { tour.Tours.Add((TourMaterial)tourMerchandise.Items[index]); } } } } tour.Tours.Sort(delegate(TourMaterial t1, TourMaterial t2) { return ((Terms.Product.Business.MVTourProfile)t1.Profile).StartFromLandOnlyFare.CompareTo(((Terms.Product.Business.MVTourProfile)t2.Profile).StartFromLandOnlyFare); }); TourInfos.Add(tour); } return TourInfos; }
private List<MVTour> CheckTourType() { List<MVTour> TourInfos = new List<MVTour>(); //XML配置Tour类型 for (int i = 0; i < TourXml.Count; i++) { MVTour tour = new MVTour(); tour.Name = TourXml[i].Name; tour.CNName = TourXml[i].CNName; tour.Image = TourXml[i].Image; tour.Code = string.Empty; tour.TourArea = TourXml[i].TourArea; //每种Tour下所包括的城市 foreach (string city in TourXml[i].Citys) { try { for (int index = 0; index < tourMerchandise.Items.Count; index++) { if (((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).StartCity.Code.Equals(city) && ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).EndCity != null && ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).EndCity.Country != null) { if (ExceptionViewCode(((TourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).Code)) { tour.Tours.Add((TourMaterial)tourMerchandise.Items[index]); } } } } catch { MVMerchandisePool.ResetTour(); Response.Redirect("~/TourIndex.aspx?tab=T"); } } //tour.Tours.Sort(); tour.Tours.Sort(delegate(TourMaterial t1, TourMaterial t2) { return ((Terms.Product.Business.MVTourProfile)t1.Profile).StartFromMinFare.CompareTo(((Terms.Product.Business.MVTourProfile)t2.Profile).StartFromMinFare); }); if (tour.Tours.Count > 3) tour.Tours.RemoveRange(3, tour.Tours.Count - 3); TourInfos.Add(tour); } return TourInfos; }