Advertisement
Guest User

Untitled

a guest
Jan 9th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.64 KB | None | 0 0
  1. Sub Login_button()
  2.       Dim username As String
  3.     Dim password As String
  4.     Dim tmpusername As String
  5.     Dim tmppassword As String
  6.     Dim login As Boolean
  7.     Dim typeuser As Integer
  8.     Dim kduser As String
  9.     username = mdlMethod.getvalue("LOGIN", 35, 1)
  10.     password = mdlMethod.getvalue("LOGIN", 36, 1)
  11.     Dim lastrow As Integer
  12.     lastrow = mdlMethod.getlastrow("t_user")
  13.     Dim i As Integer
  14.     For i = 2 To lastrow
  15.         tmppassword = mdlMethod.getvalue("t_user", i, 3)
  16.         tmpusername = mdlMethod.getvalue("t_user", i, 2)
  17.         If ((tmpusername = username) And (tmppassword = password)) Then
  18.             login = True
  19.             typeuser = mdlMethod.getvalue("t_user", i, 4)
  20.             kduser = mdlMethod.getvalue("t_user", i, 1)
  21.             i = lastrow + 1
  22.             Else
  23.             login = False
  24.         End If
  25.     Next i
  26.    If (login) Then
  27.         Call mdlMethod.setvalue("sc", 4, 2, tmpusername)
  28.         Call mdlMethod.setvalue("sc", 5, 2, tmppassword)
  29.         Call mdlMethod.setvalue("sc", 6, 2, kduser)
  30.         Call mdlMethod.setvalue("sc", 7, 2, CStr(typeuser))
  31.         If (typeuser = 1) Then
  32.             Sheets("Dash_pncari").Select
  33.             Else
  34.             If (typeuser = 2) Then
  35.                 Sheets("Dash_company").Select
  36.                 Else
  37.                 If (typeuser = 3) Then
  38.                     Sheets("Dash_agency").Select
  39.                     Else
  40.                     If (typeuser = 1) Then
  41.            
  42.                     End If
  43.                 End If
  44.             End If
  45.         End If
  46.    Else
  47.         MsgBox ("Username/Password yang anda masukan salah")
  48.    End If
  49. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement