public ActionResult GetPickUpTransportPoint(MGJH_PickUpTransportPointSearchModel model, int searchPage) { SearchDataWithPagedDatas <MGJH_PickUpTransportPointSearchModel, MGJH_PickUpTransportPointListModel> result = new SearchDataWithPagedDatas <MGJH_PickUpTransportPointSearchModel, MGJH_PickUpTransportPointListModel>(); result.SearchModel = model; result.PagedDatas = MGJH_TransportPointBLL.GetPagedPickUpTransportPoints(result.SearchModel, searchPage, this.PageSize); return(PartialView("_PickUpTransportPointPagedGrid", result)); }
public static AsiatekPagedList <MGJH_PickUpTransportPointListModel> GetPagedPickUpTransportPoints(MGJH_PickUpTransportPointSearchModel model, int searchPage, int pageSize) { List <SqlParameter> paras = new List <SqlParameter>() { new SqlParameter("@tableName", "dbo.MGJH_TransportPointSetting tp "), new SqlParameter("@pageSize", pageSize), new SqlParameter("@currentPage", searchPage), new SqlParameter("@orderBy", "tp.CreateTime DESC"), new SqlParameter("@showColumns", @"tp.ID ,tp.SettingType ,tp.AddressName ,tp.AddressCode ,tp.EFType ,tp.EFInfo "), }; #region 筛选条件 string conditionStr = " tp.SettingType=1"; //查询提货点 if (!string.IsNullOrWhiteSpace(model.AddressName)) { conditionStr += " AND tp.AddressName LIKE '%" + model.AddressName + "%'"; } if (!string.IsNullOrWhiteSpace(model.AddressCode)) { conditionStr += " AND tp.AddressCode LIKE '%" + model.AddressCode + "%'"; } if (!string.IsNullOrWhiteSpace(conditionStr)) { paras.Add(new SqlParameter("@conditionStr", conditionStr)); } #endregion paras.Add(new SqlParameter() { ParameterName = "@totalItemCount", Direction = ParameterDirection.Output, SqlDbType = SqlDbType.Int }); paras.Add(new SqlParameter() { ParameterName = "@newCurrentPage", Direction = ParameterDirection.Output, SqlDbType = SqlDbType.Int }); var rs = MSSQLHelper.ExecuteDataTable(CommandType.StoredProcedure, "Proc_GetPagedDatas", paras.ToArray()); List <MGJH_PickUpTransportPointListModel> list = ConvertToList <MGJH_PickUpTransportPointListModel> .Convert(rs); int totalItemCount = Convert.ToInt32(paras[paras.Count - 2].Value); int newCurrentPage = Convert.ToInt32(paras[paras.Count - 1].Value); return(list.ToPagedList(newCurrentPage, pageSize, totalItemCount)); }