• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Mvc.GridModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _SearchResult

        public ActionResult _SearchResult(GridCommand command, string item, string supplier, DateTime? dateFrom, DateTime? dateTo)
        {
            string sqlStr = PrepareSearchStatement(command, item, supplier, dateFrom, dateTo);
            IList<object[]> objectList = base.genericMgr.FindAllWithNativeSql<object[]>(sqlStr);

            var inspectDetailList = (from inp in objectList
                                     select new InspectDetail
                                     {
                                         IpNo = (string)inp[0],
                                         ManufactureParty = (string)inp[1],
                                         ManufacturePartyName = (string)inp[2],
                                         Item = (string)inp[3],
                                         ItemDescription = (string)inp[4],
                                         ReferenceItemCode = (string)inp[5],
                                         UnitCount = (decimal)inp[6],
                                         Uom = (string)inp[7],
                                         RejectQty = (decimal)inp[8],
                                         InspectQty = (decimal)inp[9]
                                     }).ToList();

            int count = Convert.ToInt32(base.systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.MaxRowSizeOnPage));
            if (inspectDetailList.Count > count)
            {
                SaveWarningMessage(string.Format("数据超过{0}行,只显示前{0}行", count));
            }
            //return PartialView(inspectDetailList.Take(count));
            GridModel<InspectDetail> gridModel = new GridModel<InspectDetail>();
            gridModel.Total = count;
            gridModel.Data = inspectDetailList.Take(count);
            return PartialView(gridModel);
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:31,代码来源:PPMController.cs


示例2: Configure

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

            var tmp = new List<FixedShippingRateModel>();
            foreach (var shippingMethod in _shippingService.GetAllShippingMethods())
                tmp.Add(new FixedShippingRateModel()
                {
                    ShippingMethodId = shippingMethod.Id,
                    ShippingMethodName = shippingMethod.Name,
                    Rate = GetShippingRate(shippingMethod.Id)
                });

            var tmp2 = tmp.ForCommand(command);
            var gridModel = new GridModel<FixedShippingRateModel>
            {
                Data = tmp2,
                Total = tmp2.Count()
            };
            return new JsonResult
            {
                Data = gridModel
            };
        }
开发者ID:nguyentu1982,项目名称:quancu,代码行数:25,代码来源:ShippingFixedRateController.cs


示例3: Categories

        public ActionResult Categories(GridCommand command)
        {
            var model = new GridModel<TaxCategoryModel>();

            if (_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
            {
                var categoriesModel = _taxCategoryService.GetAllTaxCategories()
                    .Select(x => x.ToModel())
                    .ForCommand(command)
                    .ToList();

                model.Data = categoriesModel;
                model.Total = categoriesModel.Count;
            }
            else
            {
                model.Data = Enumerable.Empty<TaxCategoryModel>();

                NotifyAccessDenied();
            }

            return new JsonResult
            {
                Data = model
            };
        }
开发者ID:toannguyen241994,项目名称:SmartStoreNET,代码行数:26,代码来源:TaxController.cs


示例4: Configure

        public ActionResult Configure(GridCommand command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
                return Content("Access denied");

            var tmp = new List<FixedTaxRateModel>();
            foreach (var taxCategory in _taxCategoryService.GetAllTaxCategories())
                tmp.Add(new FixedTaxRateModel()
                {
                    TaxCategoryId = taxCategory.Id,
                    TaxCategoryName = taxCategory.Name,
                    Rate = GetTaxRate(taxCategory.Id)
                });

            var tmp2 = tmp.ForCommand(command);
            var gridModel = new GridModel<FixedTaxRateModel>
            {
                Data = tmp2,
                Total = tmp2.Count()
            };
            return new JsonResult
            {
                Data = gridModel
            };
        }
开发者ID:nguyentu1982,项目名称:quancu,代码行数:25,代码来源:TaxFixedRateController.cs


示例5: List

		public ActionResult List(string id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageEmailAccounts))
                return AccessDeniedView();

			//mark as default email account (if selected)
			if (!String.IsNullOrEmpty(id))
			{
				int defaultEmailAccountId = Convert.ToInt32(id);
				var defaultEmailAccount = _emailAccountService.GetEmailAccountById(defaultEmailAccountId);
				if (defaultEmailAccount != null)
				{
					_emailAccountSettings.DefaultEmailAccountId = defaultEmailAccountId;
					_settingService.SaveSetting(_emailAccountSettings);
				}
			}

			var emailAccountModels = _emailAccountService.GetAllEmailAccounts()
									.Select(x => x.ToModel())
									.ToList();
			foreach (var eam in emailAccountModels)
				eam.IsDefaultEmailAccount = eam.Id == _emailAccountSettings.DefaultEmailAccountId;

			var gridModel = new GridModel<EmailAccountModel>
			{
				Data = emailAccountModels,
				Total = emailAccountModels.Count()
			};
			return View(gridModel);
		}
