Esempio n. 1
0
        public Dictionary <OrderStatus, int> GetOrderCountForAllStatus(DateTime startDate, DateTime endDate)
        {
            var returnDict = new Dictionary <OrderStatus, int>();
            var query      = new SQLQuery(SQLCountOrderAllStatusByDate, SQLQueryType.DataReader);

            query.ProcessRow = new Func <DbDataReader, bool>(dr =>
            {
                returnDict.Add((OrderStatus)(int)dr["Status"], (int)dr["count"]);
                return(true);
            });
            query.Parameters.Add("StartDate", startDate);
            query.Parameters.Add("EndDate", endDate);
            queryRunner.RunQuery(query);
            return(returnDict);
        }