Beispiel #1
0
 private static ChargePriceRange[] GetPriceRangeList()
 {
     if (PriceRangeList == null)
     {
         PriceRangeList = ChargePriceRange.GetChargePriceRangeList();
     }
     return(PriceRangeList);
 }
Beispiel #2
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());
            }
        }
Beispiel #3
0
        public static Ui.DataGrid GetChargePriceRangeGridBySummaryID(int SummaryID, string orderBy, long startRowIndex, int pageSize)
        {
            long totalRows = 0;
            List <SqlParameter> parameters = new List <SqlParameter>();
            List <string>       conditions = new List <string>();

            conditions.Add("[SummaryID]=@SummaryID");
            parameters.Add(new SqlParameter("@SummaryID", SummaryID));
            string fieldList = "[ChargePriceRange].* ";
            string Statement = " from [ChargePriceRange] where  " + string.Join(" and ", conditions.ToArray());

            ChargePriceRange[] list = new ChargePriceRange[] { };
            list = GetList <ChargePriceRange>(fieldList, Statement, parameters, orderBy, startRowIndex, pageSize, out totalRows).ToArray();
            DataAccess.Ui.DataGrid dg = new Ui.DataGrid();
            dg.rows  = list;
            dg.total = totalRows;
            dg.page  = pageSize;
            return(dg);
        }