摘要:delet master
1.delete detail all
then trigger can minus Qty
Public Overrides Sub deleteDetail()
bsDetail.EndEdit()
Dim i = 0
For i = bsDetail.Count - 1 To 0 Step -1
bsDetail.RemoveAt(i)
Next
dTb.Update()
End Sub
bsDetail.EndEdit()
Dim i = 0
For i = bsDetail.Count - 1 To 0 Step -1
bsDetail.RemoveAt(i)
Next
dTb.Update()
End Sub
2. Singleform delete master
Public Overridable Sub deleteDetail()
'更新刪除的資料
'讓繼承的程序來實作
End Sub
Public Overridable Sub DeleteAll()
'刪除記錄
If bsMaster.Count > 0 Then
If MessageBox.Show("確定刪除本筆記錄嗎?", "刪除確認", _
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
deleteDetail()
bsMaster.RemoveAt(bsMaster.Position)
mTb.Update()
End If
End If
End Sub
'更新刪除的資料
'讓繼承的程序來實作
End Sub
Public Overridable Sub DeleteAll()
'刪除記錄
If bsMaster.Count > 0 Then
If MessageBox.Show("確定刪除本筆記錄嗎?", "刪除確認", _
MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
deleteDetail()
bsMaster.RemoveAt(bsMaster.Position)
mTb.Update()
End If
End If
End Sub