Пример #1
0
        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());
            }
        }
Пример #2
0
        public static List <Utility.ChargeFeePriceRangeModel> GetAllActiveChargeFeePriceRangeObjectList()
        {
            var PriceFeeRangeList = ChargeFeePriceRange.GetAllActiveChargeFeePriceRangeList();
            var rangelist         = PriceFeeRangeList.Select(p =>
            {
                decimal MinValue = 0;
                decimal.TryParse(p.MinValue, out MinValue);
                decimal MaxValue = 0;
                decimal.TryParse(p.MaxValue, out MaxValue);
                var data = new Utility.ChargeFeePriceRangeModel
                {
                    RoomFeeID = p.RoomFeeID,
                    SummaryID = p.SummaryID,
                    MinValue  = MinValue,
                    MaxValue  = MaxValue,
                    BasePrice = p.BasePrice,
                    BaseType  = p.BaseType,
                    IsActive  = p.IsActive
                };
                return(data);
            }).ToList();

            return(rangelist);
        }