예제 #1
0
 /// <summary>
 /// 分页获取符合查询条件的数据
 /// </summary>
 /// <param name="journalSetInfoQuery">JournalSetInfoQuery查询实体对象</param>
 /// <returns>Pager<JournalSetInfoEntity></returns>
 public Pager<JournalSetInfoEntity> GetJournalSetInfoPageList(JournalSetInfoQuery journalSetInfoQuery)
 {
     return JournalSetInfoBusProvider.GetJournalSetInfoPageList(journalSetInfoQuery);
 }
 /// <summary>
 /// 将查询实体转换为Where语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Where语句,不包含Where</returns>
 /// </summary>
 public string JournalSetInfoQueryToSQLWhere(JournalSetInfoQuery query)
 {
     return string.Empty;
 }
 /// <summary>
 /// 将查询实体转换为Order语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Order语句,不包含Order</returns>
 /// </summary>
 public string JournalSetInfoQueryToSQLOrder(JournalSetInfoQuery query)
 {
     return " SetID DESC";
 }
 public Pager<JournalSetInfoEntity> GetJournalSetInfoPageList(JournalSetInfoQuery query)
 {
     int recordCount=0;
     string whereSQL=JournalSetInfoQueryToSQLWhere(query);
     string orderBy=JournalSetInfoQueryToSQLOrder(query);
     DataSet ds=db.GetPagingData("JournalSetInfo","SetID,JournalID,ApiSiteID,DBServerID,AddDate",orderBy,whereSQL,query.CurrentPage,query.PageSize,out recordCount);
     Pager<JournalSetInfoEntity>  pager=new Pager<JournalSetInfoEntity>();
     if(ds!=null && ds.Tables.Count>0)
     {
          pager.ItemList= MakeJournalSetInfoList(ds.Tables[0]);
     }
     pager.CurrentPage=query.CurrentPage;
     pager.PageSize=query.PageSize;
     pager.TotalRecords=recordCount;
     return pager;
 }
 public List<JournalSetInfoEntity> GetJournalSetInfoList(JournalSetInfoQuery query)
 {
     List<JournalSetInfoEntity> list = new List<JournalSetInfoEntity>();
     StringBuilder sqlCommandText = new StringBuilder();
     sqlCommandText.Append("SELECT SetID,JournalID,ApiSiteID,DBServerID,AddDate FROM dbo.JournalSetInfo WITH(NOLOCK)");
     string whereSQL = JournalSetInfoQueryToSQLWhere(query);
     string orderBy=JournalSetInfoQueryToSQLOrder(query);
     if(!string.IsNullOrEmpty(whereSQL)) sqlCommandText.Append(" WHERE " + whereSQL);
     if(!string.IsNullOrEmpty(orderBy)) sqlCommandText.Append(" ORDER BY " + orderBy);
     DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());
     using(IDataReader dr = db.ExecuteReader(cmd))
     {
         list = MakeJournalSetInfoList(dr);
     }
     return list;
 }
예제 #6
0
 /// <summary>
 /// 获取所有符合查询条件的数据
 /// </summary>
 /// <param name="journalSetInfoQuery">JournalSetInfoQuery查询实体对象</param>
 /// <returns>List<JournalSetInfoEntity></returns>
 public List<JournalSetInfoEntity> GetJournalSetInfoList(JournalSetInfoQuery journalSetInfoQuery)
 {
     return JournalSetInfoDataAccess.Instance.GetJournalSetInfoList(journalSetInfoQuery);
 }