Esempio n. 1
0
 public override string ToString()
 {
     return(String.Format("{0}, {1}, {2}",
                          StartNumber.ToString().PadLeft(3),
                          _rawCrew.crewName, // String.Join(",", ClubIndices),
                          CategoryName.PadRight(26)));
 }
Esempio n. 2
0
 public override string ToString()
 {
     if (StreetNumberIsNumber)
     {
         if (StartNumber != EndNumber)
         {
             return($"{StartNumber}-{EndNumber}");
         }
         else
         {
             return(StartNumber.ToString());
         }
     }
     else
     {
         return(NonNumberStreetNumber);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// 分页查询返回DATASET
        /// </summary>
        /// <param name="TableName">需要查询的表名</param>
        /// <param name="Fields">需要返回的列(所以列*)</param>
        /// <param name="PageSize">页容量(每页显示页的数量)</param>
        /// <param name="PageIndex">当前页</param>
        /// <param name="Where">查询条件(Id=Id)</param>
        /// <param name="OrderBy">排序(ID desc)</param>
        /// <returns></returns>
        public static DataSet Table_List(string TableName, string OrderBy, string Fields, int PageSize, int PageIndex, string Where)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@TableName", SqlDbType.VarChar,  20),
                new SqlParameter("@Fields",    SqlDbType.VarChar, 500),
                new SqlParameter("@Where",     SqlDbType.VarChar, 500),
                new SqlParameter("@OrderBy",   SqlDbType.VarChar, 200),
                new SqlParameter("@PageSize",  SqlDbType.Int),
                new SqlParameter("@PageIndex", SqlDbType.Int)
            };
            parameters[0].Value = TableName;
            parameters[1].Value = Fields;
            parameters[2].Value = Common.LCommon.ClearSql(Where);
            parameters[3].Value = OrderBy;
            parameters[4].Value = PageSize;
            parameters[5].Value = PageIndex;

            //return DbHelperSQL.RunProcedure("Table_List", parameters, "ds");
            //不调用存储过程直接执行查询语句
            string Row        = "";
            string TableWhere = parameters[0].SqlValue.ToString();
            int    StartNumber;
            int    EndNumber;

            if (!String.IsNullOrEmpty(parameters[2].SqlValue.ToString()))
            {
                TableWhere = parameters[0].SqlValue.ToString() + " where " + parameters[2].SqlValue.ToString();
            }

            if (parameters[4].SqlValue.ToString() != "0")
            {
                StartNumber = (Int32.Parse(parameters[5].SqlValue.ToString()) - 1) * Int32.Parse(parameters[4].SqlValue.ToString()) + 1;
                EndNumber   = (Int32.Parse(parameters[5].SqlValue.ToString()) - 1) * Int32.Parse(parameters[4].SqlValue.ToString()) + Int32.Parse(parameters[4].SqlValue.ToString());
                Row         = " where Row between " + StartNumber.ToString() + " and " + EndNumber.ToString();
            }
            return(DbHelperSQL.Query("with temptbl AS (SELECT ROW_NUMBER() OVER (ORDER BY " + parameters[3].SqlValue.ToString() + ")AS Row, " + parameters[1].SqlValue.ToString() + " FROM " + TableWhere + ") SELECT * FROM temptbl" + Row));
        }