当前位置: 首页>>代码示例>>C#>>正文


C# Kendoui.DataSourceRequest类代码示例

本文整理汇总了C#中Nop.Web.Framework.Kendoui.DataSourceRequest的典型用法代码示例。如果您正苦于以下问题:C# DataSourceRequest类的具体用法?C# DataSourceRequest怎么用?C# DataSourceRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataSourceRequest类属于Nop.Web.Framework.Kendoui命名空间,在下文中一共展示了DataSourceRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SubscriptionList

		public ActionResult SubscriptionList(DataSourceRequest command, NewsLetterSubscriptionListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageNewsletterSubscribers))
                return AccessDeniedView();

            bool? isActive = null;
            if (model.ActiveId == 1)
                isActive = true;
            else if (model.ActiveId == 2)
                isActive = false;

            var newsletterSubscriptions = _newsLetterSubscriptionService.GetAllNewsLetterSubscriptions(model.SearchEmail,
                model.StoreId, isActive, command.Page - 1, command.PageSize);

            var gridModel = new DataSourceResult
            {
                Data = newsletterSubscriptions.Select(x =>
				{
					var m = x.ToModel();
				    var store = _storeService.GetStoreById(x.StoreId);
				    m.StoreName = store != null ? store.Name : "Unknown store";
					m.CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc);
					return m;
				}),
                Total = newsletterSubscriptions.TotalCount
            };

            return Json(gridModel);
		}
开发者ID:jasonholloway,项目名称:brigita,代码行数:29,代码来源:NewsLetterSubscriptionController.cs

示例2: QueuedEmailList

		public ActionResult QueuedEmailList(DataSourceRequest command, QueuedEmailListModel model)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMessageQueue))
                return AccessDeniedView();

            DateTime? startDateValue = (model.SearchStartDate == null) ? null
                            : (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.SearchStartDate.Value, _dateTimeHelper.CurrentTimeZone);

            DateTime? endDateValue = (model.SearchEndDate == null) ? null 
                            :(DateTime?)_dateTimeHelper.ConvertToUtcTime(model.SearchEndDate.Value, _dateTimeHelper.CurrentTimeZone).AddDays(1);

            var queuedEmails = _queuedEmailService.SearchEmails(model.SearchFromEmail, model.SearchToEmail, 
                startDateValue, endDateValue, 
                model.SearchLoadNotSent, model.SearchMaxSentTries, true,
                command.Page - 1, command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data = queuedEmails.Select(x => {
                    var m = x.ToModel();
                    m.CreatedOn = _dateTimeHelper.ConvertToUserTime(x.CreatedOnUtc, DateTimeKind.Utc);
                    if (x.SentOnUtc.HasValue)
                        m.SentOn = _dateTimeHelper.ConvertToUserTime(x.SentOnUtc.Value, DateTimeKind.Utc);
                    return m;
                }),
                Total = queuedEmails.TotalCount
            };
			return new JsonResult
			{
				Data = gridModel
			};
		}
开发者ID:haithemChkel,项目名称:nopCommerce_33,代码行数:31,代码来源:QueuedEmailController.cs

示例3: List

        public ActionResult List(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings))
                return Content("Access denied");

            var pickupPoints = _storePickupPointService.GetAllStorePickupPoints();
            var model = pickupPoints.Select(x =>
            {
                var store = _storeService.GetStoreById(x.StoreId);
                return new StorePickupPointModel
                {
                    Id = x.Id,
                    Name = x.Name,
                    OpeningHours = x.OpeningHours,
                    PickupFee = x.PickupFee,
                    StoreName = store != null ? store.Name
                        : x.StoreId == 0 ? _localizationService.GetResource("Admin.Configuration.Settings.StoreScope.AllStores") : string.Empty
                };
            }).ToList();

            return Json(new DataSourceResult
            {
                Data = model,
                Total = pickupPoints.TotalCount
            });
        }
开发者ID:Xzelsius,项目名称:nopCommerce,代码行数:26,代码来源:PickupInStoreController.cs

示例4: AffiliatedCustomerList

        public ActionResult AffiliatedCustomerList(int affiliateId, DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var affiliate = _affiliateService.GetAffiliateById(affiliateId);
            if (affiliate == null)
                throw new ArgumentException("No affiliate found with the specified id");

            var customers = _customerService.GetAllCustomers(
                affiliateId: affiliate.Id,
                pageIndex: command.Page - 1,
                pageSize: command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data = customers.Select(customer =>
                    {
                        var customerModel = new AffiliateModel.AffiliatedCustomerModel();
                        customerModel.Id = customer.Id;
                        customerModel.Name = customer.Email;
                        return customerModel;
                    }),
                Total = customers.TotalCount
            };

            return Json(gridModel);
        }
