📺 YouTube (Part 1/3)
📺 YouTube (Part 2/3)
📺 YouTube (Part 3/3)
[Free Source Code by iBasskung]
#BEGIN
Private Sub Employee_DataBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles Employee_DataBindingNavigatorSaveItem.Click
' Save
'Me.Validate()
'Me.Employee_DataBindingSource.EndEdit()
'Me.TableAdapterManager.UpdateAll(Me.EmployeeDatabaseDataSet)
' TODO :)
SaveButton.PerformClick()
End Sub
Private Sub FormPersonnelManagement_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'EmployeeDatabaseDataSet.Employee_Data' table. You can move, or remove it, as needed.
Me.Employee_DataTableAdapter.Fill(Me.EmployeeDatabaseDataSet.Employee_Data)
End Sub
Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorAddNewItem.Click
' TODO :)
AddNewButton.PerformClick()
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorDeleteItem.Click
' TODO :)
DeleteButton.PerformClick()
End Sub
Private Sub ExitButton_Click(sender As Object, e As EventArgs) Handles ExitButton.Click
' Application.Exit()
' Nice!
Me.Close()
End Sub
Private Sub AddNewButton_Click(sender As Object, e As EventArgs) Handles AddNewButton.Click
' Add new
' MsgBox("You pressed Add New Button")
Try
With AddNewButton
If .Text = "Add New Record" Then
Employee_DataBindingSource.AddNew()
.Text = "Cancel"
Else
RefreshData()
.Text = "Add New Record"
End If
End With
With FirstNameTextBox
If (.CanSelect) Then
.Text = String.Empty
.Select()
End If
End With
Catch ex As Exception
MsgBox("An Error Occured: " & ex.Message.ToString(),
MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "Add new record failed.")
End Try
End Sub
Private Sub RefreshData()
Try
Me.Employee_DataBindingSource.Filter = Nothing
Me.Employee_DataTableAdapter.Fill(Me.EmployeeDatabaseDataSet.Employee_Data)
Catch ex As Exception
MsgBox("Refresh Data Error!")
End Try
End Sub
Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click
' Save | Update
' MsgBox("You pressed Save Button")
Try
Dim result As DialogResult
result = MessageBox.Show("Do you want to save the selected record?", "Save Data : iBasskung Tutorial",
MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If (result = DialogResult.Yes) Then
Validate()
Employee_DataBindingSource.EndEdit()
TableAdapterManager.UpdateAll(Me.EmployeeDatabaseDataSet)
MessageBox.Show("The record has been saved successfully.",
"Save Data : iBasskung Tutorial", MessageBoxButtons.OK, MessageBoxIcon.Information)
RefreshData()
AddNewButton.Text = "Add New Record"
Else
' Exit Sub
Return
End If
Catch ex As Exception
MessageBox.Show("Save | Update Data Failed: " & ex.Message.ToString(),
"Save Data : iBasskung Tutorial", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub DeleteButton_Click(sender As Object, e As EventArgs) Handles DeleteButton.Click
' Delete
' MsgBox("You pressed Delete Button")
Try
If MessageBox.Show("Do you want to permanently delete the selected record?",
"Delete Data : iBasskung Tutorial", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) =
Windows.Forms.DialogResult.Yes Then
Employee_DataBindingSource.RemoveCurrent()
Employee_DataBindingSource.EndEdit()
Employee_DataTableAdapter.Update(EmployeeDatabaseDataSet.Employee_Data)
RefreshData()
MessageBox.Show("The record has been deleted.",
"Delete Data : iBasskung Tutorial", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Return ' Exit Sub
End If
Catch ex As Exception
MessageBox.Show("Delete Data Failed: " & ex.Message.ToString(),
"Delete Data : iBasskung Tutorial", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
End Class
#END
⛳ Follow me around ⛳
✔ Want to get updates on new courses or other cool free stuff? Just follow
me on social media if that's your thing!
📺 Pages:
📺 YouTube:
📺 Udemy:
📺 Twitter:
📺 Blogger:
💯 THANK YOU SO MUCH! 💯
Tags: visual studio 2019, visual basic 2019, vb.net, vb.net tutorial for beginners visual studio 2019, visual basic, vb, visual studio 2019 visual basic tutorial, visual studio 2019 tutorial, how to use visual studio 2019, visual basic tutorial 2019, access, visual studio
#vb #vbnet #visualbasic #visualbasicdatabase #RetailPOS #PointOfSale #POS
#EmployeeTrainingManagement #EmployeeManagement #EmployeeManagementSystem
#EmployeeTrainingRecords #Software #CodeAMinute #iBasskung
#iBasskungTutorial #VisualCSharp #CSharp #Programming #MicrosoftAccess
#AccessDatabase #SQLServer #CrystalReports #Udemy #OnlineCourses
#YouTube
Comments
Post a Comment