public override List <ProductPurchase> GetProductPurchaseList()
        {
            List <ProductPurchase> list = new List <ProductPurchase>();

            using (SqlConnection connection = this.GetSqlConnection())
            {
                int        activityReportNum = CommerceSettings.Instance.ActivityReportNum;
                SqlCommand command           = new SqlCommand("select top " + activityReportNum + " * from SuCommerce_vw_Purchases order by PurchaseDateTime desc", connection)
                {
                    CommandType = CommandType.Text
                };
                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    ProductPurchase purchase = null;
                    while (reader.Read())
                    {
                        purchase = new ProductPurchase();
                        CommerceDataProvider.PopulateProductPurchaseList(reader, purchase);
                        list.Add(purchase);
                    }
                    reader.Close();
                    connection.Close();
                }
            }
            return(list);
        }
        public override List <ProductPurchase> GetUserPurchases(int userID)
        {
            List <ProductPurchase> list = new List <ProductPurchase>();

            using (SqlConnection connection = this.GetSqlConnection())
            {
                SqlCommand command = new SqlCommand("select * from SuCommerce_vw_Purchases where userID = " + userID + " order by PurchaseDateTime desc", connection)
                {
                    CommandType = CommandType.Text
                };
                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    ProductPurchase purchase = null;
                    while (reader.Read())
                    {
                        purchase = new ProductPurchase();
                        CommerceDataProvider.PopulateProductPurchaseList(reader, purchase);
                        list.Add(purchase);
                    }
                    reader.Close();
                    connection.Close();
                }
            }
            return(list);
        }
        public override ProductPurchase GetProductPurchase(int purchaseID)
        {
            ProductPurchase purchase = new ProductPurchase();

            using (SqlConnection connection = this.GetSqlConnection())
            {
                SqlCommand command = new SqlCommand("select * from SuCommerce_vw_Purchases where purchaseID = " + purchaseID, connection)
                {
                    CommandType = CommandType.Text
                };
                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (reader.Read())
                    {
                        CommerceDataProvider.PopulateProductPurchaseList(reader, purchase);
                    }
                    reader.Close();
                    connection.Close();
                }
            }
            return(purchase);
        }