Exemplo n.º 1
0
        /// <summary>
        /// 实收金额
        /// </summary>
        /// <param name="result"></param>
        /// <param name="list"></param>
        private CollectInfo GetActualPaid(QueryResultList <CardPaymentInfo> result)
        {
            var paid = from c in result.QueryObjects
                       group c by c.CarType into CollectGridView
                       select new { CarType = CollectGridView.Key, Count = CollectGridView.Sum(p => p.Paid) };

            CollectInfo cPaid = new CollectInfo();

            cPaid.Name = "实收金额";
            decimal total = 0;

            foreach (var cTotal in paid)
            {
                PropertyInfo paidInfo = cPaid.GetType().GetProperty(cTotal.CarType.ToString());
                paidInfo.SetValue(cPaid, (decimal)cTotal.Count, null);
                total += cTotal.Count;
            }
            cPaid.TotalMomey = total;
            return(cPaid);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 总车数
        /// </summary>
        /// <param name="result"></param>
        /// <param name="list"></param>
        private CollectInfo GetCarsAccount(QueryResultList <CardPaymentInfo> result)
        {
            var carCounts = from count in result.QueryObjects
                            group count by count.CarType into CollectGridView
                            select new { CarType = CollectGridView.Key, Count = CollectGridView.Count() };

            CollectInfo cAcccount = new CollectInfo();

            cAcccount.Name = "总车数";
            decimal total = 0;

            foreach (var cars in carCounts)
            {
                PropertyInfo carInfo = cAcccount.GetType().GetProperty(cars.CarType.ToString());
                carInfo.SetValue(cAcccount, (decimal)cars.Count, null);
                total += cars.Count;
            }
            cAcccount.TotalMomey = total;
            return(cAcccount);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 免费时段车辆数
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        private CollectInfo GetFreeTimeCars(QueryResultList <CardPaymentInfo> result)
        {
            var freeCarCounts = from freeCounts in result.QueryObjects
                                where freeCounts.Accounts == 0
                                group freeCounts by freeCounts.CarType into CollectGridView
                                select new { CarType = CollectGridView.Key, Count = CollectGridView.Count() };

            CollectInfo cAcccount = new CollectInfo();

            cAcccount.Name = "免费时段";
            decimal total = 0;

            foreach (var cars in freeCarCounts)
            {
                PropertyInfo carInfo = cAcccount.GetType().GetProperty(cars.CarType.ToString());
                carInfo.SetValue(cAcccount, (decimal)cars.Count, null);
                total += cars.Count;
            }
            cAcccount.TotalMomey = total;
            return(cAcccount);
        }