Пример #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);
 }
Пример #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);
 }
Пример #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)) { }
 }
Пример #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);
     }
 }
Пример #5
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);
     }
 }
Пример #6
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);
     }
 }
Пример #7
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);
     }
 }