public ActionResult CountrySearch([C1JsonRequest] CollectionViewRequest <Country> requestData)
        {
            countrylist  = GetCountriesForMultiColumnComboBox();
            ncountrylist = countrylist.ToList();
            IEnumerable <Country> selectedcountryList = ncountrylist;

            if (requestData.ExtraRequestData.Count > 0)
            {
                var query = requestData.ExtraRequestData["AutoCompleteQuery"] as string;

                if (query != null && query != "")
                {
                    var names = query.Split(',');
                    selectedcountryList = countrylist.Where(item => names.Any(n => item.CountryName.IndexOf(n, StringComparison.OrdinalIgnoreCase) >= 0));
                }
            }
            // Delay result
            System.Threading.Thread.Sleep(50);
            var resultList = selectedcountryList.Select(item => new Country
            {
                CountryName      = item.CountryName,
                CountryShortName = item.CountryShortName,
                CountryCode      = item.CountryCode
            });

            return(this.C1Json(CollectionViewHelper.Read(requestData, resultList)));
        }
        public ActionResult GetProducts()
        {
            var strType = HttpContext.Request["productType"];
            var type    = !string.IsNullOrEmpty(strType) ? Convert.ToInt32(strType) : 0;

            return(this.C1Json(CollectionViewHelper.Read(new CollectionViewRequest <ProductItem>(), DataService.GetProductItemList((CategoryType)type))));
        }
Exemple #3
0
        public ActionResult RemoteBindCustomerSale_Read([C1JsonRequest] CollectionViewRequest <Sale> requestData)
        {
            return(this.C1Json(CollectionViewHelper.Read(requestData, SALES, (col) =>
            {
                if (col.Binding == "Country")
                {
                    return CustomerSale.NAMEDCOUNTRIES;
                }

                if (col.Binding == "Product")
                {
                    return CustomerSale.PRODUCTS;
                }

                if (col.Binding == "Color")
                {
                    return CustomerSale.COLORS;
                }

                if (col.Binding == "Rank")
                {
                    return CustomerSale.RANKS;
                }

                return null;
            })));
        }
Exemple #4
0
        public ActionResult ShowCase_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
        {
            var extraData = requestData.ExtraRequestData
                            .ToDictionary(kvp => kvp.Key, kvp => new StringValues(kvp.Value.ToString()));
            var data = new FormCollection(extraData);

            _showcaseOption.LoadPostData(data);
            model = Sale.GetData(getDataSize()).Select(x => SaleShowCase.FromSale(x)).ToList();
            return(this.C1Json(CollectionViewHelper.Read(requestData, model)));
        }
        public ActionResult GetProducts()
        {
#if ASPNETCORE
            string strType = this.HttpContext.Request.Query["productType"];
#else
            string strType = this.HttpContext.Request["productType"];
#endif
            int type = !string.IsNullOrEmpty(strType) ? Convert.ToInt32(strType) : 0;

            return(this.C1Json(CollectionViewHelper.Read(new CollectionViewRequest <ProductItem>(), DataService.GetProductItemList((CategoryType)type))));
        }
Exemple #6
0
        public ActionResult GetTasks()
        {
            UpdateDateRange();
            var strType = HttpContext.Request["taskType"];
            var type    = !string.IsNullOrEmpty(strType) ? Convert.ToInt32(strType) : 0;
            var respone = new ArrayList();

            respone.Add(CollectionViewHelper.Read(new CollectionViewRequest <CampainTaskItem>(), DataService.GetTaskItem((CampainTaskType)type)));

            return(this.C1Json(respone));
        }
        public ActionResult OnPostBind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
        {
            var extraData = requestData.ExtraRequestData
                            .ToDictionary(kvp => kvp.Key, kvp => new StringValues(kvp.Value.ToString()));
            var data = new FormCollection(extraData);

            _gridDataModel.LoadPostData(data);
            var model = Sale.GetData(Convert.ToInt32(_gridDataModel.Options["items"].CurrentValue));

            return(JsonConvertHelper.C1Json(CollectionViewHelper.Read(requestData, model)));
        }
Exemple #8
0
        public ActionResult ColumnPinning_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
        {
            var extraData = requestData.ExtraRequestData
                            .ToDictionary(kvp => kvp.Key, kvp => new StringValues(kvp.Value.ToString()));
            var data = new FormCollection(extraData);

            _columnPinningDataModel.LoadPostData(data);
            var model = Sale.GetData(500);

            return(this.C1Json(CollectionViewHelper.Read(requestData, model)));
        }
Exemple #9
0
        public ActionResult Sorting_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
        {
            var extraData = requestData.ExtraRequestData
                            .ToDictionary(kvp => kvp.Key, kvp => new StringValues(kvp.Value.ToString()));
            var data = new FormCollection(extraData);

            _optionsModel.LoadPostData(data);
            var model   = Sale.GetData(10).ToList();
            var nullObj = new Sale {
            };

            model.Add(nullObj);
            return(this.C1Json(CollectionViewHelper.Read(requestData, model)));
        }
