• Tidak ada hasil yang ditemukan

Joegiyanto, H.M.2001. " Analisa dan Desain Sistem Informasi".

Yogyakarta:Andi.

Priyanto, Rahmat.2009. "Langsung Bisa Visual Basic.NET 2008". Yogyakarta :Andi.

Darmayuda, Ketut. 2016. "Aplikasi Basis Data dengan Visual Basic.NET".

Bandung: Informatika.

Kristanto, Andri. 2011. “Perancangan Sistem Informasi dan Aplikasinya”.

Yogyakarta: Andi.

Permana, B., 2013, “Laporan Menggunakan Crystal Report Pada Visual Basic 2010”,

http://ilmukomputer.org/wp-content/uploads/2013/04/Budi-LaporanMenggunakan-Crystal-Report-Pada-Visual-Basic-2010.pdf, 28 Mei 2018.

Wijaya, H., 2013, “Cara Membuat fungsi Search/Cari dengan VB.NET”,

http://www.itgagal.com/2013/03/29/cara-membuat-fungsi-searchcaridengan-vb-net/, 07 Juni 2018.

Yuhefizard, 2008. “Database Management Menggunakan Microsoft Access 2003”.

Jakarta: PT. Elex Media Komputindo.

LAMPIRAN

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click

Call Koneksi()

CMD = New OleDbCommand("select * from tbluser where nama_user='" & txtnama.Text & "' and pwd_user='" & txtpassword.Text & "'", CONN)

DR = CMD.ExecuteReader

If Not DR.HasRows Then

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click

Me.Close() End Sub

Private Sub Login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Koneksi()

CMD = New OleDbCommand("select * from tbluser wHere status_user='ADMIN'", CONN) DR = CMD.ExecuteReader

Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown

End If

If e.KeyCode = Keys.Escape Then Me.Close()

End If End Sub

End Class

MenuUtama.vb

Imports System.Data.OleDb Public Class MenuUtama

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

TRPenggajian.Show() End Sub

Private Sub MenuUtama_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

If e.KeyCode = Keys.Escape Then End

End If End Sub

Private Sub MenuUtama_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Koneksi()

Button8.Visible = False Button15.Visible = False GroupBox5.Visible = False PictureBox1.Load("wall3.jpg")

PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage End Sub

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

