Sub Save()
File.WriteAllText(My.Application.Info.DirectoryPath & "\" & number & ".emp", _
"-Employee Name Info-:" + vbCrLf _
& first + " " & middle + " "
& last + vbCrLf _ & "-Employee Address Info-:" + vbCrLf _
& address + vbCrLf & city + vbCrLf & state + vbCrLf & zip + vbCrLf _
& "-Employee Info-:" + vbCrLf _
& bday + vbCrLf & hphone + vbCrLf & cphone + vbCrLf _
& "-Employee Social Security Number-:" + vbCrLf _
& ssn)
managercp.txtfirst.Text = ""
managercp.txtmiddle.Text = ""
managercp.txtlast.Text = ""
managercp.txtaddress.Text = ""
managercp.txtcity.Text = ""
managercp.txtstate.Text = ""
managercp.txtzip.Text = ""
managercp.txtbday.Text = ""
managercp.txthome.Text = ""
managercp.txtcell.Text = ""
managercp.txtssn.Text = ""
managercp.txtnumber.Text = ""
End Sub
Sub EmpExists()
MsgBox("Employee File with that number already exists. Please specify a new number, or delete the existing Employee File.", _ MsgBoxStyle.Critical, "Employee File Error")
End Sub
Private Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click
If My.Computer.FileSystem.FileExists(My.Application.Info.DirectoryPath & "\" & txtnumber.Text & ".emp") Then
Employee.EmpExists()
Else
Employee.Save()
End If
End Sub