/// <summary> /// 根据条件分页获取列表 GetList(int currentPageIndex, int pageSize, out int totalCount, string strWhere, string orderBy) /// </summary> /// <param name="currentPageIndex">当前页码(int)</param> /// <param name="pageSize">分页大小(int)</param> /// <param name="totalCount">总记录数(out int)</param> /// <param name="strWhere">查询条件(string)</param> /// <param name="orderBy">排序字段(string)</param> /// <returns>返回List<CustomersInfo>类型数据,未查询到数据则返回null</returns> public List <DailyInfo> GetList(int currentPageIndex, int pageSize, out int totalCount, string strWhere, string orderBy) { if (!string.IsNullOrEmpty(strWhere)) { strWhere = " and " + strWhere; } return(SqlMethodHelper.Find(SqlHelper.GetPagingStoredProcedureParameters("XSBlog_Daily", "*", strWhere, orderBy, pageSize, currentPageIndex, 3), out totalCount, ReaderBind)); }
/// <summary> /// 获得树形列表 /// </summary> /// <returns></returns> public List <CategoryInfo> GetTreeList() { var strSql = new StringBuilder(); strSql.Append(" select Id, Guid, Name, parent_Guid, Order_Id, Image_Url, Image_Key, Blog_Guid, User_Guid "); strSql.Append(" from dbo.F_XSBlog_GetCategorys('00000000-0000-0000-0000-000000000000') "); strSql.Append(" order by order_id "); return(SqlMethodHelper.Find(strSql.ToString(), ReaderBind, null)); }
/// <summary> /// 根据条件分页获取列表 GetList(int currentPageIndex, int pageSize, out int totalCount, string strWhere, string orderBy) /// </summary> /// <param name="currentPageIndex">当前页码(int)</param> /// <param name="pageSize">分页大小(int)</param> /// <param name="totalCount">总记录数(out int)</param> /// <param name="strWhere">查询条件(string)</param> /// <param name="orderBy">排序字段(string)</param> /// <returns>返回List<CustomersInfo>类型数据,未查询到数据则返回null</returns> public List <UserInfo> GetList(int currentPageIndex, int pageSize, out int totalCount, string strWhere, string orderBy) { if (string.IsNullOrEmpty(strWhere)) { strWhere = " 1=1 "; } strWhere = string.IsNullOrEmpty(strWhere) ? "" : " AND " + strWhere; if (string.IsNullOrEmpty(orderBy)) { } return(SqlMethodHelper.Find(SqlHelper.GetPagingStoredProcedureParameters("XSBlog_User", "*", strWhere, orderBy, pageSize, currentPageIndex, 3), out totalCount, ReaderBind)); }
/// <summary> /// 获得前几条数据 /// </summary> /// <param name="count"></param> /// <param name="strWhere"></param> /// <param name="orderBy"></param> /// <returns></returns> public List <PhotoInfo> GetTopList(int count, string strWhere, string orderBy) { var strSql = new StringBuilder(); strSql.Append("select top " + count + " Id, Guid, Name, Tag, Image_Url, Image_Key, User_Guid, Album_Guid, Create_time, Is_Cover "); strSql.Append(" from XSBlog_Photo "); if (!string.IsNullOrEmpty(strWhere)) { strSql.Append(" where " + strWhere); } if (!string.IsNullOrEmpty(orderBy)) { strSql.Append(" order by " + orderBy); } return(SqlMethodHelper.Find(strSql.ToString(), ReaderBind, null)); }
/// <summary> /// 获得前几条数据 /// </summary> /// <param name="count"></param> /// <param name="strWhere"></param> /// <param name="orderBy"></param> /// <returns></returns> public List <DailyInfo> GetTopList(int count, string strWhere, string orderBy) { var strSql = new StringBuilder(); strSql.Append("select top " + count + " Id, Guid, Name, Content, Create_Time, Blog_Guid, User_Guid, Category_Guid, Is_Draft, Is_Stick, Is_Home, Is_Special, Page_View, Comments_Num "); strSql.Append(" from XSBlog_Daily "); if (!string.IsNullOrEmpty(strWhere)) { strSql.Append(" where " + strWhere); } if (!string.IsNullOrEmpty(orderBy)) { strSql.Append(" order by " + orderBy); } return(SqlMethodHelper.Find(strSql.ToString(), ReaderBind, null)); }
/// <summary> /// 根据条件获取列表 GetList(string strWhere,string orderBy=null) /// </summary> /// <param name="strWhere">strWhere</param> /// <param name="orderBy">orderBy</param> /// <returns>返回List(UserInfo)类型数据,未查询到数据则返回null</returns> public List <UserInfo> GetList(string strWhere, string orderBy = null) { var strSql = new StringBuilder(); strSql.Append("select Id, Guid, Name, Tag, Login_Name, Login_Pwd, Email "); strSql.Append(" from XSBlog_User "); if (!string.IsNullOrEmpty(strWhere)) { strSql.Append(" where " + strWhere); } if (string.IsNullOrEmpty(orderBy)) { } else { strSql.Append(" order by " + orderBy); } return(SqlMethodHelper.Find(strSql.ToString(), ReaderBind, null)); }
/// <summary> /// 根据条件获取列表 GetList(string strWhere,string orderBy=null) /// </summary> /// <param name="strWhere">strWhere</param> /// <param name="orderBy">orderBy</param> /// <returns>返回List(MoodInfo)类型数据,未查询到数据则返回null</returns> public List <MoodInfo> GetList(string strWhere, string orderBy = null) { var strSql = new StringBuilder(); strSql.Append("select Id, Guid, Name, Content, Create_Time, Blog_Guid, User_Guid "); strSql.Append(" from XSBlog_Mood "); if (!string.IsNullOrEmpty(strWhere)) { strSql.Append(" where " + strWhere); } if (string.IsNullOrEmpty(orderBy)) { } else { strSql.Append(" order by " + orderBy); } return(SqlMethodHelper.Find(strSql.ToString(), ReaderBind, null)); }
/// <summary> /// 根据条件获取列表 GetList(string strWhere,string orderBy=null) /// </summary> /// <param name="strWhere">strWhere</param> /// <param name="orderBy">orderBy</param> /// <returns>返回List(CategoryInfo)类型数据,未查询到数据则返回null</returns> public List <CategoryInfo> GetList(string strWhere, string orderBy = null) { var strSql = new StringBuilder(); strSql.Append("select Id, Guid, Name ,Order_Id, Blog_Guid, User_Guid, Image_Url, Image_Key, Parent_Guid "); strSql.Append(" from XSBlog_Category "); if (!string.IsNullOrEmpty(strWhere)) { strSql.Append(" where " + strWhere); } if (string.IsNullOrEmpty(orderBy)) { } else { strSql.Append(" order by " + orderBy); } return(SqlMethodHelper.Find(strSql.ToString(), ReaderBind, null)); }