开发者ID:aumankit,项目名称:nop,代码行数:27,代码来源:AffiliateController.cs

示例5: List

        public ActionResult List(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers))
                return AccessDeniedView();

            var customers = _customerService.GetOnlineCustomers(DateTime.UtcNow.AddMinutes(-_customerSettings.OnlineCustomerMinutes),
                null, command.Page - 1, command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data = customers.Select(x => new OnlineCustomerModel
                {
                    Id = x.Id,
                    CustomerInfo = x.IsRegistered() ? x.Email : _localizationService.GetResource("Admin.Customers.Guest"),
                    LastIpAddress = x.LastIpAddress,
                    Location = _geoLookupService.LookupCountryName(x.LastIpAddress),
                    LastActivityDate = _dateTimeHelper.ConvertToUserTime(x.LastActivityDateUtc, DateTimeKind.Utc),
                    LastVisitedPage = _customerSettings.StoreLastVisitedPage ?
                        x.GetAttribute<string>(SystemCustomerAttributeNames.LastVisitedPage) :
                        _localizationService.GetResource("Admin.Customers.OnlineCustomers.Fields.LastVisitedPage.Disabled")
                }),
                Total = customers.TotalCount
            };

            return Json(gridModel);
        }
开发者ID:491134648,项目名称:nopCommerce,代码行数:25,代码来源:OnlineCustomerController.cs

示例6: CurrentCarts

        public ActionResult CurrentCarts(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCurrentCarts))
                return AccessDeniedView();

            var customers = _customerService.GetAllCustomers(
                loadOnlyWithShoppingCart: true,
                sct: ShoppingCartType.ShoppingCart,
                pageIndex: command.Page - 1,
                pageSize: command.PageSize);

            var gridModel = new DataSourceResult
            {
                Data = customers.Select(x =>
                {
                    return new ShoppingCartModel()
                    {
                        CustomerId = x.Id,
                        CustomerEmail = x.IsRegistered() ? x.Email : _localizationService.GetResource("Admin.Customers.Guest"),
                        TotalItems = x.ShoppingCartItems.Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart).ToList().GetTotalProducts()
                    };
                }),
                Total = customers.TotalCount
            };

            return Json(gridModel);
        }
开发者ID:minuzZ,项目名称:zelectroshop,代码行数:27,代码来源:ShoppingCartController.cs

示例7: DeleteTrial

        public ActionResult DeleteTrial(DataSourceRequest command, int TrialTrackerId)
        {
            var trial = _trialRepository.GetById(TrialTrackerId);
            _trialRepository.Delete(trial);

            return new NullJsonResult();
        }
开发者ID:quan-vu-niteco,项目名称:NopCommerce,代码行数:7,代码来源:TrialTrackerController.cs

示例8: AdvertisementList

        public ActionResult AdvertisementList(DataSourceRequest command, AdvertisementListModel model)
        {
            var ads = _advertisementService.SearchAdvertisements(
                storeId: model.SearchStoreId,
                vendorId: model.SearchVendorId,
                keywords: model.SearchAdvertisementName,
                pageIndex: command.Page - 1,
                pageSize: command.PageSize);

            var gridModel = new DataSourceResult();
            gridModel.Data = ads.Select(x =>
            {
                var adModel = new ModelsMapper().CreateMap<Advertisement, AdvertisementModel>(x);
                //little hack here:
                //ensure that product full descriptions are not returned
                //otherwise, we can get the following error if products have too long descriptions:
                //"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. "
                //also it improves performance
                adModel.Description = string.Empty;

                //picture
                //var defaultProductPicture = _pictureService.GetPicturesByProductId(x.Id, 1).FirstOrDefault();
                //adModel.PictureThumbnailUrl = _pictureService.GetPictureUrl(defaultProductPicture, 75, true);
                ////product type
                //adModel.ProductTypeName = x.ProductType.GetLocalizedEnum(_localizationService, _workContext);
                ////friendly stock qantity
                ////if a simple product AND "manage inventory" is "Track inventory", then display
                //if (x.ProductType == ProductType.SimpleProduct && x.ManageInventoryMethod == ManageInventoryMethod.ManageStock)
                //    adModel.StockQuantityStr = x.GetTotalStockQuantity().ToString();
                return adModel;
            });
            gridModel.Total = ads.TotalCount;

            return Json(gridModel);
        }
