C
cybercoolguy
Unregistered / Unconfirmed
GUEST, unregistred user!
请参考以下代码:
Private Sub AmendPO()
Me.Cursor = Cursors.WaitCursor
Try
Me.AcceptData()
[red] 'If Me.dsiMCS_PO.HasChanges(DataRowState.Unchanged) = True then
exit Sub[/red] Dim drPOHeader As dbsMCO.dsMCS_PO.MCS_POHeaderRow = Me.dsiMCS_PO.MCS_POHeader(0)
drPOHeader.ModifiedAt = DateTime.Now
drPOHeader.ModifiedBy = Me.m_frmHXMain.strAppUser
drPOHeader.IsSent = False
''Check data validation.
If Me.CheckDataValidation(Me.dsiMCS_PO) then
If 1 = Me.m_objHXMDMMCO030_PO.AmendPO then
Me.mnuDeletePOLines_Amend.
Enabled = True
Me.dgrPOLines_Amend.
Enabled = True
Me.GetPOInfo()
''if Amend PO success, then
set all IR to PO.
Me.dsiMCS_PO.VMCS_frmMCO030_POLineList.IRNOColumn.ReadOnly = False
Dim drVPOLine As dbsMCO.dsMCS_PO.VMCS_frmMCO030_POLineListRow
For Each drVPOLine In Me.dsiMCS_PO.VMCS_frmMCO030_POLineList
drVPOLine.SetIRNONull()
Next
End If
End If
Catch exp As Exception
Me.m_frmHXMain.wf_handle_error(exp)
Finally
Me.Cursor = Cursors.Default
End Try
End Sub
当DATASET没有变化的时候,我想退出程序,可是我用这段代码却不起任何作用:
If Me.dsiMCS_PO.HasChanges(DataRowState.Unchanged) = True then
exit Sub
为什么呢?
恳请大侠们指点迷津。
Private Sub AmendPO()
Me.Cursor = Cursors.WaitCursor
Try
Me.AcceptData()
[red] 'If Me.dsiMCS_PO.HasChanges(DataRowState.Unchanged) = True then
exit Sub[/red] Dim drPOHeader As dbsMCO.dsMCS_PO.MCS_POHeaderRow = Me.dsiMCS_PO.MCS_POHeader(0)
drPOHeader.ModifiedAt = DateTime.Now
drPOHeader.ModifiedBy = Me.m_frmHXMain.strAppUser
drPOHeader.IsSent = False
''Check data validation.
If Me.CheckDataValidation(Me.dsiMCS_PO) then
If 1 = Me.m_objHXMDMMCO030_PO.AmendPO then
Me.mnuDeletePOLines_Amend.
Enabled = True
Me.dgrPOLines_Amend.
Enabled = True
Me.GetPOInfo()
''if Amend PO success, then
set all IR to PO.
Me.dsiMCS_PO.VMCS_frmMCO030_POLineList.IRNOColumn.ReadOnly = False
Dim drVPOLine As dbsMCO.dsMCS_PO.VMCS_frmMCO030_POLineListRow
For Each drVPOLine In Me.dsiMCS_PO.VMCS_frmMCO030_POLineList
drVPOLine.SetIRNONull()
Next
End If
End If
Catch exp As Exception
Me.m_frmHXMain.wf_handle_error(exp)
Finally
Me.Cursor = Cursors.Default
End Try
End Sub
当DATASET没有变化的时候,我想退出程序,可是我用这段代码却不起任何作用:
If Me.dsiMCS_PO.HasChanges(DataRowState.Unchanged) = True then
exit Sub
为什么呢?
恳请大侠们指点迷津。