Exemple #10
0
        public ActionResult GetAnalysisData()
        {
            this.UpdateDateRange();

            ArrayList respone = new ArrayList();
            List <ProductsWiseSaleItem> categoryRegionSale = DataService.GetCategoryRegionWiseSales();

            respone.Add(CollectionViewHelper.Read <ProductsWiseSaleItem>(new CollectionViewRequest <ProductsWiseSaleItem>(), categoryRegionSale));

            var opportunities = DataService.OpportunityItemList;

            respone.Add(CollectionViewHelper.Read <Opportunity>(new CollectionViewRequest <Opportunity>(), opportunities));

            return(this.C1Json(respone));
        }
        public ActionResult PreserveWhiteSpace_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
        {
            var extraData = requestData.ExtraRequestData
                            .ToDictionary(kvp => kvp.Key, kvp => new StringValues(kvp.Value.ToString()));
            var data = new FormCollection(extraData);

            _columnPinningDataModel.LoadPostData(data);
            var model = Sale.GetData(50).ToList();

            model.ForEach(x => {
                if (x.Color.Equals("Black") || x.Color.Equals("White"))
                {
                    x.Color = string.Format("       {0} ", x.Color);
                }
            });
            return(this.C1Json(CollectionViewHelper.Read(requestData, model)));
        }
        //Get Portfolio
        public ActionResult GetPortfolio([C1JsonRequest] CollectionViewRequest <PortfolioStatic.Portfolio> requestData)
        {
            //To check if new Symbol has been requested, add the new symbol and return portfolio else return original portfolio
            const string stockNamesKey = "stockNames";

            if (requestData.ExtraRequestData != null && requestData.ExtraRequestData.ContainsKey(stockNamesKey))
            {
                var stockNameString = requestData.ExtraRequestData[stockNamesKey] as string;
                if (!string.IsNullOrEmpty(stockNameString))
                {
                    var    stockNames  = stockNameString.Split(',').ToList();
                    string SymbolToAdd = stockNames[stockNames.Count - 1];
                    PortfolioStatic.AddToPortfolioList(SymbolToAdd);
                }
            }

            return(this.C1Json(CollectionViewHelper.Read(requestData, PortfolioModel.PortfolioList)));
        }
        public ActionResult RemoteBindCustomerSale_Read([C1JsonRequest] CollectionViewRequest <Sale> requestData)
        {
            return(this.C1Json(CollectionViewHelper.Read(requestData, SALES, (col) =>
            {
                var cell = col as C1.Web.Mvc.MultiRow.CellInfo;

                if (cell.Binding == "Product")
                {
                    return CustomerSale.PRODUCTS;
                }

                if (cell.Binding == "Color")
                {
                    return CustomerSale.COLORS;
                }

                return null;
            })));
        }
Exemple #14
0
        public ActionResult GetTopData()
        {
            UpdateDateRange();

            var respone     = new ArrayList();
            var topProducts = DataService.GetTopSaleProductList(3);

            respone.Add(CollectionViewHelper.Read(new CollectionViewRequest <SaleItem>(), topProducts));


            List <SaleItem> topCustomers = DataService.GetTopSaleCustomerList(7);

            respone.Add(CollectionViewHelper.Read(new CollectionViewRequest <SaleItem>(), topCustomers));

            List <SaleGoalItem> goalItems = DataService.CategorySalesVsGoal;

            respone.Add(CollectionViewHelper.Read(new CollectionViewRequest <SaleGoalItem>(), goalItems));

            List <SaleGoalItem> regionalGoalItems = DataService.RegionSalesVsGoal;

            respone.Add(CollectionViewHelper.Read(new CollectionViewRequest <SaleGoalItem>(), regionalGoalItems));

            return(this.C1Json(respone));
        }
 public ActionResult Filter_Bind([C1JsonRequest] CollectionViewRequest <Orders.Order> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, Orders.GetOrders())));
 }
Exemple #16
0
 public ActionResult RightToLeft_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(500))));
 }
 public ActionResult VirtualScrolling_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(100000))));
 }
 public ActionResult GridBooleanCheckerBind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, _source)));
 }
        public ActionResult Index_Bind([C1JsonRequest] CollectionViewRequest <Orders.Order> requestData)
        {
            var model = Orders.GetOrders();

            return(this.C1Json(CollectionViewHelper.Read(requestData, model)));
        }
 public ActionResult DisableServerRead_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(500))));
 }
Exemple #21
0
 public ActionResult GridBindCategory([C1JsonRequest] CollectionViewRequest <Category> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, _db.Categories.ToList())));
 }
Exemple #22
0
 public ActionResult Grouping_Bind([C1JsonRequest] CollectionViewRequest <Order> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, _db.Orders.ToList())));
 }
Exemple #23
0
 public ActionResult MultiRowBindSupplier([C1JsonRequest] CollectionViewRequest <Supplier> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, _db.Suppliers.ToList())));
 }
        public ActionResult Group_Bind(CollectionViewRequest <CampainTaskItem> requestData)
        {
            List <CampainTaskItem> items = DataService.CampainTaskCollction;

            return(this.C1Json(CollectionViewHelper.Read(requestData, items)));
        }
Exemple #25
0
 public ActionResult CustomFooters_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(500))));
 }
Exemple #26
0
 public ActionResult RemoteBind_Read([C1JsonRequest] CollectionViewRequest <CustomerOrder> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, CustomerOrder.GetCountryGroupOrderData())));
 }
 public ActionResult CustomEditors_Bind([C1JsonRequest] CollectionViewRequest <Sale> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, Source)));
 }
Exemple #28
0
 public ActionResult GridBindCustomer([C1JsonRequest] CollectionViewRequest <Customer> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, _db.Customers.ToList())));
 }
Exemple #29
0
 public ActionResult GridRead([C1JsonRequest] CollectionViewRequest <Sale> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, FlexGridModel.Source)));
 }
Exemple #30
0
 public ActionResult BatchEditing_Bind([C1JsonRequest] CollectionViewRequest <Supplier> requestData)
 {
     return(this.C1Json(CollectionViewHelper.Read(requestData, _db.Suppliers.ToList())));
 }