Example #1
0
        public virtual DataTable GetListByPage_1(Hashtable ht, string fileds, out int RowCount, bool IsPage = true, string Where = "")// string TableName, string strWhere, string orderby, int startIndex, int endIndex, SqlParameter[] parms4org)
        {
            RowCount = 0;
            SqlParameter[] parms4org  = { };
            int            StartIndex = 0;
            int            EndIndex   = 0;

            if (IsPage)
            {
                StartIndex = Convert.ToInt32(ht["StartIndex"].ToString());
                EndIndex   = Convert.ToInt32(ht["EndIndex"].ToString());
            }
            try
            {
                string order = "";
                if (ht.ContainsKey("Order") && !string.IsNullOrWhiteSpace(Convert.ToString(ht["Order"])))
                {
                    order = ht["Order"].ToString();
                }
                DataTable dt = SQLHelp.GetListByPage_1((string)ht["TableName"], fileds, Where, order, StartIndex, EndIndex, IsPage, parms4org, out RowCount);

                //DataTable dt = SQLHelp.GetListByPage(ht, parms4org);
                return(dt);
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                //写入日志
                //throw;
                return(null);
            }
        }