private static ChargePriceRange[] GetPriceRangeList() { if (PriceRangeList == null) { PriceRangeList = ChargePriceRange.GetChargePriceRangeList(); } return(PriceRangeList); }
private static ChargePriceRange[] GetPriceRangeList(ViewImportFeeDetail2 self) { var list = new List <ChargePriceRange>(); if (PriceRangeList == null || PriceRangeList.Length == 0) { PriceRangeList = ChargePriceRange.GetChargePriceRangeList(); } if (PriceFeeRangeList == null) { PriceFeeRangeList = ChargeFeePriceRange.GetAllActiveChargeFeePriceRangeList(); } if (self.RoomFeeID > 0) { if (PriceFeeRangeList != null && PriceFeeRangeList.Length > 0) { var my_pricefee_list = PriceFeeRangeList.Where(p => p.RoomFeeID == self.RoomFeeID && p.SummaryID == self.ChargeID).ToArray(); foreach (var item in my_pricefee_list) { var data = new ChargePriceRange(); data.SummaryID = item.SummaryID; data.MinValue = item.MinValue; data.MaxValue = item.MaxValue; data.BasePrice = item.BasePrice; data.BaseType = item.BaseType; data.IsActive = item.IsActive; list.Add(data); } } return(list.OrderBy(p => { decimal minvalue = 0; decimal.TryParse(p.MinValue, out minvalue); return minvalue; }).ToArray()); } else { if (PriceRangeList != null && PriceRangeList.Length > 0) { list = PriceRangeList.Where(p => p.SummaryID == self.ChargeID).OrderBy(p => { decimal minvalue = 0; decimal.TryParse(p.MinValue, out minvalue); return(minvalue); }).ToList(); } return(list.ToArray()); } }