Beispiel #1
0
        public OrderStatisticsInfo GetUserOrders(OrderQuery userOrder)
        {
            OrderStatisticsInfo orderStatisticsInfo = new OrderStatisticsInfo();

            System.Data.Common.DbCommand storedProcCommand = this.database.GetStoredProcCommand("cp_OrderStatistics_Get");
            this.database.AddInParameter(storedProcCommand, "PageIndex", System.Data.DbType.Int32, userOrder.PageIndex);
            this.database.AddInParameter(storedProcCommand, "PageSize", System.Data.DbType.Int32, userOrder.PageSize);
            this.database.AddInParameter(storedProcCommand, "IsCount", System.Data.DbType.Boolean, userOrder.IsCount);
            this.database.AddInParameter(storedProcCommand, "sqlPopulate", System.Data.DbType.String, SaleStatisticDao.BuildUserOrderQuery(userOrder));
            this.database.AddOutParameter(storedProcCommand, "TotalUserOrders", System.Data.DbType.Int32, 4);
            using (System.Data.IDataReader dataReader = this.database.ExecuteReader(storedProcCommand))
            {
                orderStatisticsInfo.OrderTbl = DataHelper.ConverDataReaderToDataTable(dataReader);
                if (dataReader.NextResult())
                {
                    dataReader.Read();
                    if (dataReader["OrderTotal"] != DBNull.Value)
                    {
                        orderStatisticsInfo.TotalOfPage += (decimal)dataReader["OrderTotal"];
                    }
                    if (dataReader["Profits"] != DBNull.Value)
                    {
                        orderStatisticsInfo.ProfitsOfPage += (decimal)dataReader["Profits"];
                    }
                }
                if (dataReader.NextResult())
                {
                    dataReader.Read();
                    if (dataReader["OrderTotal"] != DBNull.Value)
                    {
                        orderStatisticsInfo.TotalOfSearch += (decimal)dataReader["OrderTotal"];
                    }
                    if (dataReader["Profits"] != DBNull.Value)
                    {
                        orderStatisticsInfo.ProfitsOfSearch += (decimal)dataReader["Profits"];
                    }
                }
            }
            orderStatisticsInfo.TotalCount = (int)this.database.GetParameterValue(storedProcCommand, "TotaluserOrders");
            return(orderStatisticsInfo);
        }
Beispiel #2
0
 public System.Data.DataTable GetMemberStatisticsNoPage(SaleStatisticsQuery query)
 {
     System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand(SaleStatisticDao.BuildMemberStatisticsQuery(query));
     System.Data.DataTable        result           = null;
     using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
     {
         result = DataHelper.ConverDataReaderToDataTable(dataReader);
     }
     return(result);
 }
Beispiel #3
0
 public System.Data.DataTable GetProductSalesNoPage(SaleStatisticsQuery productSale, out int totalProductSales)
 {
     System.Data.Common.DbCommand storedProcCommand = this.database.GetStoredProcCommand("cp_ProductSalesNoPage_Get");
     this.database.AddInParameter(storedProcCommand, "sqlPopulate", System.Data.DbType.String, SaleStatisticDao.BuildProductSaleQuery(productSale));
     this.database.AddOutParameter(storedProcCommand, "TotalProductSales", System.Data.DbType.Int32, 4);
     System.Data.DataTable result = null;
     using (System.Data.IDataReader dataReader = this.database.ExecuteReader(storedProcCommand))
     {
         result = DataHelper.ConverDataReaderToDataTable(dataReader);
     }
     totalProductSales = (int)this.database.GetParameterValue(storedProcCommand, "TotalProductSales");
     return(result);
 }
Beispiel #4
0
 public System.Data.DataTable GetMemberStatistics(SaleStatisticsQuery query, out int totalProductSales)
 {
     System.Data.Common.DbCommand storedProcCommand = this.database.GetStoredProcCommand("cp_MemberStatistics_Get");
     this.database.AddInParameter(storedProcCommand, "PageIndex", System.Data.DbType.Int32, query.PageIndex);
     this.database.AddInParameter(storedProcCommand, "PageSize", System.Data.DbType.Int32, query.PageSize);
     this.database.AddInParameter(storedProcCommand, "IsCount", System.Data.DbType.Boolean, query.IsCount);
     this.database.AddInParameter(storedProcCommand, "sqlPopulate", System.Data.DbType.String, SaleStatisticDao.BuildMemberStatisticsQuery(query));
     this.database.AddOutParameter(storedProcCommand, "TotalProductSales", System.Data.DbType.Int32, 4);
     System.Data.DataTable result = null;
     using (System.Data.IDataReader dataReader = this.database.ExecuteReader(storedProcCommand))
     {
         result = DataHelper.ConverDataReaderToDataTable(dataReader);
     }
     totalProductSales = (int)this.database.GetParameterValue(storedProcCommand, "TotalProductSales");
     return(result);
 }