开发者ID:JeffersonNascimento,项目名称:SmartStoreNET,代码行数:30,代码来源:EmailAccountController.cs


示例6: Weights

        public ActionResult Weights(string id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageMeasures))
                return AccessDeniedView();

            //mark as primary weight (if selected)
            if (!String.IsNullOrEmpty(id))
            {
                int primaryWeightId = Convert.ToInt32(id);
                var primaryWeight = _measureService.GetMeasureWeightById(primaryWeightId);
                if (primaryWeight != null)
                {
                    _measureSettings.BaseWeightId = primaryWeightId;
                    _settingService.SaveSetting(_measureSettings);
                }
            }

            var weightsModel = _measureService.GetAllMeasureWeights()
                .Select(x => x.ToModel())
                .ToList();
            foreach (var wm in weightsModel)
                wm.IsPrimaryWeight = wm.Id == _measureSettings.BaseWeightId;
            var model = new GridModel<MeasureWeightModel>
			{
                Data = weightsModel,
                Total = weightsModel.Count
			};
            return View(model);
		}
开发者ID:JeffersonNascimento,项目名称:SmartStoreNET,代码行数:29,代码来源:MeasureController.cs


示例7: ListAsync

        public ActionResult ListAsync()
        {
            var clients = _clientRepository.All();

            var clientModel = new GridModel(clients);
            return View(clientModel);
        }
开发者ID:ruairiquinn,项目名称:NewWestlink,代码行数:7,代码来源:ClientController.cs


