示例#1
0
        public string MakeOrder()
        {
            string strOrder = " ORDER BY ";

            int iCount      = 0;
            int iOrderCount = hsOrder.Count;

            if (0 == iOrderCount)
            {
                return("");
            }

            foreach (DictionaryEntry de in hsOrder)
            {
                strOrder += de.Key.ToString() + " " +
                            QueryOperationSign.GetOrderOperationString((QueryOperationSign.OrderOperation)de.Value);

                iCount++;
                if (iCount != iOrderCount)
                {
                    strOrder += ",";
                }
            }

            return(strOrder);
        }
示例#2
0
        public override string MakeCondition(ArrayList lstSqlParamete)
        {
            string strAllCondition = base.MakeCondition(lstSqlParamete);

            string strGroup = "(" + queryCondition.MakeCondition(lstSqlParamete) + ")";

            if (null != base.queryCondition)
            {
                strGroup += QueryOperationSign.GetConditionOperationString(condition);
            }

            return(strGroup + strAllCondition);
        }
示例#3
0
        public override string MakeCondition(ArrayList lstSqlParamete)
        {
            string strAllCondition = base.MakeCondition(lstSqlParamete);

            string strCondition = String.Empty;
            // 取逻辑运算字符串
            string strLogic = QueryOperationSign.GetLogicOperationString(logic);

            switch (logic)
            {
            // NULL 逻辑
            case QueryOperationSign.LogicOperation.IsNull:
            case QueryOperationSign.LogicOperation.IsNotNull:
                strCondition += strFieldName + strLogic;
                break;

            // LIKE 逻辑
            case QueryOperationSign.LogicOperation.Like:
                strCondition += strFieldName + strLogic + "'%' + " + "@" + strFieldName + " + '%'";
                lstSqlParamete.Add(new SqlParameter("@" + strFieldName, this.Value));
                break;

            case QueryOperationSign.LogicOperation.LeftLike:
                strCondition += strFieldName + strLogic + "'%' + " + "@" + strFieldName;
                lstSqlParamete.Add(new SqlParameter("@" + strFieldName, this.Value));
                break;

            case QueryOperationSign.LogicOperation.RightLike:
                strCondition += strFieldName + strLogic + "@" + strFieldName + " + '%'";
                lstSqlParamete.Add(new SqlParameter("@" + strFieldName, this.Value));
                break;

            // 其它逻辑
            default:
                strCondition += strFieldName + strLogic + "@" + strFieldName;
                lstSqlParamete.Add(new SqlParameter("@" + strFieldName, this.Value));
                break;
            }

            if (null != base.queryCondition)
            {// 加上条件运算符
                strCondition += QueryOperationSign.GetConditionOperationString(this.condition);
            }

            return(strCondition + strAllCondition);
        }