public IList<Core.Business.ExhibitionManufacturer> GetExhibitionManufacturerByPage(string sqlwhere, int pagenumber, int pagesize) { IList<Core.Business.ExhibitionManufacturer> exhibitionManufacturerlist = new List<Core.Business.ExhibitionManufacturer>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Tables", SqlDbType.VarChar, "ExhibitionManufacturer"); sql.AddParameter("@PK", SqlDbType.VarChar, "Id"); sql.AddParameter("@PageNumber", SqlDbType.Int, pagenumber); sql.AddParameter("@PageSize", SqlDbType.Int, pagesize); //sql.AddParameter("@LawSortID", SqlDbType.UniqueIdentifier, sortId); sql.AddParameter("@Filter", SqlDbType.VarChar, sqlwhere); SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount"); if (reader != null) { while (reader.Read()) { Core.Business.ExhibitionManufacturer exhibitionManufacturer = new Core.Business.ExhibitionManufacturer(); if (!reader.IsDBNull(0)) exhibitionManufacturer.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) exhibitionManufacturer.ManufacturerID = reader.GetGuid(1); if (!reader.IsDBNull(2)) exhibitionManufacturer.InstrumentDate = reader.GetDateTime(2); if (!reader.IsDBNull(3)) exhibitionManufacturer.SequenceNumber = reader.GetInt32(3); if (!reader.IsDBNull(4)) exhibitionManufacturer.IsShowinHomePage = reader.GetInt32(4); exhibitionManufacturer.MarkOld(); exhibitionManufacturerlist.Add(exhibitionManufacturer); } reader.Close(); } return exhibitionManufacturerlist; }
public IList<Core.Business.ExhibitionManufacturer> GetAllExhibitionManufacturer(string strwhere) { IList<Core.Business.ExhibitionManufacturer> exhibitionManufacturerlist = new List<Core.Business.ExhibitionManufacturer>(); SqlServerUtility sql = new SqlServerUtility(); string sqlSelAll = " SELECT ExhibitionManufacturer.[Id],[ManufacturerID],[InstrumentDate],[SequenceNumber],[IsShowinHomePage]FROM[dbo].[ExhibitionManufacturer]"; sqlSelAll += strwhere; SqlDataReader reader = sql.ExecuteSqlReader(sqlSelAll); if (reader != null) { while (reader.Read()) { Core.Business.ExhibitionManufacturer exhibitionManufacturer = new Core.Business.ExhibitionManufacturer(); if (!reader.IsDBNull(0)) exhibitionManufacturer.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) exhibitionManufacturer.ManufacturerID = reader.GetGuid(1); if (!reader.IsDBNull(2)) exhibitionManufacturer.InstrumentDate = reader.GetDateTime(2); if (!reader.IsDBNull(3)) exhibitionManufacturer.SequenceNumber = reader.GetInt32(3); if (!reader.IsDBNull(4)) exhibitionManufacturer.IsShowinHomePage = reader.GetInt32(4); exhibitionManufacturer.MarkOld(); exhibitionManufacturerlist.Add(exhibitionManufacturer); } reader.Close(); } return exhibitionManufacturerlist; }