Example #1
0
        /// <summary>
        /// 添加排序SQL到Hashtable条件中
        /// </summary>
        /// <param name="condtion"></param>
        /// <param name="orderColl"></param>
        protected void AddOrderPropertyCondition(Hashtable condtion, NameValueCollection orderColl)
        {
            string orderSql = DaoHelper.CreateOrderSql(orderColl, _orderPropertyColumnMap);

            if (string.IsNullOrEmpty(orderSql))
            {
                orderSql = DaoHelper.CreateOrderSql(DefaultOrderCollection, _orderPropertyColumnMap);
            }

            if (string.IsNullOrEmpty(orderSql))
            {
                return;
            }
            if (condtion == null)
            {
                condtion = new Hashtable();
            }

            if (condtion.ContainsKey(SqlMapConstants.OrderPropertyParam))
            {
                throw new DaoException("Dao查询条件Hashtable中不能定义键名为" + SqlMapConstants.OrderPropertyParam + ",与查询条件键字冲突。");
            }

            condtion.Add(SqlMapConstants.OrderPropertyParam, orderSql);
        }
Example #2
0
 /// <summary>
 /// 生成排序SQL语句
 /// </summary>
 /// <param name="orderProperty">排序集合</param>
 /// <returns>生成排序Sql语句</returns>
 protected string CreateOrderSql(NameValueCollection orderProperty)
 {
     return(DaoHelper.CreateOrderSql(orderProperty, _orderPropertyColumnMap));
 }