/// <summary> /// 开始监听 /// </summary> public static string StartListen(string SqlText) { if (DictListen == null) { DictListen = new Dictionary <string, string>(); } DBConnection dbConn = DBConfig.GetDBConnection(ClientCode, DbName); OracleDependency dep = DataClient.CreateDependency(dbConn.ConnectionString, SqlText); dep.OnChange += new OnChangeEventHandler(Data_OnChange); DictListen.Add(dep.Id, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); DataClient.BeginListen(dep.Id); return(dep.Id); }
/// <summary> /// 批量执行非查询SQL语句 /// </summary> /// <param name="ClientCode">客户端代码</param> /// <param name="DbName">数据库名称</param> /// <param name="TransID">事务ID</param> /// <param name="SqlText">Sql 文本</param> /// <param name="BatchParams">Sql 参数数组,参数值所在位置必须与参数名一致</param> /// <returns>返回影响的数据行</returns> public static int BatchExecute(string SqlText, List <object>[] BatchParams, string TransID = "") { DBConnection dbConn = DBConfig.GetDBConnection(ClientCode, DbName); return(DataClient.BatchExecute(TransID, dbConn.ConnectionString, SqlText, BatchParams)); }
/// <summary> /// 执行非查询SQL语句 /// </summary> /// <param name="ClientCode">客户端代码</param> /// <param name="DbName">数据库名称</param> /// <param name="TransID">事务ID</param> /// <param name="SqlText">Sql 文本</param> /// <param name="SqlParams">Sql 参数,参数值所在位置必须与参数名一致</param> /// <returns>返回影响的数据行</returns> public static int Execute(string SqlText, object[] SqlParams = null, string TransID = "") { DBConnection dbConn = DBConfig.GetDBConnection(ClientCode, DbName); return(DataClient.Execute(TransID, dbConn.ConnectionString, SqlText, SqlParams)); }
/// <summary> /// 批量执行存储过程 /// </summary> /// <param name="StrConn"></param> /// <param name="ProcedureName"></param> /// <param name="InputParams"></param> /// <param name="OutputParams"></param> /// <param name="TransID"></param> /// <returns></returns> public static List <Dictionary <string, object> > BatchExecuteProcedure(string StrConn, string ProcedureName, List <Dictionary <string, object> > Param, string TransID = "") { DBConnection dbConn = DBConfig.GetDBConnection(ClientCode, DbName); return(DataClient.BatchExecuteProcedure(TransID, StrConn, ProcedureName, Param)); }
/// <summary> /// 创建监听 /// </summary> /// <param name="StrConn">连接字符串</param> /// <param name="SqlText">监听Sql</param> /// <returns></returns> public static OracleDependency CreateDependency(string SqlText) { DBConnection dbConn = DBConfig.GetDBConnection(ClientCode, DbName); return(DataClient.CreateDependency(dbConn.ConnectionString, SqlText)); }