代碼如下: try { using (TransactionScope tr = new TransactionScope()) { int i = this.customermanager.addCustomer(customer); int j = this.homestatusmanager.updateHomestatus(homestatus); if ((i * j) > 0) { MessageBox.Show("記錄插入成功!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Infor...