Esempio n. 1
0
 public static string ConvertBinaryOperationToString(ComparisonOperator binaryOperation)
 {
     if (!Enum.IsDefined(typeof(ComparisonOperator), binaryOperation))
     {
         throw new ArgumentException("Unsupported binary operation.", nameof(binaryOperation));
     }
     return(binaryOperation.GetDescription());
 }
Esempio n. 2
0
        ///<summary>Creates a SQLParam that evaluates the specified column with regards to the specified value.</summary>
        public static SQLWhere Create <T>(string columnName, ComparisonOperator comparison, T value, bool doTreatDtAsDate = false, string tableName = "")
        {
            if (!string.IsNullOrEmpty(tableName))
            {
                columnName = tableName.ToLower() + "." + columnName;
            }
            SQLWhere sqlParam = new SQLWhere();

            sqlParam._whereClause = (doTreatDtAsDate ? DbHelper.DtimeToDate(columnName) : columnName)
                                    + comparison.GetDescription() + POutObj(value, doTreatDtAsDate);
            return(sqlParam);
        }