Habanero.BO.CriteriaManager.Parameter.GetSqlStringWithNoParameters C# (CSharp) Метод

GetSqlStringWithNoParameters() приватный Метод

Returns the parameter value in valid sql format
private GetSqlStringWithNoParameters ( ) : string
Результат string
        internal string GetSqlStringWithNoParameters()
        {
            string strOp = _sqlOperator.ToUpper().Trim();
            if (strOp == "IS" || strOp == "IS NOT" || strOp == "NOT IS")
            {
                return _parameterValue.ToUpper(); //return either NULL or NOT NULL 
            }
            if (strOp == "IN" || strOp == "NOT IN")
            {
                return _parameterValue;
            }
            return "";
        }

Usage Example

Пример #1
0
 public void TestGetSqlStringWithNoParameters()
 {
     Parameter param = new Parameter("prop", "table", "field", "=", "value", ParameterType.String);
     Assert.AreEqual("", param.GetSqlStringWithNoParameters());
 }