开发者ID:mhsohail,项目名称:Livetameion_3.7,代码行数:35,代码来源:AdvertisementsController.cs

示例9: BannerPicturesList

        public ActionResult BannerPicturesList(DataSourceRequest command, int? id)
        {
            if(!id.HasValue || id.Value == 0)
                return new EmptyResult();

            var bannerPictures = _promoBannerService.RetrievePicturesForBanner(id.Value);
            var modelItems = bannerPictures.Select(sp => new PromoBannerPictureModel()
                    {
                        Id = sp.Id,
                        Comment = sp.Comment,
                        DisplaySequence = sp.DisplaySequence,
                        PictureId = sp.PictureId,
                        PromoReference = sp.PromoReference,
                        Url = sp.Url,
                        BannerId = id.Value
                    }).ToList();

            if (modelItems != null && modelItems.Count() > 0)
            {
                modelItems.ToList().ForEach(i =>
                    {
                        i.PictureUrl = _pictureService.GetPictureUrl(i.PictureId);
                    });
            }

            var gridModel = new DataSourceResult
            {
                Data = modelItems,
                Total = modelItems != null ? modelItems.Count() : 0
            };

            return Json(gridModel);
        }
开发者ID:Qixol,项目名称:Qixol.Promo.Nop.Plugin,代码行数:33,代码来源:PromoBannerController.cs

示例10: AuctionList

 public ActionResult AuctionList(DataSourceRequest command, AuctionListModel model)
 {
     var auctions = _auctionService.GetAllAuctions().ToList();
     var gridModel = new DataSourceResult();
     gridModel.Data = auctions;
     gridModel.Total = auctions.Count;
     return Json(gridModel);
 }
开发者ID:mhsohail,项目名称:Livetameion_3.7,代码行数:8,代码来源:AuctionsController.cs

示例11: GetTrials

        public ActionResult GetTrials(DataSourceRequest command)
        {
            var trials = _trialRepository.Table.ToList();

            var gridModel = new DataSourceResult
            {
                Data = trials,
                Total = trials.Count
            };

            return Json(gridModel);
        }
开发者ID:quan-vu-niteco,项目名称:NopCommerce,代码行数:12,代码来源:TrialTrackerController.cs

示例12: GalleryList

        public ActionResult GalleryList(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.AccessAdminPanel))
                return AccessDeniedView();

            var galleries = _productRepository.Table.Where(x => x.ProductTemplateId == 3).ToList();
            var gridModel = new DataSourceResult
            {
                Data = galleries.Select(x => x.ToModel()),
                Total = galleries.Count
            };

            return Json(gridModel);
        }
开发者ID:kolnago,项目名称:AlterDeco,代码行数:14,代码来源:GalleryController.cs

示例13: CountryList

        public ActionResult CountryList(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCountries))
                return AccessDeniedView();

            var countries = _countryService.GetAllCountries(showHidden: true);
            var gridModel = new DataSourceResult
            {
                Data = countries.Select(x => x.ToModel()),
                Total = countries.Count
            };

            return Json(gridModel);
        }
开发者ID:aumankit,项目名称:nop,代码行数:14,代码来源:CountryController.cs

示例14: List

        public ActionResult List(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAttributes))
                return AccessDeniedView();

            var productAttributes = _productAttributeService
                .GetAllProductAttributes(command.Page - 1, command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data = productAttributes.Select(x => x.ToModel()),
                Total = productAttributes.TotalCount
            };

            return Json(gridModel);
        }
开发者ID:minuzZ,项目名称:zelectroshop,代码行数:15,代码来源:ProductAttributeController.cs

示例15: List

        public ActionResult List(PlayerListModel model, DataSourceRequest command)
        {
            var players = _playerService.GetAll(model.SearchLevel, model.SearchFullName);
            var resultData = command.Page > 0 && command.PageSize > 0 ?
                players.PagedForCommand(command).Select(x => x) :
                players;

            var gridModel = new DataSourceResult
            {
                Data = resultData,
                Total = players.Count
            };

            return Json(gridModel);
        }
开发者ID:AlexandrKiselev79,项目名称:LLT_Site,代码行数:15,代码来源:PlayerController.cs


注:本文中的Nop.Web.Framework.Kendoui.DataSourceRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。