Exemplo n.º 1
0
 public SqlWhere(string tableName, string fieldName, object value, SqlWhereComparison.SqlComparer comparator)
 {
     this.MockTableName = tableName;
     this.MockFieldName = fieldName;
     this.MockValue = value;
     this.MockComparator = SqlWhereComparison.GetSqlComparor(comparator);
     MockInitialization = true;
 }
Exemplo n.º 2
0
 public SqlWhere(string tableName, string fieldName, object value, SqlWhereComparison.SqlComparer comparator)
 {
     this.MockTableName  = tableName;
     this.MockFieldName  = fieldName;
     this.MockValue      = value;
     this.MockComparator = SqlWhereComparison.GetSqlComparor(comparator);
     MockInitialization  = true;
 }
Exemplo n.º 3
0
 public SqlWhere AddWhereParameter(SqlWhereAndorOptions.SqlWhereAndor andor, SqlField field, object fieldValue1, object fieldValue2, SqlWhereComparison.SqlComparer comparator)
 {
     SqlWhere newwhere = new SqlWhere(ref Tables, ref Fields);
     newwhere.Andor = SqlWhereAndorOptions.GetSqlwhereandor(andor);
     newwhere.Field = field;
     newwhere.Value1 = fieldValue1;
     newwhere.Value2 = fieldValue2;
     newwhere.Comparator = SqlWhereComparison.GetSqlComparor(comparator);
     InnerWheres.Add(newwhere);
     return newwhere;
 }
Exemplo n.º 4
0
        public SqlWhere AddWhereParameter(SqlWhereAndorOptions.SqlWhereAndor andor, SqlField field, object fieldValue1, object fieldValue2, SqlWhereComparison.SqlComparer comparator)
        {
            SqlWhere newwhere = new SqlWhere(ref Tables, ref Fields);

            newwhere.Andor      = SqlWhereAndorOptions.GetSqlwhereandor(andor);
            newwhere.Field      = field;
            newwhere.Value1     = fieldValue1;
            newwhere.Value2     = fieldValue2;
            newwhere.Comparator = SqlWhereComparison.GetSqlComparor(comparator);
            InnerWheres.Add(newwhere);
            return(newwhere);
        }
Exemplo n.º 5
0
        public SqlWhere AddWhereParameter(SqlWhereAndorOptions.SqlWhereAndor andOR, string fieldName, string tableName, List <object> inValues)
        {
            SqlField field    = FindOrGenerateField(fieldName, BaseTable);
            SqlWhere newwhere = new SqlWhere(ref Tables, ref Fields);

            newwhere.Andor = SqlWhereAndorOptions.GetSqlwhereandor(andOR);
            newwhere.Field = field;

            newwhere.InList = inValues;

            newwhere.Comparator = SqlWhereComparison.GetSqlComparor(SqlWhereComparison.SqlComparer.In);

            Wheres.Add(newwhere);
            return(newwhere);
        }
Exemplo n.º 6
0
        public SqlWhere AddSubWhere(SqlWhereAndorOptions.SqlWhereAndor andOr, SqlField field, object fieldValue1, object fieldValue2, SqlWhereComparison.SqlComparer comparator)
        {
            SqlWhere newwhere = new SqlWhere(ref Tables, ref Fields);

            newwhere.Andor      = SqlWhereAndorOptions.GetSqlwhereandor(andOr);
            newwhere.Field      = field;
            newwhere.Value1     = fieldValue1;
            newwhere.Value2     = fieldValue2;
            newwhere.Comparator = SqlWhereComparison.GetSqlComparor(comparator);
            if (newwhere.Comparator == "<>" && fieldValue1 == null)
            {
                newwhere.Comparator = "IS NOT";
            }
            Wheres[Wheres.Count - 1].InnerWheres.Add(newwhere);
            return(newwhere);
        }
Exemplo n.º 7
0
        public SqlWhere AddWhereParameter(SqlWhereAndorOptions.SqlWhereAndor andor, string tableName, string fieldName, object fieldValue, object fieldValue2, SqlWhereComparison.SqlComparer comparator)
        {
            foreach (SqlField field in Fields)
            {
                if (field.Name == fieldName.ToUpper() && field.Table.Name == tableName.ToUpper())
                {
                    return AddWhereParameter(andor, field, fieldValue, fieldValue2, comparator);
                }
            }

            foreach (SqlTable table in Tables)
            {
                if (table.Name == tableName.ToUpper())
                {
                    SqlField newfield = new SqlField(fieldName.ToUpper(), null, null, table, false, false);
                    return AddWhereParameter(andor, newfield, fieldValue, fieldValue2, comparator);
                }
            }

            return null;
        }
Exemplo n.º 8
0
 public SqlWhere AddWhereParameter(SqlWhereAndorOptions.SqlWhereAndor andor, SqlField field, object fieldValue, SqlWhereComparison.SqlComparer comparator)
 {
     return AddWhereParameter(andor, field, fieldValue, null, comparator);
 }
Exemplo n.º 9
0
 public SqlWhere AddWhereParameter(string tableName, string fieldName, object fieldValue, SqlWhereComparison.SqlComparer comparator)
 {
     return AddWhereParameter(SqlWhereAndorOptions.SqlWhereAndor.And, tableName, fieldName, fieldValue, null, comparator);
 }
Exemplo n.º 10
0
 public void AddWhereParameter(SqlWhere whereObject)
 {
     if (whereObject.MockInitialization)
     {
         AddWhereParameter(whereObject.MockTableName, whereObject.MockFieldName, whereObject.MockValue, SqlWhereComparison.ParseComparer(whereObject.MockComparator));
     }
 }