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

C# System.Pagination类代码示例

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

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



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

示例1: ExecutePagingListTest

 public void ExecutePagingListTest()
 {
     var script = @"Select * From TBL_DEVICE_INFO WHERE PKID >10 ORDER BY PKID";
     var paging = new Pagination() { CurrentPageIndex = 0, PageSize = 25, Paging = true };
     var result = DbHelper.ExecutePagingList<DeviceInfo>(script, paging);
     Assert.IsTrue(result != null);
 }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:7,代码来源:DBHelperTest.cs


示例2: GetList

        public List<CurrencyExport> GetList(int userId, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, OrgId, DeviceNumber, OperateStartTime, OperateEndTime, CurrencyNumber, ExportStatus, DataCount, FileName, FileSize, CreateUserId, CreateTime from tbl_currency_export where 1=1 ";

            if (userId >= 0)
            {
                sql += " and CreateUserId=:UserId ";

                parameterList.Add(new OracleParameter(":UserId", userId));
            }

            sql += " order by PkId desc ";

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<CurrencyExport>(sql, paging, parameterList.ToArray());
            }

            else
            {
                return DbHelper.ExecuteList<CurrencyExport>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:26,代码来源:CurrencyExportRepository.cs


示例3: ProductsPartial

        //public ActionResult ProductsPartial(string categoryId = null)
        //{
        //    using (var proxy = new ProductServiceClient())
        //    {
        //        IEnumerable<ProductDto> products = null;
        //        products = string.IsNullOrEmpty((categoryId)) ? proxy.GetProducts() : proxy.GetProductsForCategory(new Guid(categoryId));
        //        if (string.IsNullOrEmpty(categoryId))
        //            ViewBag.CategoryName = "所有商品";
        //        else
        //        {
        //            var category = proxy.GetCategoryById(new Guid(categoryId));
        //            ViewBag.CategoryName = category.Name;
        //        }

        //        ViewBag.CategoryId = categoryId;
        //        return PartialView(products);
        //    }
        //}

        /// <summary>
        /// 商品页面的分页支持
        /// </summary>
        /// <param name="categoryId">类别Id</param>
        /// <param name="fromIndexPage">是否来源首页点击</param>
        /// <param name="pageNumber">页数</param>
        /// <returns></returns>
        public ActionResult ProductsPartial(string categoryId = null, bool? fromIndexPage = null, int pageNumber =1)
        {
            using (var proxy = new ProductServiceClient())
            {
                var numberOfProductsPerPage = int.Parse(ConfigurationManager.AppSettings["productsPerPage"]);
                var pagination = new Pagination { PageSize = numberOfProductsPerPage, PageNumber = pageNumber };
                ProductDtoWithPagination productsDtoWithPagination = null;

                productsDtoWithPagination = string.IsNullOrEmpty((categoryId)) ? 
                    proxy.GetProductsWithPagination(pagination) : 
                    proxy.GetProductsForCategoryWithPagination(new Guid(categoryId), pagination);
                
                if (string.IsNullOrEmpty(categoryId))
                    ViewBag.CategoryName = "所有商品";
                else
                {
                    var category = proxy.GetCategoryById(new Guid(categoryId));
                    ViewBag.CategoryName = category.Name;
                }

                ViewBag.CategoryId = categoryId;
                ViewBag.FromIndexPage = fromIndexPage;
                if (fromIndexPage == null || fromIndexPage.Value)
                    ViewBag.Action = "Index";
                else
                    ViewBag.Action = "Category"; 
                ViewBag.IsFirstPage = productsDtoWithPagination.Pagination.PageNumber == 1;
                ViewBag.IsLastPage = productsDtoWithPagination.Pagination.PageNumber == productsDtoWithPagination.Pagination.TotalPages;
                return PartialView(productsDtoWithPagination);
            }
        }
开发者ID:liyg02,项目名称:OnlineStore,代码行数:57,代码来源:LayoutController.cs


示例4: init

        public void init()
        {
            currentUrl = Page.Request.Path;
            queryString = Page.Request.ServerVariables["Query_String"];

            Model = new Pagination(Index, count, pageSize, currentUrl, queryString);
        }
开发者ID:CSharpDev,项目名称:Dev.All,代码行数:7,代码来源:PageNavControl.cs


示例5: GetList

        public List<UserRole> GetList(string roleName, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, RoleName, DataFilter, RoleStatus from tbl_user_role Where 1=1 ";

            if (roleName.IsNotNullOrEmpty())
            {
                sql += " and instr(RoleName, :RoleName) > 0 ";

                parameterList.Add(new OracleParameter(":RoleName", roleName));
            }

            sql += " order by PkId desc ";

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<UserRole>(sql, paging, parameterList.ToArray());
            }

            else
            {
                return DbHelper.ExecuteList<UserRole>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:26,代码来源:UserRoleRepository.cs


示例6: GetList

        public List<CurrencyBlacklist> GetList(string currencyNumber, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, CurrencyKindCode, FaceAmount, CurrencyVersion, CurrencyNumber from tbl_currency_blacklist where 1=1 ";

            if (currencyNumber.IsNotNullOrEmpty())
            {
                sql += " and CurrencyNumber like concat(\'%\', {0}, \'%\') ".FormatWith("@CurrencyNumber");

                parameterList.Add(new MySqlParameter("@CurrencyNumber", currencyNumber));
            }

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<CurrencyBlacklist>(sql, paging, parameterList.ToArray());
            }

            else
            {
                sql += " order by PkId desc ";

                return DbHelper.ExecuteList<CurrencyBlacklist>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:26,代码来源:CurrencyBlacklistRepository.cs


示例7: GetList

        public List<UserRole> GetList(string roleName, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, RoleName, DataFilter, RoleStatus from tbl_user_role Where 1=1 ";

            if (roleName.IsNotNullOrEmpty())
            {
                sql += " and RoleName like concat(\'%\', {0}, \'%\') ".FormatWith("@RoleName");

                parameterList.Add(new MySqlParameter("@RoleName", roleName));
            }

            sql += " order by PkId desc ";

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<UserRole>(sql, paging, parameterList.ToArray());
            }

            else
            {
                return DbHelper.ExecuteList<UserRole>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:26,代码来源:UserRoleRepository.cs


示例8: GetList

        public List<CurrencyBlacklist> GetList(string currencyNumber, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, CurrencyKindCode, FaceAmount, CurrencyVersion, CurrencyNumber from tbl_currency_blacklist where 1=1 ";

            if (currencyNumber.IsNotNullOrEmpty())
            {
                sql += " and instr(CurrencyNumber, :CurrencyNumber) > 0 ";

                parameterList.Add(new OracleParameter(":CurrencyNumber", currencyNumber));
            }

            sql += " order by PkId desc ";

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<CurrencyBlacklist>(sql, paging, parameterList.ToArray());
            }

            else
            {
                return DbHelper.ExecuteList<CurrencyBlacklist>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:26,代码来源:CurrencyBlacklistRepository.cs


示例9: GetList

        public List<DeviceInfo> GetList(int orgId, bool isUnknownOrg, string deviceNumber, string registerIp, int deviceKind, int deviceModel, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, DeviceNumber, SoftwareVersion, RegisterIp, KindCode, ModelCode, OrgId, OnLineTime, DeviceStatus from tbl_device_info Where 1=1 ";

            if (isUnknownOrg || (!isUnknownOrg && orgId > 0))
            {
                sql += " and [email protected] ";

                parameterList.Add(new MySqlParameter("@OrgId", orgId));
            }

            if (!isUnknownOrg && orgId == 0)
            {
                sql += " and OrgId>0 ";
            }

            if (deviceNumber.IsNotNullOrEmpty())
            {
                sql += " and DeviceNumber like concat(\'%\', {0}, \'%\') ".FormatWith("@DeviceNumber");

                parameterList.Add(new MySqlParameter("@DeviceNumber", deviceNumber));
            }

            if (registerIp.IsNotNullOrEmpty())
            {
                sql += " and RegisterIp like concat(\'%\', {0}, \'%\') ".FormatWith("@RegisterIp");

                parameterList.Add(new MySqlParameter("@RegisterIp", registerIp));
            }

            if (deviceKind > 0)
            {
                sql += " and [email protected] ";

                parameterList.Add(new MySqlParameter("@KindCode", deviceKind));
            }

            if (deviceModel > 0)
            {
                sql += " and [email protected] ";

                parameterList.Add(new MySqlParameter("@ModelCode", deviceModel));
            }

            sql += " order by PkId desc ";

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<DeviceInfo>(sql, paging, parameterList.ToArray());
            }

            else
            {
                return DbHelper.ExecuteList<DeviceInfo>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:59,代码来源:DeviceInfoRepository.cs


示例10: ExecutePagingListTestWithCustomerConvert

 public void ExecutePagingListTestWithCustomerConvert()
 {
     var script = @"Select * From TBL_CURRENCY_INFO WHERE PKID >10 ORDER BY PKID";
     var paging = new Pagination() { CurrentPageIndex = 0, PageSize = 2, Paging = true };
     var result = DbHelper.ExecutePagingList<CurrencyInfo>(script, paging, Convert);
     Assert.IsTrue(result.Count > 0);
     Assert.IsTrue(result[0].CurrencyImage.Length > 0);
 }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:8,代码来源:DBHelperTest.cs


示例11: Betting

        public ActionResult Betting(int? userid, int p = 0)
        {
            try
            {
                ViewBag.Title = "投注记录";
                ViewBag.Title2 = "投注记录";
                ViewBag.Page = "投注";

                var currentUser = Session["user"] as DBC.User;
                var pages = 1;
                var sqlCount = "";
                var sqlList = "";
                var sqlCountArgs = new List<object>();
                var sqlListArgs = new List<object>();

                var current = GetCurrentUser();
                sqlCount = string.Format("select count(*) from {0} where {0}.userid=?", DBTables.Betting, DBTables.User);
                sqlCountArgs.Add(current.ID);

                sqlList = string.Format("select id from {0} where {0}.userid=?  order by time desc limit ?,?", DBTables.Betting, DBTables.User);
                sqlListArgs.Add(current.ID);

                //添加分页参数
                sqlListArgs.Add(p * _itemsPerPage);
                sqlListArgs.Add(_itemsPerPage);

                var totalCount = Convert.ToInt32(DB.SExecuteScalar(sqlCount, sqlCountArgs.ToArray()));
                pages = (int)Math.Ceiling(totalCount * 1.0 / _itemsPerPage);
                var res = DB.SExecuteReader(sqlList, sqlListArgs.ToArray());

                var bettingList = new List<DBC.Betting>();
                foreach (var item in res)
                {
                    //数据记录不完整时跳过
                    try
                    {
                        var id = Convert.ToInt32(item[0]);
                        var betting = new DBC.Betting(id);
                        bettingList.Add(betting);
                    }
                    catch { }
                }

                var pagination = new Pagination();
                pagination.Pages = pages;
                pagination.Current = p;
                pagination.BaseUrl = "/home/betting";
                ViewBag.pagination = pagination;

                ViewBag.list = GetBettingOverviewList(bettingList);
            }
            catch
            {
                ViewBag.errorText = "未查询到任何记录";
            }

            return View();
        }
开发者ID:nokitty,项目名称:guess,代码行数:58,代码来源:HomeController.cs


示例12: Get

 public IEnumerable<Resource.Service> Get(Pagination pagination)
 {
     try {
         return Client.RequestList<Resource.Service>("GET", @"service/calls", null, pagination);
     }
     catch (System.Web.HttpException e) {
         Exception = e;
     }
     return null;
 }
开发者ID:nedosekov,项目名称:net-sdk,代码行数:10,代码来源:Calls.cs


示例13: Get

 public IEnumerable<Resource.Recording> Get(Pagination pagination = null)
 {
     try {
         return Client.RequestList<Resource.Recording>("GET", "recordings", null, pagination);
     }
     catch (HttpException e) {
         Exception = e;
     }
     return null;
 }
开发者ID:nedosekov,项目名称:net-sdk,代码行数:10,代码来源:Recordings.cs


示例14: Get

 public IEnumerable<Resource.Group> Get(Pagination pagination)
 {
     try {
         return Client.RequestList<Resource.Group>("GET", "groups", null, pagination);
     }
     catch (HttpException e) {
         Exception = e;
     }
     return null;
 }
开发者ID:nedosekov,项目名称:net-sdk,代码行数:10,代码来源:Groups.cs


示例15: GetList

        public List<DeviceConnection> GetList(string deviceNumber, int orgId, string collectorName, string deviceIp, int connectionStatus, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, DeviceNumber, DeviceIp, OrgId, CollectorName, CollectorIp, ConnectTime, DisconnectTime, ConnectionStatus, UploadCount from tbl_device_connection Where 1=1 ";

            if (deviceNumber.IsNotNullOrEmpty())
            {
                sql += " and instr(DeviceNumber, :DeviceNumber) > 0 ";

                parameterList.Add(new OracleParameter(":DeviceNumber", deviceNumber));
            }

            if (orgId > 0)
            {
                sql += " and OrgId=:OrgId ";

                parameterList.Add(new OracleParameter(":OrgId", orgId));
            }

            if (collectorName.IsNotNullOrEmpty())
            {
                sql += " and instr(CollectorName, :CollectorName) > 0 ";

                parameterList.Add(new OracleParameter(":CollectorName", collectorName));
            }

            if (deviceIp.IsNotNullOrEmpty())
            {
                sql += " and instr(DeviceIp, :DeviceIp) > 0 ";

                parameterList.Add(new OracleParameter(":DeviceIp", deviceIp));
            }

            if (connectionStatus > 0)
            {
                sql += " and ConnectionStatus=:ConnectionStatus ";

                parameterList.Add(new OracleParameter(":ConnectionStatus", connectionStatus));
            }

            sql += " order by PkId desc ";

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<DeviceConnection>(sql, paging, parameterList.ToArray());
            }

            else
            {
                return DbHelper.ExecuteList<DeviceConnection>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:54,代码来源:DeviceConnectionRepository.cs


示例16: GetList

        public List<DeviceConnection> GetList(string deviceNumber, int orgId, string collectorName, string deviceIp, int connectionStatus, Pagination paging)
        {
            string sql = null;
            List<DbParameter> parameterList = new List<DbParameter>();

            sql = " select PkId, DeviceNumber, DeviceIp, OrgId, CollectorName, CollectorIp, ConnectTime, DisconnectTime, ConnectionStatus, UploadCount from tbl_device_connection Where 1=1 ";

            if (deviceNumber.IsNotNullOrEmpty())
            {
                sql += " and DeviceNumber like concat(\'%\', {0}, \'%\') ".FormatWith("@DeviceNumber");

                parameterList.Add(new MySqlParameter("@DeviceNumber", deviceNumber));
            }

            if (orgId > 0)
            {
                sql += " and [email protected] ";

                parameterList.Add(new MySqlParameter("@OrgId", orgId));
            }

            if (collectorName.IsNotNullOrEmpty())
            {
                sql += " and CollectorName like concat(\'%\', {0}, \'%\') ".FormatWith("@CollectorName");

                parameterList.Add(new MySqlParameter("@CollectorName", collectorName));
            }

            if (deviceIp.IsNotNullOrEmpty())
            {
                sql += " and DeviceIp like concat(\'%\', {0}, \'%\') ".FormatWith("@DeviceIp");

                parameterList.Add(new MySqlParameter("@DeviceIp", deviceIp));
            }

            if (connectionStatus > 0)
            {
                sql += " and [email protected] ";

                parameterList.Add(new MySqlParameter("@ConnectionStatus", connectionStatus));
            }

            sql += " order by PkId desc ";

            if (paging != null)
            {
                return DbHelper.ExecutePagingList<DeviceConnection>(sql, paging, parameterList.ToArray());
            }

            else
            {
                return DbHelper.ExecuteList<DeviceConnection>(sql, CommandType.Text, parameterList.ToArray());
            }
        }
开发者ID:kainhong,项目名称:CurrencyStore,代码行数:54,代码来源:DeviceConnectionRepository.cs


示例17: Get

 public IEnumerable<Resource.Contact> Get(string groupId, Pagination pagination = null)
 {
     var endpoint = "contacts";
     if (!string.IsNullOrEmpty(groupId)) {
         endpoint += "/" + groupId;
     }
     try {
         return Client.RequestList<Resource.Contact>("GET", endpoint, null, pagination);
     }
     catch (HttpException e) {
         Exception = e;
     }
     return null;
 }
开发者ID:nedosekov,项目名称:net-sdk,代码行数:14,代码来源:Contacts.cs


示例18: GetLibraryFolders

		/// <summary>
		/// Get all existing MyLibrary folders
		/// </summary>
		/// <param name="sortBy">Specifies how the list of folders is sorted</param>
		/// <param name="limit">Specifies the number of results per page in the output, from 1 - 50, default = 50.</param>
		/// <param name="pag">Pagination object.</param>
		/// <returns>Returns a collection of MyLibraryFolder objects.</returns>
		public ResultSet<MyLibraryFolder> GetLibraryFolders(FoldersSortBy? sortBy, int? limit, Pagination pag)
		{
            string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.MyLibraryFolders, GetQueryParameters(new object[] { "sort_by", sortBy, "limit", limit })) : pag.GetNextUrl();
            RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
            try
            {
                var results = response.Get<ResultSet<MyLibraryFolder>>();
                return results;
            }
            catch (Exception ex)
            {
                throw new CtctException(ex.Message, ex);
            } 
		}
开发者ID:lokygb,项目名称:.net-sdk,代码行数:21,代码来源:MyLibraryService.cs


示例19: GetCampaigns

 /// <summary>
 /// Get a set of campaigns.
 /// </summary>
 /// <param name="status">Returns list of email campaigns with specified status.</param>
 /// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
 /// <param name="modifiedSince">limit campaigns to campaigns modified since the supplied date</param>
 /// <param name="pag">Pagination object returned by a previous call to GetCampaigns</param>
 /// <returns>Returns a ResultSet of campaigns.</returns>
 public ResultSet<EmailCampaign> GetCampaigns(CampaignStatus? status, int? limit, DateTime? modifiedSince, Pagination pag)
 {
     string url = (pag == null) ? String.Concat(Settings.Endpoints.Default.BaseUrl, Settings.Endpoints.Default.Campaigns, GetQueryParameters(new object[] { "status", status, "limit", limit, "modified_since", Extensions.ToISO8601String(modifiedSince) })) : pag.GetNextUrl();
     RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
     try
     {
         var results = response.Get<ResultSet<EmailCampaign>>();
         return results;
     }
     catch (Exception ex)
     {
         throw new CtctException(ex.Message, ex);
     } 
 }
开发者ID:epriceweb,项目名称:.net-sdk,代码行数:22,代码来源:EmailCampaignService.cs


示例20: GetBounces

        /// <summary>
        /// Get a result set of bounces for a given campaign.
        /// </summary>
        /// <param name="campaignId">Campaign id.</param>
        /// <param name="limit">Specifies the number of results per page in the output, from 1 - 500, default = 500.</param>
		/// <param name="createdSince">Filter for bounces created since the supplied date in the collection</param>
        /// <param name="pag">Pagination object.</param>
        /// <returns>ResultSet containing a results array of @link BounceActivity.</returns>
        private ResultSet<BounceActivity> GetBounces(string campaignId, int? limit, DateTime? createdSince, Pagination pag)
        {
            string url = (pag == null) ? ConstructUrl(Settings.Endpoints.Default.CampaignTrackingBounces, new object[] { campaignId }, new object[] { "limit", limit, "created_since", Extensions.ToISO8601String(createdSince) }) : pag.GetNextUrl();
            RawApiResponse response = RestClient.Get(url, UserServiceContext.AccessToken, UserServiceContext.ApiKey);
            try
            {
                var results = response.Get<ResultSet<BounceActivity>>();
                return results;
            }
            catch (Exception ex)
            {
                throw new CtctException(ex.Message, ex);
            }
        }
开发者ID:lokygb,项目名称:.net-sdk,代码行数:22,代码来源:CampaignTrackingService.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# System.Paint类代码示例发布时间:2022-05-26
下一篇:
C# System.PageInfo类代码示例发布时间: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