예제 #1
0
        /// <summary>
        /// 带有自动表示的主键的分页获取数据列表
        /// </summary>
        /// <param name="Order_Field">排序字段</param>
        /// <param name="OrderType">排序类型(1:升序 0:降序)</param>
        /// <param name="PageSize">页大小</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="strWhere">查询条件</param>
        /// <returns>DataTable</returns>
        public static DataTable GetDataByPagerQueryParamWithPriKey(PagerQueryParam pager)
        {
            DataTable dt = new DataTable();

            try
            {
                SqlConnection sqlConn = new SqlConnection();
                SqlCommand    sqlCmd  = new SqlCommand();
                sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings");
                DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "procpagwithprikey");
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Table_Name", pager.TableName, SqlDbType.VarChar, 1000);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Primary_Key", pager.PrimaryKey, SqlDbType.VarChar, 1000);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Show_Fields", pager.ShowFields, SqlDbType.VarChar, 8000);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Order_Field", pager.OrderField, SqlDbType.VarChar, 1000);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@OrderType", pager.OrderType.ToString(), SqlDbType.VarChar, 1000);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@where_Condition", pager.StrWhere, SqlDbType.VarChar, 4000);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Page_Size", pager.PageSize.ToString(), SqlDbType.Int, 200);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@Page_Index", pager.PageIndex.ToString(), SqlDbType.Int, 200);
                dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd);
                sqlConn.Close();
            }
            catch (Exception)
            {
                throw;
            }
            return(dt);
        }
예제 #2
0
 internal static void Paging(DataTable dt, YYControls.SmartGridView GridView1, PagerQueryParam pager_pro, Panel NoDataPanel)
 {
     throw new NotImplementedException();
 }