Exemple #1
0
        public ODAColumns NullDefault(ODAColumns Col, object DefVal)
        {
            Dictionary <ODAColumns, object> WhenThen = new Dictionary <ODAColumns, object>();

            WhenThen.Add(Col.IsNull, DefVal);
            return(this.CaseWhen(WhenThen, Col));
        }
Exemple #2
0
 public ODAColumns NotIn(ODACmd Cmd, ODAColumns Col)
 {
     if (Cmd == null || System.Object.ReferenceEquals(Col, null))
     {
         throw new ODAException(20014, "Cmd and Col Args Can't be null");
     }
     _InColumn = Col;
     _InCmd    = Cmd;
     return(SetCondition(CmdConditionSymbol.NOTIN, null));
 }
Exemple #3
0
 /// <summary>
 /// 查询语句 case 函数
 /// </summary>
 /// <param name="CaseColumn">用作比对的字段</param>
 /// <param name="WhenThen">当case字段为key值时,则使用value值</param>
 /// <param name="ElseVal">所有WhenThen的key值都不满足时,使用ElseVal值</param>
 /// <returns></returns>
 public ODAColumns Case(ODAColumns CaseColumn, Dictionary <object, object> WhenThen, object ElseVal)
 {
     if (WhenThen == null)
     {
         throw new ODAException(40001, "Param WhenThen can not be NULL");
     }
     _CaseCol     = CaseColumn;
     _CaseThen    = WhenThen;
     _CaseElseVal = ElseVal;
     _FuncType    = Func.Case;
     _FuncName    = "";
     return(this);
 }
Exemple #4
0
        public ODAColumns Decode(ODAColumns Col, object DefVal, params object[] KeyValue)
        {
            if (KeyValue == null || KeyValue.Length % 2 != 0)
            {
                throw new ODAException(40003, "Decode Method ,params [KeyValue] duable case ");
            }
            Dictionary <object, object> TrueVale = new Dictionary <object, object>();

            for (int i = 0; i < KeyValue.Length; i += 2)
            {
                TrueVale.Add(KeyValue[i], KeyValue[i + 1]);
            }
            return(this.Case(Col, TrueVale, DefVal));
        }