示例8: _AjaxList

        public ActionResult _AjaxList(GridCommand command, SnapshotFlowDet4LeanEngineSearchModel searchModel)
        {
            string selectSql = this.PrepareSearchStatement(command, searchModel);
            var total = this.genericMgr.FindAllWithNativeSql<int>(string.Format("select count(*) from ({0}) result", selectSql))[0];
            string whereStatement = string.Format(" select * from ( {0} ) result where result.RowId between {1} and {2}", selectSql, command.PageSize * (command.Page - 1), command.PageSize * command.Page);
            //var returnList = this.genericMgr.FindEntityWithNativeSql<SnapshotFlowDet4LeanEngine>(whereStatement);
            var searchList = this.genericMgr.FindAllWithNativeSql<object[]>(whereStatement);
            var returnList = (from take in searchList
                              select new SnapshotFlowDet4LeanEngine
                              {
                                  Id = (Int64)take[1],
                                  Flow = (string)take[2],
                                  Item = (string)take[3],
                                  LocationFrom = (string)take[4],
                                  LocationTo = (string)take[5],
                                  OrderNo = (string)take[6],
                                  Lvl = Convert.ToInt16((take[7]).ToString()),
                                  ErrorId = Convert.ToInt16((take[8]).ToString()),
                                  Message = (string)take[9],
                                  CreateDate = (DateTime)take[10],
                                  BatchNo = (int)take[11],
                                  ItemDesc = (string)take[12],
                                  ReferenceItemCode = (string)take[13],
                              }).ToList();

            GridModel<SnapshotFlowDet4LeanEngine> gridMode = new GridModel<SnapshotFlowDet4LeanEngine>();
            gridMode.Total = total;
            gridMode.Data = returnList;
            return PartialView(gridMode);
            //string 
            //SearchStatementModel searchStatementModel = this.PrepareSearchStatement(command, searchModel);
            //return PartialView(GetAjaxPageData<SnapshotFlowDet4LeanEngine>(searchStatementModel, command));
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:33,代码来源:SnapshotFlowDet4LeanEngineController.cs


示例9: QueuedEmailList

		public ActionResult QueuedEmailList(GridCommand 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, model.SearchSendManually);

            var gridModel = new GridModel<QueuedEmailModel>
            {
                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:boatengfrankenstein,项目名称:SmartStoreNET,代码行数:34,代码来源:QueuedEmailController.cs


示例10: Index

        public ActionResult Index(GridCommand command, ErrorLogModel model)
        {
            if (!PermissionService.Authorize(PermissionProvider.ErrorView))
                return AccessDeniedView();

            int totalRecords = 0;
            var query = _unitOfWork.ErrorRepository.GetAsQuerable().OrderByDescending(x => x.CreatedOn);
            var errorLog = query.ApplyGridCommandsWithPaging(command, out totalRecords);

            var errorList = errorLog.Select(error => new ErrorLogModel
            {
                Id = error.Id,
                IpAddress = error.IpAddress,
                PageUrl = error.PageUrl,
                ShortMessage = error.ShortMessage,
                FullMessage = error.FullMessage,
                CreatedOn = error.CreatedOn
            }).ToList();

            var gridModel = new GridModel<ErrorLogModel>
            {
                Data = errorList,
                Total = totalRecords
            };

            return View(gridModel);
        }
开发者ID:harisshahid,项目名称:IIUSchoolSystem,代码行数:27,代码来源:ErrorLogController.cs


示例11: AffiliatedCustomerList

        public ActionResult AffiliatedCustomerList(int affiliateId, GridCommand command)
        {
            var model = new GridModel<AffiliateModel.AffiliatedCustomerModel>();

            if (_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
            {
                var affiliate = _affiliateService.GetAffiliateById(affiliateId);
                var customers = _customerService.GetAllCustomers(affiliate.Id, command.Page - 1, command.PageSize);

                model.Data = customers.Select(customer =>
                {
                    var customerModel = new AffiliateModel.AffiliatedCustomerModel
                    {
                        Id = customer.Id,
                        Email = customer.Email,
                        Username = customer.Username,
                        FullName = customer.GetFullName()
                    };

                    return customerModel;
                });
                model.Total = customers.TotalCount;
            }
            else
            {
                model.Data = Enumerable.Empty<AffiliateModel.AffiliatedCustomerModel>();

                NotifyAccessDenied();
            }

            return new JsonResult
            {
                Data = model
            };
        }
开发者ID:toannguyen241994,项目名称:SmartStoreNET,代码行数:35,代码来源:AffiliateController.cs


示例12: List

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

            var customers = _customerService.GetOnlineCustomers(DateTime.UtcNow.AddMinutes(-_customerSettings.OnlineCustomerMinutes),
                null, 0, _adminAreaSettings.GridPageSize);

            var model = new GridModel<OnlineCustomerModel>
            {
                Data = customers.Select(x =>
                {
                    return new OnlineCustomerModel()
                    {
                        Id = x.Id,
                        CustomerInfo = x.IsRegistered() ? x.Email : _localizationService.GetResource("Admin.Customers.Guest"),
                        LastIpAddress = x.LastIpAddress,
                        Location = _geoCountryLookup.LookupCountryName(x.LastIpAddress),
                        LastActivityDate = _dateTimeHelper.ConvertToUserTime(x.LastActivityDateUtc, DateTimeKind.Utc),
                        LastVisitedPage = x.GetAttribute<string>(SystemCustomerAttributeNames.LastVisitedPage)
                    };
                }),
                Total = customers.TotalCount
            };
            return View(model);
        }
开发者ID:vic0626,项目名称:nas-merk,代码行数:26,代码来源:OnlineCustomerController.cs


示例13: CurrentCarts

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

            var customers = _customerService.GetAllCustomers(null, null, null, null, null,
                null, null, 0, 0, true, ShoppingCartType.ShoppingCart,
                command.Page - 1, command.PageSize);

            var gridModel = new GridModel<ShoppingCartModel>
            {
                Data = customers.Select(x =>
                {
                    return new ShoppingCartModel()
                    {
                        CustomerId = x.Id,
                        CustomerName = x.IsGuest() ?
                        "Guest" :
                        x.GetFullName(),
                        TotalItems = x.ShoppingCartItems.Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart).ToList().GetTotalProducts()
                    };
                }),
                Total = customers.TotalCount
            };
            return new JsonResult
            {
                Data = gridModel
            };
        }
开发者ID:cmcginn,项目名称:StoreFront,代码行数:29,代码来源:ShoppingCartController.cs


