Вы находитесь на странице: 1из 8

Form 1

Imports System.Data.OleDb

Public Class Form1


Public CONN As OleDbConnection
Public LOKASIDATABASE As String
Public CMD As OleDbCommand
Public DR As OleDbDataReader

Public Sub KONEKSI()


LOKASIDATABASE = ("Provider=Microsoft.JET.OLEDB.4.0 ;Data
Source=DatabaseLogin.mdb;")
CONN = New OleDbConnection(LOKASIDATABASE)
If CONN.State = ConnectionState.Closed Then
CONN.Open()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
MsgBox("Harap Isi Username Terlebih Dahulu", MsgBoxStyle.Critical,
"PERINGATAN!")
TextBox1.Focus()
ElseIf TextBox2.Text = "" Then
MsgBox("Harap Isi Password Terlebih Dahulu", MsgBoxStyle.Critical,
"PERINGATAN!")
TextBox2.Focus()
Else
Call KONEKSI()
CMD = New OleDbCommand("SELECT * FROM TabelLogin WHERE Username='" &
TextBox1.Text & "' AND Password='" & TextBox2.Text & "'", CONN)
DR = CMD.ExecuteReader
DR.Read()
If DR.HasRows Then
MsgBox("Login Berhasil", MsgBoxStyle.Information, "Informasi")
Form3.Show()
Me.Hide()
Else
MsgBox("Nama Pengguna atau Password Salah", MsgBoxStyle.Critical,
"PERINGATAN!")
TextBox1.Clear()
TextBox2.Clear()
TextBox1.Focus()
End If
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
End
End Sub

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Me.Hide()
Form2.Show()
Form2.TabelLoginBindingSource.AddNew()
End Sub

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked Then

TextBox2.UseSystemPasswordChar = False

Else

TextBox2.UseSystemPasswordChar = True

End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub
Form 2

Public Class Form2

Private Sub TabelLoginBindingNavigatorSaveItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.TabelLoginBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DatabaseLoginDataSet)

End Sub

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


'TODO: This line of code loads data into the 'DatabaseLoginDataSet.TabelLogin'
table. You can move, or remove it, as needed.
Me.TabelLoginTableAdapter.Fill(Me.DatabaseLoginDataSet.TabelLogin)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Me.Validate()
TabelLoginBindingSource.EndEdit()
TabelLoginTableAdapter.Update(DatabaseLoginDataSet)
Me.Close()
Form1.Show()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Me.Close()
Form1.Show()
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked Then

PasswordTextBox.UseSystemPasswordChar = False

Else

PasswordTextBox.UseSystemPasswordChar = True

End If
End Sub

Private Sub Form2_Load_1(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub
End Class
Form 3

Public Class Form3

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Form4.show()
Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Form5.Show()
Me.Close()
End Sub

Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub
End Class
Form 4

Public Class Form4

Private Sub TabelHitungBindingNavigatorSaveItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.TabelHitungBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DatabaseHitungDataSet)

End Sub

Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
'TODO: This line of code loads data into the
'DatabaseHitungDataSet.TabelHitung' table. You can move, or remove it, as needed.
Me.TabelHitungTableAdapter.Fill(Me.DatabaseHitungDataSet.TabelHitung)

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
UsernameTextBox.Clear()
WTextBox.Clear()
VhTextBox.Clear()
HPDTextBox.Clear()
HPPTextBox.Clear()
NTextBox.Clear()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
Form5.Show()
Me.Hide()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
End
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Me.Close()
Form1.Show()
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox1.TextChanged
TabelHitungBindingSource.Filter = "Username LIKE'" + TextBox1.Text + "%'"
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim a, b, c As Double

a = WTextBox.Text
b = VhTextBox.Text
c = 33000
HPDTextBox.Text = (a * b) / c

If WTextBox.Text = "" Then


MsgBox("Isi data terlebih dahulu", vbInformation, "Perhatian!!!")
ElseIf VhTextBox.Text = "" Then
MsgBox("Isi data terlebih dahulu", vbInformation, "Perhatian!!!")
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Dim a, b, c, d As Double

a = WTextBox.Text
b = VhTextBox.Text
c = 33000
HPDTextBox.Text = (a * b) / c
d = NTextBox.Text
HPPTextBox.Text = HPDTextBox.Text / d

If WTextBox.Text = "" Then


MsgBox("Isi data terlebih dahulu", vbInformation, "Perhatian!!!")
ElseIf VhTextBox.Text = "" Then
MsgBox("Isi data terlebih dahulu", vbInformation, "Perhatian!!!")
ElseIf NTextBox.Text = "" Then
MsgBox("Isi data terlebih dahulu", vbInformation, "Perhatian!!!")
End If
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button7.Click
TabelHitungBindingSource.AddNew()
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button8.Click
Me.Validate()
Me.TabelHitungBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DatabaseHitungDataSet)
End Sub

Form 5

Report

Form 6

Public Class Form6

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Form3.Show()
Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
End
End Sub

Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load

End Sub
End Class

Вам также может понравиться