If MessageBox.Show("Hapus percobaan data transaksi...?", "Perhatian",

CMD = New OleDbCommand("delete * from tblgaji", CONN)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

User.Show() End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Profil.Show() End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

Jabatan.Show() End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

Golongan.Show() End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

Pendapatan.Show() End Sub

Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click

Potongan.Show() End Sub

Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click

Karyawan.Show() End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

TRPenggajian.Show() End Sub

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click

If MessageBox.Show("Tutup aplikasi...?", "Perhatian", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

End End If End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click

If MessageBox.Show("Hapus percobaan data transaksi...?", "Perhatian", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

LaporanMaster.Show() End Sub

Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click

UjiSql.Show() End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

Sub Kosongkan()

CMD = New OleDbCommand("select distinct Status_user from tblUser", CONN) DR = CMD.ExecuteReader

CMD = New OleDbCommand("select * from tblUser where id_user='" & TextBox1.Text & "'", CONN)

DR = CMD.ExecuteReader DR.Read()

End Sub

Private Sub User_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Kosongkan() Call TampilStatus_user() Call TampilGrid() End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

TextBox2.Text & "','" & ComboBox1.Text & "','" & TextBox3.Text & "')"

CMD = New OleDbCommand(simpan, CONN) CMD.ExecuteNonQuery()

Else

Dim edit As String = "update tblUser set nama_User='" & TextBox2.Text &

"',Status_user='" & ComboBox1.Text & "',PWD_user='" & TextBox3.Text & "' where id_user='" &

TextBox1.Text & "'"

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If TextBox1.Text = "" Then

TextBox1.Focus()

If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Call Kosongkan() End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.Close() End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

DA = New OleDbDataAdapter("select * from tblUser where nama_User like '%" &

TextBox5.Text & "%'", CONN)

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick On Error Resume Next

TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value Call CariKode()

If DR.HasRows Then Call Ketemu() End If

End Class

Profil.vb

Imports System.Data.OleDb Public Class Profil

Sub IDprofilOtomatis()

CMD = New OleDbCommand("select id_profil from tblprofil order by id_profil desc", CONN) DR = CMD.ExecuteReader

Telepon.Text = Microsoft.VisualBasic.Mid(DR.Item(3), 9, 30) Fax.Text = Microsoft.VisualBasic.Mid(DR.Item(4), 5, 30) Email.Text = Microsoft.VisualBasic.Mid(DR.Item(5), 7, 30) Website.Text = Microsoft.VisualBasic.Mid(DR.Item(6), 9, 30) Nama.Focus()

End Sub

Sub CariIdprofil()

CMD = New OleDbCommand("select * from tblprofil where id_profil='" & ID.Text & "'", CONN) DR = CMD.ExecuteReader

DR.Read() End Sub

Call Kosongkan() End Sub

Private Sub Profil_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try

Call CariIdprofil() If Not DR.HasRows Then

Dim simpan As String = "insert into tblprofil values('" & ID.Text & "','" & Nama.Text & "','"

& Alamat.Text & "', '" & Label4.Text & Space(1) & Telepon.Text & "', '" & Label5.Text & Space(1) &

Fax.Text & " ', '" & Label6.Text & Space(1) & Email.Text & "', '" & Label7.Text & Space(1) &

Website.Text & "')"

& Alamat.Text & "', '" & Label4.Text & Space(1) & Telepon.Text & "', '" & Label5.Text & Space(1) &

Fax.Text & " ', '" & Label6.Text & Space(1) & Email.Text & "', '" & Label7.Text & Space(1) &

Website.Text & "')"

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

'Call Kosongkan() Call IDprofilOtomatis() Call Ketemu()

Nama.Focus()

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

CMD = New OleDbCommand("select * from tblJabatan where id_Jabatan='" & TextBox1.Text &

DR.Read() End Sub

Private Sub Jabatan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Koneksi() Call Kosongkan() Call TampilGrid() End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox6.Text & "')"

CMD = New OleDbCommand(simpan, CONN) CMD.ExecuteNonQuery()

Else

Dim edit As String = "update tblJabatan set nama_Jabatan='" & TextBox2.Text &

"',Tunjangan_Jabatan='" & TextBox3.Text & "',Tunjangan_keluarga='" & TextBox4.Text &

"',Tunjangan_anak='" & TextBox4.Text & "' where id_Jabatan='" & TextBox1.Text & "'"

CMD = New OleDbCommand(edit, CONN)

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

If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Call Kosongkan() End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.Close() End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

DA = New OleDbDataAdapter("select * from tblJabatan where nama_Jabatan like '%" &

TextBox5.Text & "%'", CONN)

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick On Error Resume Next

TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value Call CariKode()

Call Ketemu()

CMD = New OleDbCommand("select * from tblJabatan where id_Jabatan='" & TextBox1.Text &

"'", CONN)

DR = CMD.ExecuteReader

End Sub

Private Sub Jabatan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Koneksi() Call Kosongkan() Call TampilGrid() End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox6.Text & "')"

CMD = New OleDbCommand(simpan, CONN) CMD.ExecuteNonQuery()

Else

Dim edit As String = "update tblJabatan set nama_Jabatan='" & TextBox2.Text &

"',Tunjangan_Jabatan='" & TextBox3.Text & "',Tunjangan_keluarga='" & TextBox4.Text &

"',Tunjangan_anak='" & TextBox4.Text & "' where id_Jabatan='" & TextBox1.Text & "'"

CMD = New OleDbCommand(edit, CONN)

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

If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Call Kosongkan() End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.Close() End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

DA = New OleDbDataAdapter("select * from tblJabatan where nama_Jabatan like '%" &

TextBox5.Text & "%'", CONN)

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick On Error Resume Next

TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value Call CariKode()

Call Ketemu()

CMD = New OleDbCommand("select * from tblGolongan where id_Golongan='" &

TextBox1.Text & "'", CONN) DR = CMD.ExecuteReader DR.Read()

End Sub

Private Sub Golongan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call TampilGrid() End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

TextBox2.Text & "','" & TextBox3.Text & "')"

CMD = New OleDbCommand(simpan, CONN) CMD.ExecuteNonQuery()

Else

Dim edit As String = "update tblGolongan set nama_Golongan='" & TextBox2.Text &

"',Tunjangan_Golongan='" & TextBox3.Text & "' where id_Golongan='" & TextBox1.Text & "'"

CMD = New OleDbCommand(edit, CONN)

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If Not DR.HasRows Then

MsgBox("Kode Golongan tidak terdaftar") TextBox1.Focus()

Exit Sub End If

If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Call Kosongkan() End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.Close() End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

DA = New OleDbDataAdapter("select * from tblGolongan where nama_Golongan like '%" &

TextBox5.Text & "%'", CONN)

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick On Error Resume Next

TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value Call CariKode()

Imports System.Data.OleDb

DA = New OleDbDataAdapter("select * from tblpendapatan", CONN) DS = New DataSet

CMD = New OleDbCommand("select * from tblpendapatan where id_pendapatan='" &

TextBox1.Text & "'", CONN) DR = CMD.ExecuteReader DR.Read()

End Sub

Private Sub Pendapatan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Koneksi() Call Kosongkan() Call TampilGrid() End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

Call DataBaru() End If

End If End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

"' where id_pendapatan='" & TextBox1.Text & "'"

CMD = New OleDbCommand(edit, CONN)

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Dim hapus As String = "delete * from tblpendapatan where id_pendapatan='" & TextBox1.Text

& "'"

CMD.ExecuteNonQuery()

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Call Kosongkan() End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.Close() End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

DA = New OleDbDataAdapter("select * from tblpendapatan where nama_pendapatan like '%" &

TextBox5.Text & "%'", CONN)

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick On Error Resume Next

TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value Call CariKode()

Sub DataBaru()

CMD = New OleDbCommand("select * from tblPotongan where id_Potongan='" &

TextBox1.Text & "'", CONN) DR = CMD.ExecuteReader DR.Read()

End Sub

Private Sub Potongan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Koneksi() Call Kosongkan() Call TampilGrid() End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If TextBox1.Text = "" Or TextBox2.Text = "" Then MsgBox("data belum lengkap")

Else where id_Potongan='" & TextBox1.Text & "'"

CMD = New OleDbCommand(edit, CONN)

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.Close() End Sub

Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

DA = New OleDbDataAdapter("select * from tblPotongan where nama_Potongan like '%" &

TextBox5.Text & "%'", CONN)

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick On Error Resume Next

TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value Call CariKode()

com_divisi.Text = ""

CMD = New OleDbCommand("select distinct divisi from tblkaryawan", CONN) DR = CMD.ExecuteReader

CMD = New OleDbCommand("select distinct Status_Pernikahan from tblKaryawan", CONN) DR = CMD.ExecuteReader

com_status.Items.Clear() Do While DR.Read

com_status.Items.Add(DR.Item(0))

End Sub

CMD = New OleDbCommand("select * from tblKaryawan where id_Karyawan='" &

TextBox1.Text & "'", CONN)

Private Sub MasterKaryawan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Call Koneksi() Call Kondisiawal() End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If TextBox1.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or com_golongan.Text = "" Or com_jabatan.Text = "" Or com_divisi.Text = "" Or com_status.Text = ""

Then

MsgBox("data belum lengkap")

Else Try

Call CariKode()

If Not DR.HasRows Then

Dim simpan As String = "insert into tblKaryawan values('" & TextBox1.Text & "','" &

TextBox3.Text & "','" & TextBox4.Text & "','" & Microsoft.VisualBasic.Left(com_golongan.Text, 3)

& "','" & Microsoft.VisualBasic.Left(com_jabatan.Text, 3) & "','" & com_divisi.Text & "','" &

com_status.Text & "','" & TextBox5.Text & "')"

CMD = New OleDbCommand(simpan, CONN) CMD.ExecuteNonQuery()

Else

Dim edit As String = "update tblKaryawan set nama_karyawan='" & TextBox3.Text &

"',gaji_pokok='" & TextBox4.Text & "',id_golongan='" &

Microsoft.VisualBasic.Left(com_golongan.Text, 3) & "',id_jabatan='" &

Microsoft.VisualBasic.Left(com_jabatan.Text, 3) & "',divisi='" & com_divisi.Text &

"',status_pernikahan='" & com_status.Text & "',jumlah_anak='" & TextBox5.Text & "' where id_karyawan='" & TextBox1.Text & "'"

CMD = New OleDbCommand(EDIT, CONN)

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

If MessageBox.Show("Yakin akan dihapus...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

End If End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Call Kosongkan() End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Me.Close() End Sub

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

DA = New OleDbDataAdapter("select * from tblKaryawan where nama_Karyawan like '%" &

TextBox5.Text & "%'", CONN)

Private Sub DGV_CellMouseClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DGV.CellMouseClick On Error Resume Next

TextBox1.Text = DGV.Rows(e.RowIndex).Cells(0).Value Call CariKode()

If DR.HasRows Then Call Ketemu() End If

End Sub

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

End Sub

Private Sub com_golongan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles com_status.SelectedIndexChanged

Private Sub com_divisi_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles com_divisi.SelectedIndexChanged

End Sub

TRPenggajian.vb

DGV1.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill Next

DGV2.Columns(0).ReadOnly = True DGV2.Columns(1).ReadOnly = True

For baris2 As Integer = 0 To DGV2.RowCount - 1 DGV2.Rows(baris2).Cells(2).Value = 0

DGV2.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill Next

End Sub Sub Otomatis()

CMD = New OleDbCommand("select id_gaji from tblgaji order by id_gaji desc", CONN) DR = CMD.ExecuteReader

DR.Read()

If Not DR.HasRows Then TNomor.Text = "0000000001"

Else

TNomor.Text = Format(Microsoft.VisualBasic.Right(DR.Item("ID_GAJI"), 10) + 1,

"0000000000") End If End Sub

Sub TampilPendapatan() DGV1.Columns.Clear()

DA = New OleDbDataAdapter("select ID_Pendapatan,Nama_Pendapatan from tblpendapatan", CONN)

DA.Fill(DS)

DGV1.DataSource = DS.Tables(0)

DGV1.Columns.Add("Jumlah", "Jumlah Pendapatan")

DGV1.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight DGV1.Columns(0).HeaderText = "ID Pendapatan"

DGV1.Columns(1).HeaderText = "Nama Pendapatan"

End Sub

Sub TampilPotongan() DGV2.Columns.Clear()

DA = New OleDbDataAdapter("select ID_Potongan,Nama_Potongan from TBLpotongan", CONN)

DS = New DataSet DA.Fill(DS)

DGV2.DataSource = DS.Tables(0)

DGV2.Columns.Add("Jumlah", "Jumlah Potongan")

DGV2.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight DGV2.Columns(0).HeaderText = "ID Potongan"

DGV2.Columns(1).HeaderText = "Nama Potongan"

End Sub

Private Sub TRpenggajian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Sub cariTotalPendapatan() Try

MsgBox(ex.Message) End Try

End Sub

Private Sub TIDKaryawan_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TIDKaryawan.KeyPress If e.KeyChar = Chr(13) Then

CMD = New OleDbCommand("select id_karyawan from tblgaji where id_karyawan='" &

TIDKaryawan.Text & "' and month(tanggal)='" & Month(TTanggal.Text) & "' and year(tanggal)='" &

Year(TTanggal.Text) & "'", CONN)

Else

DGV2.Rows(1).Cells(2).Value = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text) * 1 / 100)

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Call Bersihkan()

'Call TampilPendapatan() 'Call TampilPotongan() End Sub

Private Sub DGV1_CellEndEdit(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV1.CellEndEdit If e.ColumnIndex = 2 Then

Call cariTotalPendapatan() End If

End Sub

Private Sub DGV2_CellEndEdit(ByVal sender As Object, ByVal e As

System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV2.CellEndEdit If e.ColumnIndex = 2 Then

Call cariTotalPotongan()

End Sub

Private Sub TTotalPendapatan_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TTotalPendapatan.TextChanged

On Error Resume Next

'TGajiBersih.Text = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) - Val(Microsoft.VisualBasic.Str(TTotalPotongan.Text))

TextBox1.Text = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) - Val(Microsoft.VisualBasic.Str(TTotalPotongan.Text))

DGV2.Rows(0).Cells(2).Value = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) * 10 / 100

'TGajiBersih.Text = FormatNumber(TGajiBersih.Text, 0) TextBox1.Text = FormatNumber(TextBox1.Text, 0) End Sub

Private Sub TTotalPotongan_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TTotalPotongan.TextChanged

On Error Resume Next

' TGajiBersih.Text = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) - Val(Microsoft.VisualBasic.Str(TTotalPotongan.Text))

TextBox1.Text = Val(Microsoft.VisualBasic.Str(TTotalPendapatan.Text)) - Val(Microsoft.VisualBasic.Str(TTotalPotongan.Text))

'TGajiBersih.Text = FormatNumber(TGajiBersih.Text, 0) TextBox1.Text = FormatNumber(TextBox1.Text, 0) End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

CMD = New OleDbCommand("insert into tblgaji values('" & TNomor.Text & "','" &

TTanggal.Text & "','" & TIDKaryawan.Text & "','" & TTotalPendapatan.Text & "','" &

TTotalPotongan.Text & "','" & TextBox1.Text & "','" & Tketerangan.Text & "','USR01','01')", CONN) CMD.ExecuteNonQuery()

For baris As Integer = 0 To DGV1.RowCount - 2

CMD = New OleDbCommand("insert into tblgajidetail values ('" & TNomor.Text & "','" &

DGV1.Rows(baris).Cells(0).Value & "','" & DGV1.Rows(baris).Cells(2).Value & "','-',0)", CONN) CMD.ExecuteNonQuery()

DGV2.Rows(baris).Cells(0).Value & "',jumlah_potongan='" & DGV2.Rows(baris).Cells(2).Value & "' where id_gaji='" & DR.Item(0) & "' and id_pendapatan='" & DGV2.Rows(baris).Cells(0).Value & "'", CONN)

End If Next

Call Bersihkan()

If MessageBox.Show("Cetak slip gaji...?", "Perhatian", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

Call SetingLaporan() CRV.ReportSource = laporan CRV.RefreshReport() End Sub

Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click

Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click

Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click

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

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

DA = New OleDbDataAdapter("select distinct

tblgaji.id_gaji,tanggal,tblkaryawan.id_karyawan,nama_karyawan,tblpotongan.nama_potongan,Jumlah_

potongan from tblgaji,tblgajidetail,tblkaryawan,tblpotongan where tblgaji.id_gaji=tblgajidetail.id_gaji and tblgaji.id_karyawan=tblkaryawan.id_karyawan and

tblgajidetail.id_potongan=tblpotongan.id_potongan and tblpotongan.nama_potongan='pph 21' and month(tblgaji.tanggal)='" & Month(DTP2.Text) & "' and year(tblgaji.tanggal)='" & Year(DTP2.Text) &

"'", CONN)

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

DA = New OleDbDataAdapter("select distinct

tblgaji.id_gaji,tanggal,tblkaryawan.id_karyawan,nama_karyawan,tblpotongan.nama_potongan,Jumlah_

potongan from tblgaji,tblgajidetail,tblkaryawan,tblpotongan where tblgaji.id_gaji=tblgajidetail.id_gaji and tblgaji.id_karyawan=tblkaryawan.id_karyawan and

tblgajidetail.id_potongan=tblpotongan.id_potongan and tblpotongan.nama_potongan='BPJS' and month(tblgaji.tanggal)='" & Month(DTP3.Text) & "' and year(tblgaji.tanggal)='" & Year(DTP3.Text) &

"'", CONN)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'

DA = New OleDbDataAdapter("SELECT

tblgaji.id_gaji,tanggal,tblkaryawan.id_karyawan,nama_karyawan,tblgaji.total_pendapatan,total_potong an,gaji_bersih FROM TBLGAJI,tblkaryawan where tblgaji.id_karyawan=tblkaryawan.id_karyawan and month(tblgaji.tanggal)='" & Month(DTP1.Text) & "' and year(tblgaji.tanggal)='" & Year(DTP1.Text) &

DS = New DataSet DA.Fill(DS)

DGV.DataSource = DS.Tables(0) DGV.ReadOnly = True

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Cetak.Show()

Cetak.CRV.SelectionFormula = "month({tblgaji.tanggal})=(" & Month(DTP1.Text) & ") and year({tblgaji.tanggal})=(" & Year(DTP1.Text) & ")"

laporan.Load("LAP gaji.rpt") Call SetingLaporan()

Cetak.CRV.ReportSource = laporan Cetak.CRV.RefreshReport() End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

Cetak.Show()

Cetak.CRV.SelectionFormula = "{tblpotongan.nama_potongan}='PPh 21' and month({tblgaji.tanggal})=(" & Month(DTP2.Text) & ") and year({tblgaji.tanggal})=(" &

Year(DTP2.Text) & ")"

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

Cetak.Show()

Cetak.CRV.SelectionFormula = "{tblpotongan.nama_potongan}='BPJS' and month({tblgaji.tanggal})=(" & Month(DTP2.Text) & ") and year({tblgaji.tanggal})=(" &

Year(DTP2.Text) & ")"

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

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

Dokumen terkait