/// <summary>
 /// Gets a page of data from the cy_CommerceReport table.
 /// </summary>
 /// <param name="pageNumber">The page number.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <param name="totalPages">total pages</param>
 public static IDataReader GetUserItemPageBySite(
     Guid siteGuid,
     int pageNumber,
     int pageSize,
     out int totalPages)
 {
     return(DBCommerceReport.GetUserItemPageBySite(siteGuid, pageNumber, pageSize, out totalPages));
 }
        public static DataTable GetSalesByYearMonthByUser(Guid userGuid)
        {
            DataTable   dataTable = GetYearMonthEmptyTable();
            IDataReader reader    = DBCommerceReport.GetSalesByYearMonthByUser(userGuid);

            PopulateYearMonthTableFromReader(reader, dataTable);
            return(dataTable);
        }
 /// <summary>
 /// Gets a page of data from the cy_CommerceReport table.
 /// </summary>
 /// <param name="pageNumber">The page number.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <param name="totalPages">total pages</param>
 public static IDataReader GetItemsPageByModule(
     Guid moduleGuid,
     int pageNumber,
     int pageSize,
     out int totalPages)
 {
     return(DBCommerceReport.GetItemsPageByModule(moduleGuid, pageNumber, pageSize, out totalPages));
 }
Example #4
0
        public static DataTable GetSalesByYearByModule(Guid moduleGuid)
        {
            DataTable   dataTable = GetYearEmptyTable();
            IDataReader reader    = DBCommerceReport.GetSalesByYearByModule(moduleGuid);

            PopulateYearTableFromReader(reader, dataTable);
            return(dataTable);
        }
Example #5
0
 /// <summary>
 /// Inserts a row in the mp_CommerceReportOrders table. Returns rows affected count.
 /// </summary>
 public static int CreateOrder(
     Guid rowGuid,
     Guid siteGuid,
     Guid featureGuid,
     Guid moduleGuid,
     Guid userGuid,
     Guid orderGuid,
     string billingFirstName,
     string billingLastName,
     string billingCompany,
     string billingAddress1,
     string billingAddress2,
     string billingSuburb,
     string billingCity,
     string billingPostalCode,
     string billingState,
     string billingCountry,
     string paymentMethod,
     decimal subTotal,
     decimal taxTotal,
     decimal shippingTotal,
     decimal orderTotal,
     DateTime orderDateUtc,
     string adminOrderLink,
     string userOrderLink,
     DateTime rowCreatedUtc,
     bool includeInAggregate)
 {
     return(DBCommerceReport.CreateOrder(
                rowGuid,
                siteGuid,
                featureGuid,
                moduleGuid,
                userGuid,
                orderGuid,
                billingFirstName,
                billingLastName,
                billingCompany,
                billingAddress1,
                billingAddress2,
                billingSuburb,
                billingCity,
                billingPostalCode,
                billingState,
                billingCountry,
                paymentMethod,
                subTotal,
                taxTotal,
                shippingTotal,
                orderTotal,
                orderDateUtc,
                adminOrderLink,
                userOrderLink,
                rowCreatedUtc,
                includeInAggregate));
 }
        public static DataTable GetItemRevenueByModule(Guid moduleGuid)
        {
            DataTable dataTable = GetItemRevenueEmptyTable();

            using (IDataReader reader = DBCommerceReport.GetItemRevenueByModule(moduleGuid))
            {
                PopulateItemRevenueTableFromReader(reader, dataTable);
            }
            return(dataTable);
        }
Example #7
0
        public static CommerceReportItem GetByGuid(Guid itemGuid)
        {
            CommerceReportItem item = new CommerceReportItem();

            using (IDataReader reader = DBCommerceReport.GetItemSummary(itemGuid))
            {
                if (reader.Read())
                {
                    item.itemGuid     = new Guid(reader["ItemGuid"].ToString());
                    item.moduleGuid   = new Guid(reader["ModuleGuid"].ToString());
                    item.siteGuid     = new Guid(reader["SiteGuid"].ToString());
                    item.itemName     = reader["ItemName"].ToString();
                    item.moduleTitle  = reader["ModuleTitle"].ToString();
                    item.totalRevenue = Convert.ToDecimal(reader["Revenue"]);
                }
            }

            return(item);
        }
Example #8
0
 /// <summary>
 /// Inserts a row in the mp_CommerceReport table. Returns rows affected count.
 /// </summary>
 public static void AddRow(
     Guid rowGuid,
     Guid siteGuid,
     Guid userGuid,
     Guid featureGuid,
     Guid moduleGuid,
     string moduleTitle,
     Guid orderGuid,
     Guid itemGuid,
     string itemName,
     int quantity,
     decimal price,
     decimal subTotal,
     DateTime orderDateUtc,
     string paymentMethod,
     string iPAddress,
     string adminOrderLink,
     string userOrderLink,
     bool includeInAggregate)
 {
     DBCommerceReport.Create(
         rowGuid,
         siteGuid,
         userGuid,
         featureGuid,
         moduleGuid,
         moduleTitle,
         orderGuid,
         itemGuid,
         itemName,
         quantity,
         price,
         subTotal,
         orderDateUtc,
         paymentMethod,
         iPAddress,
         adminOrderLink,
         userOrderLink,
         DateTime.UtcNow,
         includeInAggregate);
 }
 /// <summary>
 /// Deletes an instance of CommerceReport. Returns true on success.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 /// <returns>bool</returns>
 public static bool Delete(Guid rowGuid)
 {
     return(DBCommerceReport.Delete(rowGuid));
 }
 /// <summary>
 /// Deletes a row from the cy_CommerceReportOrders table. Returns true if row deleted.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 /// <returns>bool</returns>
 public static bool DeleteOrder(Guid orderGuid)
 {
     DBCommerceReport.DeleteOrdersByOrder(orderGuid);
     return(DBCommerceReport.DeleteByOrder(orderGuid));
 }
 /// <summary>
 /// Deletes a row from the cy_CommerceReport table. Returns true if row deleted.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 /// <returns>bool</returns>
 public static bool DeleteByModule(Guid moduleGuid)
 {
     DBCommerceReport.DeleteOrdersByModule(moduleGuid);
     return(DBCommerceReport.DeleteByModule(moduleGuid));
 }
 public static IDataReader GetSalesGroupedByUser(Guid siteGuid)
 {
     return(DBCommerceReport.GetSalesGroupedByUser(siteGuid));
 }
 public static decimal GetAllTimeRevenueByModule(Guid moduleGuid)
 {
     return(DBCommerceReport.GetAllTimeRevenueByModule(moduleGuid));
 }
 public static decimal GetAllTimeRevenueBySite(Guid siteGuid)
 {
     return(DBCommerceReport.GetAllTimeRevenueBySite(siteGuid));
 }
 /// <summary>
 /// Deletes rows from the cy_CommerceReport table. Returns true if row deleted.
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 /// <returns>bool</returns>
 public static bool DeleteBySite(Guid siteGuid)
 {
     return(DBCommerceReport.DeleteBySite(siteGuid));
 }
Example #16
0
 public static bool MoveOrder(
     Guid orderGuid,
     Guid newUserGuid)
 {
     return(DBCommerceReport.MoveOrder(orderGuid, newUserGuid));
 }