示例14: Providers

        public ActionResult Providers(string systemName)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
                return AccessDeniedView();

            //mark as active tax provider (if selected)
            if (!String.IsNullOrEmpty(systemName))
            {
                var taxProvider = _taxService.LoadTaxProviderBySystemName(systemName);
                if (taxProvider != null)
                {
                    _taxSettings.ActiveTaxProviderSystemName = systemName;
                    _settingService.SaveSetting(_taxSettings);
                }
            }

            var taxProvidersModel = _taxService.LoadAllTaxProviders()
                .Select(x => x.ToModel()).ToList();
            foreach (var tpm in taxProvidersModel)
                tpm.IsPrimaryTaxProvider = tpm.SystemName.Equals(_taxSettings.ActiveTaxProviderSystemName, StringComparison.InvariantCultureIgnoreCase);
            var gridModel = new GridModel<TaxProviderModel>
            {
                Data = taxProvidersModel,
                Total = taxProvidersModel.Count()
            };
            return View(gridModel);
        }
开发者ID:GloriousOnion,项目名称:SmartStoreNET,代码行数:27,代码来源:TaxController.cs


示例15: _AjaxFlowCarrierList

 public ActionResult _AjaxFlowCarrierList(GridCommand command, string id)
 {
     GridModel<TransportFlowCarrier> GridModel = new GridModel<TransportFlowCarrier>();
     GridModel.Total = (int)this.genericMgr.FindAll<long>("select count(*) from TransportFlowCarrier tf where tf.Flow=?", id)[0];
     var result = this.genericMgr.FindAll<TransportFlowCarrier>("from TransportFlowCarrier tf where tf.Flow=? order by Sequence", id);
     this.FillCodeDetailDescription<TransportFlowCarrier>(result);
     GridModel.Data = result;
     return PartialView(GridModel);
 }
开发者ID:druidwang,项目名称:Les_parts,代码行数:9,代码来源:TransportFlowController.cs


示例16: Comments

        public ActionResult Comments(int? filterByNewsItemId)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageNews))
                return AccessDeniedView();

            ViewBag.FilterByNewsItemId = filterByNewsItemId;
            var model = new GridModel<NewsCommentModel>();
            return View(model);
        }
开发者ID:pquic,项目名称:qCommerce,代码行数:9,代码来源:NewsController.cs


示例17: GetCustomersManualPaging

        public ActionResult GetCustomersManualPaging(int page, int size)
        {
            var context = new TelerikDemoDataContext(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

            var result = context.GetCustomersPaged(page, size).ToList();
            var gridModel = new GridModel{
                Data = result,
                Total = 91
            };

            return View(gridModel);
        }
开发者ID:chrispfarrell,项目名称:TelerikMvcDemo,代码行数:12,代码来源:GridController.cs


示例18: List

        public ActionResult List()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCatalog))
                return AccessDeniedView();

            var productAttributes = _productAttributeService.GetAllProductAttributes();
            var gridModel = new GridModel<ProductAttributeModel>
            {
                Data = productAttributes.Select(x => x.ToModel()),
                Total = productAttributes.Count()
            };
            return View(gridModel);
        }
开发者ID:JeffersonNascimento,项目名称:SmartStoreNET,代码行数:13,代码来源:ProductAttributeController.cs


示例19: _AjaxListMaterial

        public ActionResult _AjaxListMaterial()
        {
            string OPName = this.Request.Form["OP"];
            string CHARG = this.Request.Form["CHARG"];
            List<DocumentaryViewModel> result = new List<DocumentaryViewModel>();
            result = CurrentVAN(CurrentStation(OPName, CHARG));
            GridModel<DocumentaryViewModel> GridModel = new GridModel<DocumentaryViewModel>();
            GridModel.Total = result.Count;
            GridModel.Data = result
                .ToList();

            return PartialView(GridModel);
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:13,代码来源:DocumentaryController.cs


示例20: ListTypes

        public ActionResult ListTypes()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageActivityLog))
                return AccessDeniedView();

            var activityLogTypeModel = _customerActivityService.GetAllActivityTypes().Select(x => x.ToModel());
            var gridModel = new GridModel<ActivityLogTypeModel>
            {
                Data = activityLogTypeModel,
                Total = activityLogTypeModel.Count()
            };
            return View(gridModel);
        }
开发者ID:JeffersonNascimento,项目名称:SmartStoreNET,代码行数:13,代码来源:ActivityLogController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NavigationService.NavigatingEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Mvc.GridCommand类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap