public static ApplicationRelation GetApplicationRelationById(Guid appid) { ApplicationRelation info = null; IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationRelation dp = DataProvider.DbApplicationRelationDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; info = dp.GetApplicationRelationById(cmd, appid); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("GetApplicationRelationById()发生错误,错误信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } } finally { if (conn != null) { conn.Close(); } } return(info); }
public static bool DeleteApplicationInterfaceRelation(Guid appid, Guid interfaceid, Guid destinappid) { bool ret = false; IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationInterfaceRelation dp = DataProvider.DbApplicationInterfaceRelationDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; ret = dp.DeleteApplicationInterfaceRelation(cmd, appid, interfaceid, destinappid); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("DeleteApplicationInterfaceRelation()发生错误,错误信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } } finally { if (conn != null) { conn.Close(); } } return(ret); }
/// <summary> /// 获取接口异常日志信息列表 /// </summary> /// <param name="fields">字段名</param> /// <param name="whereCondition">筛选条件</param> /// <returns></returns> public static List <InterfaceExceptionlog> GetInterfaceExceptionlogList(string fields, string whereCondition) { IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; List <InterfaceExceptionlog> list = new List <InterfaceExceptionlog>(); try { IInterfaceExceptionlog dp = DataProvider.DbInterfaceExceptionlogDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; list = dp.GetInterfaceExceptionlogList(cmd, fields, whereCondition); trans.Commit(); } catch (Exception ex) { if (null != trans) { trans.Rollback(); } } finally { if (null != conn) { conn.Close(); } } return(list); }
public static bool AddOrUpdateApplicationRelation(ApplicationRelation info, ModifierType mode) { bool ret = false; IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationRelation dp = DataProvider.DbApplicationRelationDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; ret = dp.AddOrUpdateApplicationRelation(cmd, info, mode); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("AddOrUpdateApplicationRelation()发生错误,错误信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } } finally { if (conn != null) { conn.Close(); } } return(ret); }
/// <summary> /// 根据Id编号获取接口配置信息 /// </summary> /// <param name="id">编号</param> /// <returns></returns> public static InterfaceConfigInfo GetInterfaceConfigInfoById(Guid id) { IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; InterfaceConfigInfo entity = null; try { IInterfaceConfigInfo dp = DataProvider.DbInterfaceConfigDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; entity = dp.GetInterfaceConfigInfoById(cmd, id); trans.Commit(); } catch (Exception ex) { if (null != trans) { trans.Rollback(); } } finally { if (null != conn) { conn.Close(); } } return(entity); }
/// <summary> /// 新增接口异常日志信息 /// </summary> /// <param name="info"></param> public static void AddInterfaceExceptionlogInfo(InterfaceExceptionlog info) { IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IInterfaceExceptionlog dp = DataProvider.DbInterfaceExceptionlogDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; dp.AddInterfaceExceptionlogInfo(cmd, info); trans.Commit(); } catch (Exception ex) { if (null != trans) { trans.Rollback(); } } finally { if (null != conn) { conn.Close(); } } }
/// <summary> /// 接口配置信息数据新增或修改 /// </summary> /// <param name="entity"></param> /// <param name="mode"></param> public static void AddOrUpdateInterfaceConfigInfo(InterfaceConfigInfo entity, ModifierType mode) { IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IInterfaceConfigInfo dp = DataProvider.DbInterfaceConfigDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; dp.AddOrUpdateInterfaceConfigInfo(cmd, entity, mode); trans.Commit(); } catch (Exception ex) { if (null != trans) { trans.Rollback(); } } finally { if (null != conn) { conn.Close(); } } }
/// <summary> /// 根据接口名、应用系统编号获取配置信息 /// </summary> /// <param name="interfaceName"></param> /// <param name="appid"></param> /// <returns></returns> public static InterfaceConfigInfo GetInterfaceConfigInfo(string interfaceName, Guid appid) { IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; InterfaceConfigInfo info = null; try { IInterfaceConfigInfo dp = DataProvider.DbInterfaceConfigDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; info = dp.GetInterfaceConfigInfo(cmd, interfaceName, appid); trans.Commit(); } catch (Exception ex) { if (null != trans) { trans.Rollback(); } } finally { if (null != conn) { conn.Close(); } } return(info); }
public static DataTable GetApplicationInfoStaticsDetails(Guid id) { DataTable dt = new DataTable(); IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationSysInfo dp = DataProvider.DbApplicationSysInfoDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); dt = dp.GetApplicationInfoStaticsDetails(cmd, id); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("GetApplicationInfoStaticsDetails()发生错误,错误信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } } finally { if (conn != null) { conn.Close(); } } return(dt); }
public static List <ApplicationSysInfo> GetApplicationSysInfoList(string fileds, string condition, string orderby, string limit) { List <ApplicationSysInfo> list = new List <ApplicationSysInfo>(); IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationSysInfo dp = DataProvider.DbApplicationSysInfoDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); list = dp.GetApplicationSysInfoList(cmd, fileds, condition, orderby, limit); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("GetApplicationSysInfoList()发生错误,异常信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } throw ex; } finally { if (conn != null) { conn.Close(); } } return(list); }
public static ApplicationSysInfo GetApplicationSysInfo(string name, string server) { ApplicationSysInfo info = null; IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationSysInfo dp = DataProvider.DbApplicationSysInfoDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); info = dp.GetApplicationSysInfo(cmd, name, server); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("GetApplicationSysInfo()发生错误,异常信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } throw ex; } finally { if (conn != null) { conn.Close(); } } return(info); }
/// <summary> /// 根据Id编号删除接口实时状态信息 /// </summary> /// <param name="id"></param> public static void DeleteInterfaceRealtimeInfoById(Guid id) { IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IInterfaceRealtimeInfo dp = DataProvider.DbInterfaceRealtimeDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; dp.DeleteInterfaceRealtimeInfoById(cmd, id); trans.Commit(); } catch (Exception ex) { if (null != trans) { trans.Rollback(); } } finally { if (null != conn) { conn.Close(); } } }
public static List <ApplicationInterfaceRelation> GetApplicationInterfaceRealtionList(string fields, string condition) { List <ApplicationInterfaceRelation> list = new List <ApplicationInterfaceRelation>(); IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationInterfaceRelation dp = DataProvider.DbApplicationInterfaceRelationDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; list = dp.GetApplicationInterfaceRealtionList(cmd, fields, condition); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("GetApplicationInterfaceRealtionList()发生错误,错误信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } throw ex; } finally { if (conn != null) { conn.Close(); } } return(list); }
public static bool DeleteApplicationSysInfoById(Guid id) { bool ret = false; IDbConnection conn = null; IDbCommand cmd = null; IDbTransaction trans = null; try { IApplicationSysInfo dp = DataProvider.DbApplicationSysInfoDP; conn = DbConnOperation.CreateConnection(); cmd = conn.CreateCommand(); conn.Open(); trans = conn.BeginTransaction(); cmd.Transaction = trans; ret = dp.DeleteApplicationSysInfoById(cmd, id); trans.Commit(); } catch (Exception ex) { log.Error(string.Format("DeleteApplicationSysInfoById()发生错误,异常信息如下:{0}", ex)); if (trans != null) { trans.Rollback(); } throw ex; } finally { if (conn != null) { conn.Close(); } } return(ret); }