Пример #1
0
 private string Values(
     IEnumerable <string> valueCollection,
     SqlContainer sqlContainer,
     SqlCommand sqlCommand,
     int?commandCount)
 {
     if (Select == null)
     {
         return("values(" + valueCollection.Join() + "); ");
     }
     else
     {
         if (AddUpdatorParam)
         {
             Select.SqlColumnCollection.InsertRange(0, new List <SqlColumn>
             {
                 new SqlColumn("@_U as [Creator]"),
                 new SqlColumn("@_U as [Updator]")
             });
         }
         return(Select.GetCommandText(
                    sqlContainer: sqlContainer,
                    sqlCommand: sqlCommand,
                    prefix: "_sub",
                    commandCount: commandCount));
     }
 }
Пример #2
0
 private IEnumerable <string> Left(
     ISqlObjectFactory factory,
     SqlContainer sqlContainer,
     ISqlCommand sqlCommand,
     int?commandCount)
 {
     if (SubLeft != null)
     {
         return(new List <string>
         {
             "(" + SubLeft.GetCommandText(
                 factory: factory,
                 sqlContainer: sqlContainer,
                 sqlCommand: sqlCommand,
                 prefix: SubPrefix
                     ? "_sub"
                     : null,
                 commandCount: commandCount) + ")"
         });
     }
     else
     {
         return(ColumnBrackets);
     }
 }
Пример #3
0
        private string Sql_Sub(
            SqlContainer sqlContainer,
            SqlCommand sqlCommand,
            IEnumerable <string> left,
            string tableBracket,
            int?commandCount,
            bool select)
        {
            var commandText = Sub.GetCommandText(
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand,
                prefix: SubPrefix
                    ? "_sub"
                    : null,
                commandCount: commandCount);

            return(left != null
                ? left.Select(columnBracket =>
                              TableAndColumnBracket(
                                  tableBracket : tableBracket,
                                  columnBracket : columnBracket,
                                  select : select) +
                              Operator +
                              "(" + commandText + ")")
                   .Join(MultiColumnOperator)
                   : Value == null
                    ? "(" + commandText + ")"
                   : "(" + commandText + Operator + Value + ")");
        }
Пример #4
0
        private string Sql_Sub(
            SqlContainer sqlContainer,
            SqlCommand sqlCommand,
            IEnumerable <string> left,
            Sqls.TableTypes tableType,
            int?commandCount)
        {
            var commandText = Sub.GetCommandText(
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand,
                prefix: "_sub",
                commandCount: commandCount);

            return(left != null
                ? left.Select(columnBracket =>
                              Sqls.TableAndColumnBracket(
                                  tableName : TableName,
                                  tableType : tableType,
                                  columnBracket : columnBracket) +
                              Operator +
                              "(" + commandText + ")")
                   .Join(MultiColumnOperator)
                   : Value == null
                    ? "(" + commandText + ")"
                   : "(" + commandText + Operator + Value + ")");
        }
Пример #5
0
 private string Values(
     ISqlObjectFactory factory,
     IEnumerable <string> valueCollection,
     SqlContainer sqlContainer,
     ISqlCommand sqlCommand,
     int?commandCount)
 {
     if (Select == null)
     {
         return("values(" + valueCollection.Join() + ")" +
                factory.SqlCommandText.CreateSelectStatementTerminator(SelectIdentity) +
                " ");
     }
     else
     {
         if (AddUpdatorParam)
         {
             Select.SqlColumnCollection.InsertRange(0, new List <SqlColumn>
             {
                 new SqlColumn($"{Parameters.Parameter.SqlParameterPrefix}U as \"Creator\""),
                 new SqlColumn($"{Parameters.Parameter.SqlParameterPrefix}U as \"Updator\"")
             });
         }
         return(Select.GetCommandText(
                    factory: factory,
                    sqlContainer: sqlContainer,
                    sqlCommand: sqlCommand,
                    prefix: "_sub",
                    commandCount: commandCount));
     }
 }
Пример #6
0
 private string Sql_Sub(
     SqlContainer sqlContainer,
     SqlCommand sqlCommand,
     string orderType)
 {
     return("(" + Sub.GetCommandText(
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand) + ")"
            + orderType);
 }
Пример #7
0
 private string Sql_Sub(SqlContainer sqlContainer, SqlCommand sqlCommand, int?commandCount)
 {
     return("(" + Sub.GetCommandText(
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand,
                prefix: "_sub",
                commandCount: commandCount) + ")" +
            (As != null
                 ? " as [" + As + "]"
                 : string.Empty));
 }
Пример #8
0
 private string Sql_Sub(
     ISqlObjectFactory factory,
     SqlContainer sqlContainer,
     ISqlCommand sqlCommand,
     string orderType)
 {
     return("(" + Sub.GetCommandText(
                factory: factory,
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand) + ")"
            + orderType);
 }
Пример #9
0
 private string Sql_Sub(
     ISqlObjectFactory factory,
     SqlContainer sqlContainer,
     ISqlCommand sqlCommand,
     int?commandCount)
 {
     return("(" + Sub.GetCommandText(
                factory: factory,
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand,
                prefix: SubPrefix
             ? "_sub"
             : null,
                commandCount: commandCount) + ")" +
            (As != null
                 ? " as \"" + As + "\""
                 : string.Empty));
 }
Пример #10
0
        private string Sql_Sub(
            SqlContainer sqlContainer,
            SqlCommand sqlCommand,
            Sqls.TableTypes tableType,
            int?commandCount)
        {
            var commandText = Sub.GetCommandText(
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand,
                prefix: "_sub",
                commandCount: commandCount);

            return(ColumnBracket != null
                ? Functions(tableType) + Operator + "(" + commandText + ")"
                : Value == null
                    ? "(" + commandText + ")"
                    : "(" + commandText + Operator + Value + ")");
        }
Пример #11
0
        private string Sql_Sub(
            SqlContainer sqlContainer,
            SqlCommand sqlCommand,
            string tableBracket,
            int?commandCount)
        {
            var commandText = Sub.GetCommandText(
                sqlContainer: sqlContainer,
                sqlCommand: sqlCommand,
                prefix: SubPrefix
                    ? "_sub"
                    : string.Empty,
                commandCount: commandCount);

            return(ColumnBracket != null
                ? Functions(tableBracket) + Operator + "(" + commandText + ")"
                : Value == null
                    ? "(" + commandText + ")"
                    : "(" + commandText + Operator + Value + ")");
        }
Пример #12
0
 private IEnumerable <string> Left(
     SqlContainer sqlContainer,
     SqlCommand sqlCommand,
     int?commandCount)
 {
     if (SubLeft != null)
     {
         return(new List <string>
         {
             "(" + SubLeft.GetCommandText(
                 sqlContainer: sqlContainer,
                 sqlCommand: sqlCommand,
                 prefix: "_sub",
                 commandCount: commandCount) + ")"
         });
     }
     else
     {
         return(ColumnBrackets);
     }
 }