Example #1
0
 public static void ExecNonQuery(this IQueryArgs args, string Command)
 {
     if (args.GetType() == typeof(Query.QueryArgs))
     {
         using (Query sql = new Query(args as Query.QueryArgs)) sql.ExecNonQuery(Command);
     }
     //else if (args.GetType() == typeof(QueryMy.QueryArgs))
     //    using (QueryMy sql = new QueryMy(args as QueryMy.QueryArgs)) sql.ExecNonQuery(Command);
 }
Example #2
0
 public static void ExecNonQuery(this IQueryArgs args, string Command, string[] Parameters, object[] values, CommandType type = CommandType.StoredProcedure)
 {
     if (args.GetType() == typeof(Query.QueryArgs))
     {
         using (Query sql = new Query(args as Query.QueryArgs)) sql.ExecNonQuery(Command, Parameters, values, type);
     }
     //else if (args.GetType() == typeof(QueryMy.QueryArgs))
     //    using (QueryMy sql = new QueryMy(args as QueryMy.QueryArgs)) sql.ExecNonQuery(Command, Parameters, values, type);
 }
Example #3
0
 public static void TestConnect(this IQueryArgs args)
 {
     if (args.GetType() == typeof(Query.QueryArgs))
     {
         using (Query sql = new Query(args as Query.QueryArgs)) { }
     }
     //else if (args.GetType() == typeof(QueryMy.QueryArgs))
     //    using (QueryMy sql = new QueryMy(args as QueryMy.QueryArgs)) { }
 }
Example #4
0
 public static DataTable TableQuery(this IQueryArgs args, string Command)
 {
     if (args.GetType() == typeof(Query.QueryArgs))
     {
         using (Query sql = new Query(args as Query.QueryArgs)) return(sql.TableQuery(Command));
     }
     else
     {
         return(null);
     }
 }
Example #5
0
 public static T ExecScalar <T>(this IQueryArgs args, string Command, params object[] values) where T : class
 {
     if (args.GetType() == typeof(Query.QueryArgs))
     {
         using (Query sql = new Query(args as Query.QueryArgs)) return(sql.ExecScalar <T>(Command, values));
     }
     //else if (args.GetType() == typeof(QueryMy.QueryArgs))
     //    using (QueryMy sql = new QueryMy(args as QueryMy.QueryArgs)) return sql.ExecScalar<T>(Command, values);
     else
     {
         return(null);
     }
 }
Example #6
0
 public static DataSet ExecQuery(this IQueryArgs args, string Command)
 {
     if (args.GetType() == typeof(Query.QueryArgs))
     {
         using (Query sql = new Query(args as Query.QueryArgs)) return(sql.ExecQuery(Command));
     }
     //else if (args.GetType() == typeof(QueryMy.QueryArgs))
     //    using (QueryMy sql = new QueryMy(args as QueryMy.QueryArgs)) return sql.ExecQuery(Command);
     else
     {
         return(null);
     }
 }
Example #7
0
 public static T ExecScalar <T>(this IQueryArgs args, string Command, string[] Parameters, object[] values, CommandType type = CommandType.StoredProcedure) where T : class
 {
     if (args.GetType() == typeof(Query.QueryArgs))
     {
         using (Query sql = new Query(args as Query.QueryArgs)) return(sql.ExecScalar <T>(Command, Parameters, values, type));
     }
     //else if (args.GetType() == typeof(QueryMy.QueryArgs))
     //    using (QueryMy sql = new QueryMy(args as QueryMy.QueryArgs)) return sql.ExecScalar<T>(Command, Parameters, values, type);
     else
     {
         return(null);
     }
 }
Example #8
0
 public static void ExecNonQuery(this string query, string[] parameters, object[] values, IQueryArgs args, CommandType type = CommandType.StoredProcedure)
 {
     args.ExecNonQuery(query, parameters, values, type);
 }
Example #9
0
 public static void ExecNonQuery(this string query, IQueryArgs args)
 {
     args.ExecNonQuery(query);
 }
Example #10
0
 public static T ExecScalar <T>(this string query, string[] parameters, object[] values, IQueryArgs args, CommandType type = CommandType.StoredProcedure) where T : class
 {
     return(args.ExecScalar <T>(query, parameters, values, type));
 }
Example #11
0
 public static DataSet ExecQuery(this string query, IQueryArgs args)
 {
     return(args.ExecQuery(query));
 }
Example #12
0
 public QueryFire(IQueryArgs args)
 {
     Conn = new SqlConnection(args.GetConnectionString());
     this.CancellationToken = new CancellationTokenSource().Token;
 }
Example #13
0
 public static object ExecScalar(this string query, IQueryArgs args)
 {
     return(args.ExecScalar(query));
 }
Example #14
0
 public static DataTable TableQuery(this string query, IQueryArgs args)
 {
     return(args.TableQuery(query));
 }
Example #15
0
        //[Obsolete]
        //public static DataTable FillTable(this string query, IQueryArgs args)
        //{
        //    return query.ExecQuery(args).Tables[0] as DataTable;
        //}

        //[Obsolete]
        //public static DataTable Filltable(this IQueryArgs args, string Command)
        //{
        //    return Command.FillTable(args);
        //}

        public static SqlConnection Connection(this IQueryArgs args)
        {
            return(new SqlConnection(args.GetConnectionString()));
        }
Example #16
0
 public Query(IQueryArgs QArgs)
 {
     this.mArgs = QArgs as QueryArgs;
 }
Example #17
0
 public static T ExecScalar <T>(this string query, IQueryArgs args) where T : class
 {
     return(args.ExecScalar <T>(query));
 }
Example #18
0
 public QueryFire(IQueryArgs args, CancellationToken cancellationToken) : this(args)
 {
     this.CancellationToken = cancellationToken;
 }
Example #19
0
 public ZTable(IQueryArgs args, string tablename, bool UseViewForSelect = true) : this(new SqlConnection((args as Query.QueryArgs).GetConnectionString()), tablename, UseViewForSelect)
 {
 }