DB.cs 879 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. namespace Aitex.Core.RT.DBCore
  7. {
  8. public static class DB
  9. {
  10. public static ICommonDB Instance { set; private get; }
  11. public static void Insert(string sql)
  12. {
  13. if (Instance != null)
  14. Instance.Insert(sql);
  15. }
  16. public static void CreateTableIfNotExisted(string table, Dictionary<string, Type> columns, bool addPID, string primaryKey)
  17. {
  18. if (Instance != null)
  19. Instance.CreateTableIfNotExisted(table, columns, addPID, primaryKey);
  20. }
  21. public static DataSet ExecuteDataset(string cmdText, params object[] p)
  22. {
  23. if (Instance != null)
  24. return Instance.ExecuteDataset(cmdText, p);
  25. return null;
  26. }
  27. }
  28. }