public IPagedList <DivisionModel> GetPagedList(int?divisionID, int?page, int pageSize = 10) { IList <DivisionModel> divisionList = new List <DivisionModel>(); int pageNumber = page ?? 1; if (divisionID == null) { divisionList = _divisionModelListLogic.GetDivisionModelList(); } else { divisionList = _divisionModelListLogic.GetDivisionModelList((int)divisionID); } if (divisionList != null && divisionList.Count > 0) { return(divisionList.ToPagedList(pageNumber, pageSize)); } else { return(null); } }
private IPagedList <DivisionModel> GetPagedList(int?divisionID, int?page) { const int pageSize = 10; int pageNumber = page ?? 1; IList <DivisionModel> divisionModelList = null; IPagedList <DivisionModel> divisionModelPagedList = null; if (divisionID == null) { divisionModelList = _divisionModelListLogic.GetDivisionModelList(); } else if (divisionID != null) { divisionModelList = _divisionModelListLogic.GetDivisionModelList((int)divisionID); } if (divisionModelList != null) { divisionModelPagedList = divisionModelList.ToPagedList(pageNumber, pageSize); } return(divisionModelPagedList); }