private void BindReport()
        {
            DataCommand tranDataCommand = OrderDataHelper.CreateTranDataCommand();

            tranDataCommand.CommandText = "[reporting_OrderReport]";
            tranDataCommand.CommandType = CommandType.StoredProcedure;
            tranDataCommand.Parameters  = new DataParameters();
            tranDataCommand.Parameters.Add(new DataParameter("ApplicationId", (object)Mediachase.Commerce.Core.AppContext.Current.ApplicationId, DataParameterType.UniqueIdentifier));
            tranDataCommand.Parameters.Add(new DataParameter("MarketId", (object)this.MarketFilter.SelectedValue, DataParameterType.NVarChar));
            tranDataCommand.Parameters.Add(new DataParameter("CurrencyCode", (object)this.CurrencyFilter.SelectedValue, DataParameterType.NVarChar));
            tranDataCommand.Parameters.Add(new DataParameter("CommerceManagerUrl", (object)ConfigurationManager.AppSettings["SiteUrl"], DataParameterType.NVarChar));
            tranDataCommand.Parameters.Add(new DataParameter("startdate", (object)this.StartDate.Value.Date.ToUniversalTime(), DataParameterType.DateTime));
            tranDataCommand.Parameters.Add(new DataParameter("enddate", (object)this.EndDate.Value.Date.AddDays(1.0).AddSeconds(-1.0).ToUniversalTime(), DataParameterType.DateTime));
            tranDataCommand.TableMapping = DataHelper.MapTables(new string[1]
            {
                "reporting_OrderReport"
            });
            tranDataCommand.DataSet = (DataSet) new Reports();
            DataResult       dataResult       = DataService.LoadDataSet(tranDataCommand);
            ReportDataSource reportDataSource = new ReportDataSource();

            reportDataSource.Name  = "OrdersReport";
            reportDataSource.Value = (object)((Reports)dataResult.DataSet).reporting_OrderReport;


            this.MyReportViewer.LocalReport.DataSources.Clear();
            this.MyReportViewer.LocalReport.DataSources.Add(reportDataSource);
            this.MyReportViewer.LocalReport.ReportPath = this.MapPath("Reports\\OrdersByMarket.rdlc");
            this.MyReportViewer.DataBind();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Binds the report.
        /// </summary>
        private void BindReport()
        {
            DataCommand cmd = OrderDataHelper.CreateTranDataCommand();

            cmd.CommandText  = String.Format("select sum(F.SubTotal) GrossSales, sum(F.SubTotal - F.DiscountAmount) NetSales, G.BillingCurrency from OrderForm F inner join OrderFormEx FEX ON FEX.ObjectId = F.OrderFormId inner join OrderGroup G on G.OrderGroupId = F.OrderGroupId where G.Status = (select [Name] from OrderStatus OS where OrderStatusId = (select max(OrderStatusId) from OrderStatus) and OS.ApplicationId = '{0}') and G.ApplicationId = '{0}' and FEX.Created between '{1}' and '{2}' GROUP BY G.BillingCurrency;", OrderConfiguration.Instance.ApplicationId, new DateTime(DateTime.UtcNow.Year, 1, 1).ToString("s"), DateTime.UtcNow.ToString("s"));
            cmd.CommandType  = CommandType.Text;
            cmd.Parameters   = new DataParameters();
            cmd.TableMapping = DataHelper.MapTables("SalesTable");
            cmd.DataSet      = new PerfDataSet();
            DataResult results = DataService.LoadDataSet(cmd);

            cmd.CommandText  = String.Format("select sum(F.SubTotal) GrossSales, sum(F.SubTotal - F.DiscountAmount) NetSales, G.BillingCurrency, month(FEX.Created) [Month] from OrderForm F inner join OrderFormEx FEX ON FEX.ObjectId = F.OrderFormId inner join OrderGroup G on G.OrderGroupId = F.OrderGroupId where G.Status = (select [Name] from OrderStatus OS where OrderStatusId = (select max(OrderStatusId) from OrderStatus) and OS.ApplicationId = '{0}') and G.ApplicationId = '{0}' and FEX.Created between '{1}' and '{2}' GROUP BY G.BillingCurrency, month(FEX.Created);", OrderConfiguration.Instance.ApplicationId, new DateTime(DateTime.UtcNow.Year, 1, 1).ToString("s"), DateTime.UtcNow.ToString("s"));
            cmd.CommandType  = CommandType.Text;
            cmd.Parameters   = new DataParameters();
            cmd.TableMapping = DataHelper.MapTables("SalesMonthlyTable");
            cmd.DataSet      = new PerfDataSet();
            DataResult results2 = DataService.LoadDataSet(cmd);

            ReportDataSource source = new ReportDataSource();

            source.Name  = "SalesTable";
            source.Value = ((PerfDataSet)results.DataSet).SalesTable;

            ReportDataSource source2 = new ReportDataSource();

            source2.Name  = "SalesMonthlyTable";
            source2.Value = ((PerfDataSet)results2.DataSet).SalesMonthlyTable;

            PerfReportViewer.LocalReport.DataSources.Add(source);
            PerfReportViewer.LocalReport.DataSources.Add(source2);
            PerfReportViewer.DataBind();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Searches the specified search GUID.
        /// </summary>
        /// <param name="searchGuid">The search GUID.</param>
        /// <returns></returns>
        public int Search(Guid searchGuid)
        {
            DataCommand cmd = OrderDataHelper.CreateTranDataCommand();

            cmd.CommandText = String.Format("ecf_OrderSearch");
            cmd.Parameters  = new DataParameters();
            cmd.Parameters.Add(new DataParameter("ApplicationId", OrderConfiguration.Instance.ApplicationId, DataParameterType.UniqueIdentifier));
            cmd.Parameters.Add(new DataParameter("SearchSetId", searchGuid, DataParameterType.UniqueIdentifier));
            cmd.Parameters.Add(new DataParameter("SQLClause", SearchParameters.SqlWhereClause, DataParameterType.NVarChar));
            cmd.Parameters.Add(new DataParameter("MetaSQLClause", SearchParameters.SqlMetaWhereClause, DataParameterType.NVarChar));
            cmd.Parameters.Add(new DataParameter("FTSPhrase", SearchParameters.FreeTextSearchPhrase, DataParameterType.NVarChar));
            cmd.Parameters.Add(new DataParameter("AdvancedFTSPhrase", SearchParameters.AdvancedFreeTextSearchPhrase, DataParameterType.NVarChar));
            cmd.Parameters.Add(new DataParameter("OrderBy", SearchParameters.OrderByClause, DataParameterType.NVarChar));
            cmd.Parameters.Add(new DataParameter("Namespace", SearchOptions.Namespace, DataParameterType.NVarChar, 1024));
            cmd.Parameters.Add(new DataParameter("Classes", CommerceHelper.ConvertToString(SearchOptions.Classes, ","), DataParameterType.NVarChar));
            cmd.Parameters.Add(new DataParameter("StartingRec", SearchOptions.StartingRecord, DataParameterType.Int));
            cmd.Parameters.Add(new DataParameter("NumRecords", SearchOptions.RecordsToRetrieve, DataParameterType.Int));
            DataParameter param = new DataParameter("RecordCount", DataParameterType.Int);

            param.Direction = ParameterDirection.InputOutput;
            param.Value     = 0;
            cmd.Parameters.Add(param);

            DataService.ExecuteNonExec(cmd);

            return(Int32.Parse(cmd.Parameters["RecordCount"].Value.ToString()));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Binds the report.
        /// </summary>
        private void BindReport()
        {
            DataCommand cmd = OrderDataHelper.CreateTranDataCommand();

            cmd.CommandText  = String.Format("SELECT E.[Name], I.* from [Inventory] I INNER JOIN [CatalogEntry] E ON E.Code = I.SkuId INNER JOIN Catalog C ON C.CatalogId = E.CatalogId WHERE (I.InstockQuantity - I.ReservedQuantity) < 20 AND I.InventoryStatus <> 0 AND C.ApplicationId = '{0}';", OrderConfiguration.Instance.ApplicationId);
            cmd.CommandType  = CommandType.Text;
            cmd.Parameters   = new DataParameters();
            cmd.TableMapping = DataHelper.MapTables("EntryStock");
            cmd.DataSet      = new ProductDataSet();
            DataResult results = DataService.LoadDataSet(cmd);

            ReportDataSource source = new ReportDataSource();

            source.Name  = "EntryStock";
            source.Value = ((ProductDataSet)results.DataSet).EntryStock;

            MyReportViewer.LocalReport.DataSources.Add(source);
            MyReportViewer.DataBind();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Binds the report.
        /// </summary>
        private void BindReport()
        {
            DataCommand cmd = OrderDataHelper.CreateTranDataCommand();

            cmd.CommandText = "[ecf_reporting_CustomerNumOrders]";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters  = new DataParameters();
            cmd.Parameters.Add(new DataParameter("ApplicationId", CatalogConfiguration.Instance.ApplicationId, DataParameterType.UniqueIdentifier));
            cmd.Parameters.Add(new DataParameter("interval", GroupBy.SelectedValue, DataParameterType.VarChar));
            cmd.Parameters.Add(new DataParameter("startdate", StartDate.Value.ToUniversalTime(), DataParameterType.DateTime));
            cmd.Parameters.Add(new DataParameter("enddate", EndDate.Value.ToUniversalTime(), DataParameterType.DateTime));
            cmd.TableMapping = DataHelper.MapTables("CustomerNumOrdersReport");
            cmd.DataSet      = new CustomersDataSet();
            DataResult results = DataService.LoadDataSet(cmd);

            ReportDataSource source = new ReportDataSource();

            source.Name  = "CustomerNumOrdersReport";
            source.Value = ((CustomersDataSet)results.DataSet).CustomerNumOrdersReport;

            MyReportViewer.LocalReport.DataSources.Clear();
            MyReportViewer.LocalReport.DataSources.Add(source);
            MyReportViewer.DataBind();
        }