Public Sub pAfterAddRefresh(ByVal pCode As Integer)
Try
' A Temp SQL Code to hold the value for the newly added SQL Code deduct off a specified numbers
Dim intSqlCodeTemp As Integer = pCode - 100
Dim strSqlCondition As String = ""
If intSqlCodeTemp > 0 Then ' When there are more than 100 records
' A SQL condition that will refresh the Grid after a new record added which is differ from the intial SQL stt
strSqlCondition = "AND Code >= " & intSqlCodeTemp
End If
' If there are not more than 100 records then select for all records from the table
vDs01Department = cls00Connection.getDataSet(vSqlHeaderStr & strSqlCondition & " ORDER BY Code ", vpConnStr)
dgv01Department.AutoGenerateColumns = False
dgv01Department.DataSource = vDs01Department.Tables(0)
Call pClearDataBinding()
Call pDataBinding()
Call pRecordCount()
If pCode <> 0 Then
cls00Common.PositionRecordInGrid(dgv01Department, pCode)
End If
Catch ex As Exception
MsgBox("<f01Department.pAfterAddRefresh> " & ex.Message)
End Try
End Sub
Try
' A Temp SQL Code to hold the value for the newly added SQL Code deduct off a specified numbers
Dim intSqlCodeTemp As Integer = pCode - 100
Dim strSqlCondition As String = ""
If intSqlCodeTemp > 0 Then ' When there are more than 100 records
' A SQL condition that will refresh the Grid after a new record added which is differ from the intial SQL stt
strSqlCondition = "AND Code >= " & intSqlCodeTemp
End If
' If there are not more than 100 records then select for all records from the table
vDs01Department = cls00Connection.getDataSet(vSqlHeaderStr & strSqlCondition & " ORDER BY Code ", vpConnStr)
dgv01Department.AutoGenerateColumns = False
dgv01Department.DataSource = vDs01Department.Tables(0)
Call pClearDataBinding()
Call pDataBinding()
Call pRecordCount()
If pCode <> 0 Then
cls00Common.PositionRecordInGrid(dgv01Department, pCode)
End If
Catch ex As Exception
MsgBox("<f01Department.pAfterAddRefresh> " & ex.Message)
End Try
End Sub