Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Then
  2. MessageBox.Show("Data Belum Lengkap", "Peringatan", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  3. Exit Sub
  4. Else
  5. Dim nomor As String = Microsoft.VisualBasic.Left(TextBox5.Text, 2)
  6. If nomor <> "08" Then
  7. MessageBox.Show("Isi Nomer Telepon Anda Dengan Benar", "Peringatan", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  8. TextBox5.Text = ""
  9. Exit Sub
  10. End If
  11. Call Panggil_Kode()
  12. Dim newtext As String
  13. Dim oldtext As String = foto.Text
  14. newtext = oldtext.Replace("\", "\\")
  15.  
  16. If Not dr.HasRows Then
  17. Dim SIMPAN As String = "INSERT INTO petugas VALUES('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & newtext & "','" & ComboBox1.Text & "')"
  18. cmd = New OdbcCommand(SIMPAN, conn)
  19. cmd.ExecuteNonQuery()
  20. MessageBox.Show("Data Berhasil Disimpan", "Peringatan", MessageBoxButtons.OK, MessageBoxIcon.Information)
  21. Else
  22. Dim EDIT As String = "UPDATE petugas set nama_petugas='" & TextBox2.Text & "',username='" & TextBox3.Text & "',password='" & TextBox4.Text & "',telp='" & TextBox5.Text & "',foto='" & newtext & "',level='" & ComboBox1.Text & "' where id_petugas='" & TextBox1.Text & "'"
  23. cmd = New OdbcCommand(EDIT, conn)
  24. cmd.ExecuteNonQuery()
  25. MessageBox.Show("Data Berhasil Diubah", "Peringatan", MessageBoxButtons.OK, MessageBoxIcon.Information)
  26. End If
  27. Call TampilGrid()
  28. Call bersihkan()
  29. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement