| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 | using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;namespace Aitex.Core.RT.DBCore{    public static class DB    {        public static ICommonDB Instance { set; private get; }        public static void Insert(string sql)        {            if (Instance != null)                Instance.Insert(sql);        }        public static int SyncUpdate(string sql)        {            if (Instance != null)                return Instance.SyncUpdate(sql);            else                return 0;        }        public static void Update(string sql)        {            if (Instance != null)                Instance.Update(sql);        }        public static int SyncInsert(string sql)        {            if (Instance != null)                return Instance.SyncInsert(sql);            else                return 0;        }        public static void CreateTableIfNotExisted(string table, Dictionary<string, Type> columns, bool addPID, string primaryKey)        {            if (Instance != null)                Instance.CreateTableIfNotExisted(table, columns, addPID, primaryKey);        }        public static void CreateTableIndexIfNotExisted(string table, string index, string sql)        {            if (Instance != null)                Instance.CreateTableIndexIfNotExisted(table, index, sql);        }        public static void CreateTableColumn(string table, Dictionary<string, Type> columns)        {            if (Instance != null)                Instance.CreateTableColumn(table, columns);        }        public static DataSet ExecuteDataset(string cmdText, params object[] p)        {            if (Instance != null)                return Instance.ExecuteDataset(cmdText, p);            return null;        }    }}
 |