/// <summary> /// 构造函数 /// </summary> public LForumAnswerBB() { this.selfConn = true; this.connection = new SqlConnection(HS.Config.SqlDataObject.GetSqlConnectionString); this.connection.Open(); this.forumAnswerDB = new LForumAnswerDB(this.connection); }
/// <summary> /// 构造函数 /// </summary> /// <param name="connection">数据连接</param> public LForumAnswerBB(SqlConnection connection) { this.connection = connection; this.forumAnswerDB = new LForumAnswerDB(connection); }
protected virtual void Dispose(bool disposing) { if (!disposing) return; if (this.selfConn) { this.connection.Close(); this.connection.Dispose(); this.connection = null; } if (this.forumAnswerDB != null) { this.forumAnswerDB.Dispose(); this.forumAnswerDB = null; } }