public Dictionary <string, object> Sorting(string action, string sortedHeaders, string currentReport)
 {
     htmlHelper.PopulateData(currentReport);
     dict = htmlHelper.GetJsonData(action, ProductSales.GetSalesData(), sortedHeaders);
     return(dict);
 }
 public Dictionary <string, object> CalculatedField(string action, string headerTag, string currentReport)
 {
     htmlHelper.PopulateData(currentReport);
     dict = htmlHelper.GetJsonData(action, ProductSales.GetSalesData(), null, headerTag);
     return(dict);
 }
 public Dictionary <string, object> InitializeGrid(string action)
 {
     htmlHelper.PivotReport = BindDefaultData();
     dict = htmlHelper.GetJsonData(action, ProductSales.GetSalesData());
     return(dict);
 }
 public Dictionary <string, object> NodeDropped(string action, string dropAxis, string headerTag, string sortedHeaders, string filterParams, string currentReport)
 {
     htmlHelper.PopulateData(currentReport);
     dict = htmlHelper.GetJsonData(action, ProductSales.GetSalesData(), dropAxis, headerTag, filterParams, sortedHeaders);
     return(dict);
 }
 public Dictionary <string, object> CellEditing(string action, string index, string valueHeaders, string summaryValues, string currentReport)
 {
     htmlHelper.PopulateData(currentReport);
     dict = htmlHelper.GetJsonData(action, ProductSales.GetSalesData(), index, summaryValues, valueHeaders);
     return(dict);
 }
        public static ProductSalesCollection GetSalesData()
        {
            /// Geography
            string[] countries     = new string[] { "Australia", "Canada", "France", "Germany", "United Kingdom", "United States" };
            string[] ausStates     = new string[] { "New South Wales", "Queensland", "South Australia", "Tasmania", "Victoria" };
            string[] canadaStates  = new string[] { "Alberta", "British Columbia", "Brunswick", "Manitoba", "Ontario", "Quebec" };
            string[] franceStates  = new string[] { "Charente-Maritime", "Essonne", "Garonne (Haute)", "Gers", };
            string[] germanyStates = new string[] { "Bayern", "Brandenburg", "Hamburg", "Hessen", "Nordrhein-Westfalen", "Saarland" };
            string[] ukStates      = new string[] { "England" };
            string[] ussStates     = new string[] { "New York", "North Carolina", "Alabama", "California", "Colorado", "New Mexico", "South Carolina" };

            /// Time
            string[] dates = new string[] { "FY 2005", "FY 2006", "FY 2007", "FY 2008", "FY 2009" };

            /// Products
            string[] products = new string[] { "Bike", "Van", "Car" };
            Random   r        = new Random(123345345);

            int numberOfRecords = 2000;
            ProductSalesCollection listOfProductSales = new ProductSalesCollection();

            for (int i = 0; i < numberOfRecords; i++)
            {
                ProductSales sales = new ProductSales();
                sales.Country  = countries[r.Next(1, countries.GetLength(0))];
                sales.Quantity = r.Next(1, 12);
                /// 1 percent discount for 1 quantity
                double discount = (30000 * sales.Quantity) * (double.Parse(sales.Quantity.ToString()) / 100);
                sales.Amount  = (30000 * sales.Quantity) - discount;
                sales.Date    = dates[r.Next(r.Next(dates.GetLength(0) + 1))];
                sales.Product = products[r.Next(r.Next(products.GetLength(0) + 1))];
                switch (sales.Product)
                {
                case "Car":
                {
                    sales.Date = "FY 2005";
                    break;
                }
                }
                switch (sales.Country)
                {
                case "Australia":
                {
                    sales.State = ausStates[r.Next(ausStates.GetLength(0))];
                    break;
                }

                case "Canada":
                {
                    sales.State = canadaStates[r.Next(canadaStates.GetLength(0))];
                    break;
                }

                case "France":
                {
                    sales.State = franceStates[r.Next(franceStates.GetLength(0))];
                    break;
                }

                case "Germany":
                {
                    sales.State = germanyStates[r.Next(germanyStates.GetLength(0))];
                    break;
                }

                case "United Kingdom":
                {
                    sales.State = ukStates[r.Next(ukStates.GetLength(0))];
                    break;
                }

                case "United States":
                {
                    sales.State = ussStates[r.Next(ussStates.GetLength(0))];
                    break;
                }
                }
                listOfProductSales.Add(sales);
            }

            return(listOfProductSales);
        }
Beispiel #7
0
 public Dictionary <string, object> ToolbarOperations(string action, string args)
 {
     return(pivotClient.GetJsonData(action, ProductSales.GetSalesData(), args));
 }
 public Dictionary <string, object> DeferUpdate(string action, string filterParams, string sortedHeaders, string currentReport)
 {
     htmlHelper.PopulateData(currentReport);
     dict = htmlHelper.GetJsonData(action, ProductSales.GetSalesData(), null, null, null, sortedHeaders, filterParams);
     return(dict);
 }
Beispiel #9
0
 public Dictionary <string, object> NodeDropped(string action, string args)
 {
     return(pivotClient.GetJsonData(action, ProductSales.GetSalesData(), args));
 }
Beispiel #10
0
 public Dictionary <string, object> ValueSorting(string action, string valueSorting, string currentReport, string customObject)
 {
     pivotClient.PopulateData(currentReport);
     return(pivotClient.GetJsonData(action, ProductSales.GetSalesData(), valueSorting));
 }
Beispiel #11
0
 public Dictionary <string, object> Filtering(string action, string filterParams, string currentReport, string customObject)
 {
     pivotClient.PopulateData(currentReport);
     return(pivotClient.GetJsonData(action, ProductSales.GetSalesData(), filterParams));
 }
Beispiel #12
0
 public Dictionary <string, object> FetchMembers(string action, string currentReport, string customObject, string headerTag)
 {
     pivotClient.PopulateData(currentReport);
     return(pivotClient.GetJsonData(action, ProductSales.GetSalesData(), headerTag));
 }
Beispiel #13
0
 public Dictionary <string, object> InitializeClient(string action, string clientParams)
 {
     this.BindData();
     return(pivotClient.GetJsonData(action, ProductSales.GetSalesData(), clientParams));
 }