Aplikasi Program Inventori Persediaan Barang

Metode FIFO, LIFO Dan AVERAGE

(KONSULTASIVB.COM)

 

 

 

 

 

 

 

 

 

 

Module Koneksi Database

 

Imports System.Data.SqlClient

 

Module Module1

    Public CONN As SqlConnection

    Public DA As SqlDataAdapter

    Public DS As New DataSet

    Public CMD As SqlCommand

    Public DR As SqlDataReader

    Public STR As String

 

    Sub Koneksi()

        STR = "data source=user-pc\sqlexpress;initial catalog=fifoinventori;integrated security =true"

        CONN = New SqlConnection(STR)

        If CONN.State = ConnectionState.Closed Then

            CONN.Open()

        End If

    End Sub

End Module

 

 

 

 

Imports System.Data.SqlClient

 

Public Class Login

 

    Dim hitung As Integer

 

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

        Call Koneksi()

        CMD = New SqlCommand("select * from tbluser where nama_user='" & Tnama.Text & "' and pwd_user='" & TPassword.Text & "'", CONN)

        dr = cmd.ExecuteReader

        dr.Read()

        If dr.HasRows Then

            If DR(3) <> TPassword.Text Then

                MsgBox("password salah")

                TPassword.Clear()

                TPassword.Focus()

                Exit Sub

            End If

            Me.Visible = False

            Menuutama.Show()

            Menuutama.panelkode.Text = dr(0)

            Menuutama.panelnama.Text = dr(1)

            Menuutama.panelstatus.Text = UCase(dr(2))

            If Menuutama.panelstatus.Text <> "ADMIN" Then

                Menuutama.UserToolStripMenuItem.Visible = False

                Menuutama.BTNUser.Visible = False

                MenuUtama.btnuser.Visible = False

            Else

                Menuutama.UserToolStripMenuItem.Visible = True

                Menuutama.BTNUser.Visible = True

                MenuUtama.btnuser.Visible = True

            End If

        Else

            MsgBox("login gagal")

            Tnama.Clear() : TPassword.Clear() : Tnama.Focus()

 

            hitung = hitung + 1

            If hitung > 2 Then

                End

            End If

        End If

    End Sub

 

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

        End

    End Sub

 

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

        Me.CenterToScreen()

    End Sub

End Class

 

 

 

Imports System.Data.SqlClient

 

Public Class MenuUtama

 

    Private Sub UserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UserToolStripMenuItem.Click

        User.Show()

    End Sub

 

    Private Sub BarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BarangToolStripMenuItem.Click

        Barang.Show()

    End Sub

 

    Private Sub SupplierToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SupplierToolStripMenuItem.Click

        supplier.Show()

    End Sub

 

    Private Sub CustomerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerToolStripMenuItem.Click

        customer.Show()

    End Sub

 

    Private Sub BarangMasukToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BarangMasukToolStripMenuItem.Click

        Masuk.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

        If e.KeyCode = Keys.Enter Then

            UjiSql.Show()

        End If

    End Sub

 

    Private Sub btnuser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnuser.Click

        User.Show()

    End Sub

 

    Private Sub btnbarang_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbarang.Click

        Barang.Show()

    End Sub

 

    Private Sub btnsupplier_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsupplier.Click

        supplier.Show()

    End Sub

 

    Private Sub btncustomer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncustomer.Click

        customer.Show()

    End Sub

 

    Private Sub btnpembelian_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpembelian.Click

        Masuk.Show()

    End Sub

 

    Private Sub btnpenjualan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpenjualan.Click

        Keluar_FIFO.Show()

    End Sub

 

    Private Sub BTNTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNTutup.Click

        End

    End Sub

 

    Private Sub BTNLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNLogout.Click

        Me.Close()

        Login.Show()

        Login.Tnama.Clear()

        Login.TPassword.Clear()

        Login.Tnama.Focus()

    End Sub

 

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

        LaporanStok.Show()

    End Sub

 

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

        Keluar_LIFO.Show()

    End Sub

 

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

        Keluar_Average.Show()

    End Sub

 

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

        UjiSql.Show()

    End Sub

 

    Private Sub btnlapreturjual_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlapreturjual.Click

        LaporanStok.Show()

    End Sub

 

    Private Sub TransaksiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TransaksiToolStripMenuItem.Click

        Masuk.Show()

    End Sub

 

    Private Sub BarangKeluarFIFOToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BarangKeluarFIFOToolStripMenuItem.Click

        Keluar_FIFO.Show()

    End Sub

 

    Private Sub BarangKeluarLIFOToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BarangKeluarLIFOToolStripMenuItem.Click

        Keluar_LIFO.Show()

    End Sub

 

    Private Sub BarangKeluarAverageToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BarangKeluarAverageToolStripMenuItem.Click

        Keluar_Average.Show()

    End Sub

 

    Private Sub StokBarangToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StokBarangToolStripMenuItem.Click

        LaporanStok.Show()

    End Sub

 

    Private Sub LogOutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOutToolStripMenuItem.Click

        Me.Close()

        Login.Show()

        Login.Tnama.Clear()

        Login.TPassword.Clear()

        Login.Tnama.Focus()

    End Sub

 

    Private Sub TutupToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TutupToolStripMenuItem.Click

        End

    End Sub

End Class

 

 

 

Imports System.Data.SqlClient

 

Public Class User

 

    Sub Kosongkan()

        TextBox1.Clear()

        TextBox2.Clear()

        TextBox3.Clear()

        ComboBox1.Text = ""

        TextBox1.Focus()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        TextBox3.Clear()

        ComboBox1.Text = ""

        TextBox2.Focus()

    End Sub

 

    Sub Tampilgrid()

        Call Koneksi()

        DA = New SqlDataAdapter("select * from tbluser", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

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

        Call Koneksi()

        Call Tampilgrid()

        Me.CenterToScreen()

    End Sub

 

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

        TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Call Koneksi()

            CMD = New SqlCommand("select * from tbluser where id_User='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If DR.HasRows Then

                TextBox2.Text = DR.Item("nama_user")

                TextBox3.Text = DR.Item("pwd_user")

                ComboBox1.Text = DR.Item("status_user")

                TextBox2.Focus()

            Else

                Call DataBaru()

            End If

        End If

    End Sub

 

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

        TextBox2.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

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

        TextBox3.MaxLength = 10

        If e.KeyChar = Chr(13) Then

            ComboBox1.Focus()

        End If

    End Sub

 

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

        ComboBox1.MaxLength = 15

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or ComboBox1.Text = "" Then

            MsgBox("data belum lengkap")

            Exit Sub

        Else

            Call Koneksi()

            CMD = New SqlCommand("select * from tbluser where id_User='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If Not DR.HasRows Then

                Call Koneksi()

                Dim simpan As String = "insert into tbluser values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & ComboBox1.Text & "')"

                CMD = New SqlCommand(simpan, CONN)

                CMD.ExecuteNonQuery()

            Else

                Call Koneksi()

                Dim edit As String = "update tbluser set nama_user='" & TextBox2.Text & "',pwd_user='" & TextBox3.Text & "',status_user='" & ComboBox1.Text & "' where id_User='" & TextBox1.Text & "'"

                CMD = New SqlCommand(edit, CONN)

                CMD.ExecuteNonQuery()

            End If

            Call Kosongkan()

            Call Tampilgrid()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Then

            MsgBox("kode user harus diisi dulu")

            TextBox1.Focus()

            Exit Sub

        Else

            If MessageBox.Show("hapus data ini...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

                Call Koneksi()

                Dim hapus As String = "delete from tbluser where id_User='" & TextBox1.Text & "'"

                CMD = New SqlCommand(hapus, CONN)

                CMD.ExecuteNonQuery()

                Call Kosongkan()

                Call Tampilgrid()

            Else

                Call Kosongkan()

            End If

        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 TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged

        Call Koneksi()

        CMD = New SqlCommand("select * from tbluser where nama_user like '%" & TextBox4.Text & "%'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            Call Koneksi()

            DA = New SqlDataAdapter("select * from tbluser where nama_user like '%" & TextBox4.Text & "%'", CONN)

            DS = New DataSet

            DA.Fill(DS)

            DGV.DataSource = DS.Tables(0)

        Else

            MsgBox("Nama user tidak ditemukan")

        End If

    End Sub

 

    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

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells(1).Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells(2).Value

        ComboBox1.Text = DGV.Rows(e.RowIndex).Cells(3).Value

    End Sub

End Class

 

 

 

Imports System.Data.SqlClient

 

Public Class Barang

 

    Sub Kosongkan()

        TextBox1.Clear()

        TextBox2.Clear()

        TextBox3.Clear()

        ComboBox1.Text = ""

        ComboBox2.Text = ""

        TextBox1.Focus()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        TextBox3.Clear()

        ComboBox1.Text = ""

        ComboBox2.Text = ""

        TextBox2.Focus()

    End Sub

 

    Sub Tampilgrid()

        Call Koneksi()

        DA = New SqlDataAdapter("select * from tblBarang", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

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

        Me.CenterToScreen()

        Call Koneksi()

        Call Tampilgrid()

    End Sub

 

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

        TextBox1.MaxLength = 13

        If e.KeyChar = Chr(13) Then

            Call Koneksi()

            CMD = New SqlCommand("select * from tblBarang where id_Barang='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If DR.HasRows Then

                TextBox2.Text = DR.Item("nama_Barang")

                ComboBox1.Text = DR.Item("Satuan")

                ComboBox2.Text = DR.Item("lokasi")

                TextBox2.Focus()

            Else

                Call DataBaru()

            End If

        End If

    End Sub

 

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

        TextBox2.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            ComboBox1.Focus()

        End If

    End Sub

 

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

        If e.KeyChar = Chr(13) Then

            ComboBox2.Focus()

        End If

    End Sub

 

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

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Or TextBox2.Text = "" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Then

            MsgBox("data belum lengkap")

            Exit Sub

        Else

            Call Koneksi()

            CMD = New SqlCommand("select * from tblBarang where id_Barang='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If Not DR.HasRows Then

                Call Koneksi()

                Dim simpan As String = "insert into tblBarang values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & UCase(ComboBox1.Text) & "','" & UCase(ComboBox2.Text) & "',0,'-')"

                CMD = New SqlCommand(simpan, CONN)

                CMD.ExecuteNonQuery()

            Else

                Call Koneksi()

                Dim edit As String = "update tblBarang set nama_Barang='" & TextBox2.Text & "',Satuan='" & UCase(ComboBox1.Text) & "',lokasi='" & UCase(ComboBox2.Text) & "' where id_Barang='" & TextBox1.Text & "'"

                CMD = New SqlCommand(edit, CONN)

                CMD.ExecuteNonQuery()

            End If

            Call Kosongkan()

            Call Tampilgrid()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Then

            MsgBox("kode Barang harus diisi dulu")

            TextBox1.Focus()

            Exit Sub

        Else

            If MessageBox.Show("hapus data ini...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

                Call Koneksi()

                Dim edit As String = "update tblBarang set keterangan='DIHAPUS' where id_Barang='" & TextBox1.Text & "'"

                CMD = New SqlCommand(edit, CONN)

                CMD.ExecuteNonQuery()

                Call Kosongkan()

                Call Tampilgrid()

            Else

                Call Kosongkan()

            End If

        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 TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged

        Call Koneksi()

        CMD = New SqlCommand("select * from tblBarang where nama_Barang like '%" & TextBox3.Text & "%'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            Call Koneksi()

            DA = New SqlDataAdapter("select * from tblBarang where nama_Barang like '%" & TextBox3.Text & "%'", CONN)

            DS = New DataSet

            DA.Fill(DS)

            DGV.DataSource = DS.Tables(0)

        Else

            MsgBox("Nama Barang tidak ditemukan")

        End If

    End Sub

 

    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

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells(1).Value

        ComboBox1.Text = DGV.Rows(e.RowIndex).Cells(2).Value

        ComboBox2.Text = DGV.Rows(e.RowIndex).Cells(3).Value

    End Sub

End Class

 

 

Imports System.Data.SqlClient

 

Public Class supplier

 

    Sub Kosongkan()

        TextBox1.Clear()

        TextBox2.Clear()

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox1.Focus()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Tampilgrid()

        Call Koneksi()

        DA = New SqlDataAdapter("select * from tblsupplier", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

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

        Me.CenterToScreen()

        Call Koneksi()

        Call Tampilgrid()

    End Sub

 

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

        TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Call Koneksi()

            CMD = New SqlCommand("select * from tblsupplier where id_supplier='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If DR.HasRows Then

                TextBox2.Text = DR.Item("nama_supplier")

                TextBox3.Text = DR.Item("alamat_supplier")

                TextBox4.Text = DR.Item("telepon_supplier")

                TextBox5.Text = DR.Item("pic_supplier")

                TextBox2.Focus()

            Else

                Call DataBaru()

            End If

        End If

    End Sub

 

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

        TextBox2.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

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

        TextBox3.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            TextBox4.Focus()

        End If

    End Sub

 

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

        TextBox4.MaxLength = 15

        If e.KeyChar = Chr(13) Then

            TextBox5.Focus()

        End If

    End Sub

 

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

        TextBox5.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Then

            MsgBox("data belum lengkap")

            Exit Sub

        Else

            Call Koneksi()

            CMD = New SqlCommand("select * from tblsupplier where id_supplier='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If Not DR.HasRows Then

                Call Koneksi()

                Dim simpan As String = "insert into tblsupplier values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','AKTIF')"

                CMD = New SqlCommand(simpan, CONN)

                CMD.ExecuteNonQuery()

            Else

                Call Koneksi()

                Dim edit As String = "update tblsupplier set nama_supplier='" & TextBox2.Text & "',alamat_supplier='" & TextBox3.Text & "',telepon_supplier='" & TextBox4.Text & "',PIC_SUPPLIER='" & TextBox5.Text & "' where id_supplier='" & TextBox1.Text & "'"

                CMD = New SqlCommand(edit, CONN)

                CMD.ExecuteNonQuery()

            End If

            Call Kosongkan()

            Call Tampilgrid()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Then

            MsgBox("kode supplier harus diisi dulu")

            TextBox1.Focus()

            Exit Sub

        Else

            If MessageBox.Show("hapus data ini...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

                Call Koneksi()

                Dim edit As String = "update tblsupplier set STATUS_supplier='TIDAK AKTIF' where id_supplier='" & TextBox1.Text & "'"

                CMD = New SqlCommand(edit, CONN)

                CMD.ExecuteNonQuery()

                Call Kosongkan()

                Call Tampilgrid()

            Else

                Call Kosongkan()

            End If

        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 TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged

        Call Koneksi()

        CMD = New SqlCommand("select * from tblsupplier where nama_supplier like '%" & TextBox6.Text & "%'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            Call Koneksi()

            DA = New SqlDataAdapter("select * from tblsupplier where nama_supplier like '%" & TextBox6.Text & "%'", CONN)

            DS = New DataSet

            DA.Fill(DS)

            DGV.DataSource = DS.Tables(0)

        Else

            MsgBox("Nama supplier tidak ditemukan")

        End If

    End Sub

 

    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

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells(1).Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells(2).Value

        TextBox4.Text = DGV.Rows(e.RowIndex).Cells(3).Value

        TextBox5.Text = DGV.Rows(e.RowIndex).Cells(4).Value

 

    End Sub

End Class

 

 

Imports System.Data.SqlClient

 

Public Class customer

 

    Sub Kosongkan()

        TextBox1.Clear()

        TextBox2.Clear()

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox1.Focus()

    End Sub

 

    Sub DataBaru()

        TextBox2.Clear()

        TextBox3.Clear()

        TextBox4.Clear()

        TextBox5.Clear()

        TextBox2.Focus()

    End Sub

 

    Sub Tampilgrid()

        Call Koneksi()

        DA = New SqlDataAdapter("select * from tblcustomer", CONN)

        DS = New DataSet

        DA.Fill(DS)

        DGV.DataSource = DS.Tables(0)

        DGV.ReadOnly = True

    End Sub

 

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

        Call Koneksi()

        Call Tampilgrid()

    End Sub

 

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

        TextBox1.MaxLength = 5

        If e.KeyChar = Chr(13) Then

            Call Koneksi()

            CMD = New SqlCommand("select * from tblcustomer where id_Customer='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If DR.HasRows Then

                TextBox2.Text = DR.Item("nama_customer")

                TextBox3.Text = DR.Item("alamat_customer")

                TextBox4.Text = DR.Item("telepon_customer")

                TextBox5.Text = DR.Item("PIC_Customer")

                TextBox2.Focus()

            Else

                Call DataBaru()

            End If

        End If

    End Sub

 

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

        TextBox2.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            TextBox3.Focus()

        End If

    End Sub

 

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

        TextBox3.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            TextBox4.Focus()

        End If

    End Sub

 

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

        TextBox4.MaxLength = 15

        If e.KeyChar = Chr(13) Then

            TextBox5.Focus()

        End If

    End Sub

 

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

        TextBox5.MaxLength = 30

        If e.KeyChar = Chr(13) Then

            Button1.Focus()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Then

            MsgBox("data belum lengkap")

            Exit Sub

        Else

            Call Koneksi()

            CMD = New SqlCommand("select * from tblcustomer where id_Customer='" & TextBox1.Text & "'", CONN)

            DR = CMD.ExecuteReader

            DR.Read()

            If Not DR.HasRows Then

                Call Koneksi()

                Dim simpan As String = "insert into tblcustomer values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','AKTIF')"

                CMD = New SqlCommand(simpan, CONN)

                CMD.ExecuteNonQuery()

            Else

                Call Koneksi()

                Dim edit As String = "update tblcustomer set nama_customer='" & TextBox2.Text & "',alamat_customer='" & TextBox3.Text & "',telepon_customer='" & TextBox4.Text & "',pic_customer='" & TextBox5.Text & "' where id_Customer='" & TextBox1.Text & "'"

                CMD = New SqlCommand(edit, CONN)

                CMD.ExecuteNonQuery()

            End If

            Call Kosongkan()

            Call Tampilgrid()

        End If

    End Sub

 

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

        If TextBox1.Text = "" Then

            MsgBox("kode customer harus diisi dulu")

            TextBox1.Focus()

            Exit Sub

        Else

            If MessageBox.Show("hapus data ini...?", "", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then

                Call Koneksi()

               Dim edit As String = "update tblcustomer set STATUS_customer='TIDAK AKTIF' where id_Customer='" & TextBox1.Text & "'"

                CMD = New SqlCommand(edit, CONN)

                CMD.ExecuteNonQuery()

                Call Kosongkan()

                Call Tampilgrid()

            Else

                Call Kosongkan()

            End If

        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 TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged

        Call Koneksi()

        CMD = New SqlCommand("select * from tblcustomer where nama_customer like '%" & TextBox6.Text & "%'", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If DR.HasRows Then

            Call Koneksi()

            DA = New SqlDataAdapter("select * from tblcustomer where nama_customer like '%" & TextBox6.Text & "%'", CONN)

            DS = New DataSet

            DA.Fill(DS)

            DGV.DataSource = DS.Tables(0)

        Else

            MsgBox("Nama customer tidak ditemukan")

        End If

    End Sub

 

    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

        TextBox2.Text = DGV.Rows(e.RowIndex).Cells(1).Value

        TextBox3.Text = DGV.Rows(e.RowIndex).Cells(2).Value

        TextBox4.Text = DGV.Rows(e.RowIndex).Cells(3).Value

        TextBox5.Text = DGV.Rows(e.RowIndex).Cells(4).Value

 

    End Sub

End Class

 

 

 

Metode FIFO

 

 

Imports System.Data.SqlClient

 

Public Class Keluar_FIFO

    Sub Notis()

        Call Koneksi()

        CMD = New SqlCommand("select Id_Transaksi from tblkeluar order by Id_Transaksi desc", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TIDtransaksi.Text = Format(Now, "yyMMdd") + "0001"

        Else

            If Microsoft.VisualBasic.Left(DR.Item("Id_Transaksi"), 6) = Format(Now, "yyMMdd") Then

                TIDtransaksi.Text = DR.Item("Id_Transaksi") + 1

            Else

                TIDtransaksi.Text = Format(Now, "yyMMdd") + "0001"

            End If

        End If

    End Sub

 

    Sub Kosongkan()

        TIDbarang.Clear()

        Tstokbarang.Clear()

        Tpenanggungjawab.Text = "-"

        Tketerangan.Text = "-"

        LTotalBarang.Text = 0

        LTotalHarga.Text = 0

        DGV.Columns.Clear()

        TIDtransaksi.Focus()

    End Sub

 

    Sub TampilCustomer()

        Call Koneksi()

        CMD = New SqlCommand("select * from tblCustomer where status_Customer='AKTIF'", CONN)

        DR = CMD.ExecuteReader

        Do While DR.Read

            ListBox1.Items.Add(DR(0) & Space(1) & DR(1))

        Loop

    End Sub

 

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

        Me.CenterToScreen()

        Me.CenterToScreen()

        Call Kosongkan()

        Call TampilCustomer()

        Call Notis()

        TIDtransaksi.Enabled = False

 

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            Tpenanggungjawab.Focus()

        End If

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            DGV.Focus()

        End If

    End Sub

 

    Sub HitungTotal()

        Dim x As Integer

        For baris As Integer = 0 To DGV.RowCount - 1

            x = x + DGV.Rows(baris).Cells("Keluar").Value

        Next

        LTotalBarang.Text = x

 

        Dim y As Integer

        For baris As Integer = 0 To DGV.RowCount - 1

            y = y + DGV.Rows(baris).Cells("Total").Value

        Next

        LTotalHarga.Text = y

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            ListBox1.Focus()

        End If

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            BTNSimpan.Focus()

        End If

    End Sub

 

    Private Sub BTNBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNBatal.Click

        Call Kosongkan()

        TIDbarang.Focus()

    End Sub

 

    Private Sub BTNTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNTutup.Click

        Me.Close()

    End Sub

 

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

        Masuk.Show()

    End Sub

End Class

 

 

Metode LIFO

 

 

Imports System.Data.SqlClient

 

Public Class Keluar_LIFO

    Sub Notis()

        Call Koneksi()

        CMD = New SqlCommand("select Id_Transaksi from tblkeluar order by Id_Transaksi desc", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TIDtransaksi.Text = Format(Now, "yyMMdd") + "0001"

        Else

            If Microsoft.VisualBasic.Left(DR.Item("Id_Transaksi"), 6) = Format(Now, "yyMMdd") Then

                TIDtransaksi.Text = DR.Item("Id_Transaksi") + 1

            Else

                TIDtransaksi.Text = Format(Now, "yyMMdd") + "0001"

            End If

        End If

    End Sub

 

    Sub Kosongkan()

        TIDbarang.Clear()

        Tstokbarang.Clear()

        Tpenanggungjawab.Text = "-"

        Tketerangan.Text = "-"

        LTotalBarang.Text = 0

        LTotalHarga.Text = 0

        DGV.Columns.Clear()

        TIDtransaksi.Focus()

    End Sub

 

    Sub TampilCustomer()

        Call Koneksi()

        CMD = New SqlCommand("select * from tblCustomer where status_Customer='AKTIF'", CONN)

        DR = CMD.ExecuteReader

        Do While DR.Read

            ListBox1.Items.Add(DR(0) & Space(1) & DR(1))

        Loop

    End Sub

 

 

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

        Me.CenterToScreen()

        Me.CenterToScreen()

        Call Kosongkan()

        Call TampilCustomer()

        Call Notis()

        TIDtransaksi.Enabled = False

 

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            Tpenanggungjawab.Focus()

        End If

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            DGV.Focus()

        End If

    End Sub

 

    Sub HitungTotal()

        Dim x As Integer

        For baris As Integer = 0 To DGV.RowCount - 1

            x = x + DGV.Rows(baris).Cells("Keluar").Value

        Next

        LTotalBarang.Text = x

 

        Dim y As Integer

        For baris As Integer = 0 To DGV.RowCount - 1

            y = y + DGV.Rows(baris).Cells("Total").Value

        Next

        LTotalHarga.Text = y

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            ListBox1.Focus()

        End If

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            BTNSimpan.Focus()

        End If

    End Sub

 

    Private Sub BTNBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNBatal.Click

        Call Kosongkan()

        TIDbarang.Focus()

    End Sub

 

    Private Sub BTNTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNTutup.Click

        Me.Close()

    End Sub

 

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

        Masuk.Show()

    End Sub

 

End Class

 

 

Metode AVERAGE

 

 

Imports System.Data.SqlClient

Imports System.Math

 

Public Class Keluar_Average

    Sub Notis()

        Call Koneksi()

        CMD = New SqlCommand("select Id_Transaksi from tblkeluar order by Id_Transaksi desc", CONN)

        DR = CMD.ExecuteReader

        DR.Read()

        If Not DR.HasRows Then

            TIDtransaksi.Text = Format(Now, "yyMMdd") + "0001"

        Else

            If Microsoft.VisualBasic.Left(DR.Item("Id_Transaksi"), 6) = Format(Now, "yyMMdd") Then

                TIDtransaksi.Text = DR.Item("Id_Transaksi") + 1

            Else

                TIDtransaksi.Text = Format(Now, "yyMMdd") + "0001"

            End If

        End If

    End Sub

 

    Sub Kosongkan()

        TIDbarang.Clear()

        Tstokbarang.Clear()

        Tpenanggungjawab.Text = "-"

        Tketerangan.Text = "-"

        LTotalBarang.Text = 0

        LTotalHarga.Text = 0

        DGV.Columns.Clear()

        TIDtransaksi.Focus()

    End Sub

 

    Sub TampilCustomer()

        Call Koneksi()

        CMD = New SqlCommand("select * from tblCustomer where status_Customer='AKTIF'", CONN)

        DR = CMD.ExecuteReader

        Do While DR.Read

            ListBox1.Items.Add(DR(0) & Space(1) & DR(1))

        Loop

    End Sub

 

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

        Me.CenterToScreen()

        Call Kosongkan()

        Call TampilCustomer()

        Call Notis()

        TIDtransaksi.Enabled = False

 

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            Tpenanggungjawab.Focus()

        End If

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            DGV.Focus()

        End If

    End Sub

 

    Sub HitungTotal()

        Dim x As Integer

        For baris As Integer = 0 To DGV.RowCount - 1

            x = x + DGV.Rows(baris).Cells("Keluar").Value

        Next

        LTotalBarang.Text = x

 

        Dim y As Integer

        For baris As Integer = 0 To DGV.RowCount - 1

            y = y + DGV.Rows(baris).Cells("Total").Value

        Next

        LTotalHarga.Text = y

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            ListBox1.Focus()

        End If

    End Sub

 

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

        If e.KeyCode = Keys.Enter Then

            BTNSimpan.Focus()

        End If

    End Sub

 

    Private Sub BTNBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNBatal.Click

        Call Kosongkan()

        TIDbarang.Focus()

    End Sub

 

    Private Sub BTNTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNTutup.Click

        Me.Close()

    End Sub

 

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

        Masuk.Show()

    End Sub

End Class

 

 

 

 

 

 

Imports System.Data.SqlClient

 

Public Class LaporanStok

 

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

 

        ListBox1.Items.Add("MASUK")

        ListBox1.Items.Add("KELUAR")

 

        Call Koneksi()

        CMD = New SqlCommand("select nama_barang from tblbarang", CONN)

        DR = CMD.ExecuteReader

        Do While DR.Read

            ListBox2.Items.Add(DR(0))

        Loop

    End Sub

 

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

       

        CRV.SelectionFormula = "totext({tblstok.tanggal}) ='" & Format(DateValue(Harian.Value), "dd/MM/yyyy") & "' AND {tblstok.keterangan} like '*" & ListBox1.Text & "*'"

        CRV.ReportSource = "laporan stok.rpt"

        CRV.RefreshReport()

    End Sub

 

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

        CRV.SelectionFormula = "{tblstok.keterangan} like '*" & ListBox1.Text & "*'"

        CRV.ReportSource = "laporan stok.rpt"

        CRV.RefreshReport()

    End Sub

 

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

        CRV.SelectionFormula = "totext({tblstok.tanggal}) >='" & Format(DateValue(Awal.Value), "dd/MM/yyyy") & "' AND totext({tblstok.tanggal}) <='" & Format(DateValue(Akhir.Value), "dd/MM/yyyy") & "' AND {tblstok.keterangan} like '*" & ListBox1.Text & "*'"

        CRV.ReportSource = "laporan stok.rpt"

        CRV.RefreshReport()

    End Sub

 

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

        CRV.SelectionFormula = "MONTH({tblstok.tanggal}) =(" & Month(Awal.Value) & ") AND YEAR({tblstok.tanggal}) =(" & Year(Akhir.Value) & ") AND {tblstok.keterangan} like '*" & ListBox1.Text & "*'"

        CRV.ReportSource = "laporan stok.rpt"

        CRV.RefreshReport()

    End Sub

 

    Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged

        CRV.SelectionFormula = "{tblBARANG.nama_barang}='" & ListBox2.Text & "' AND {tblstok.keterangan} like '*" & ListBox1.Text & "*'"

        CRV.ReportSource = "laporan stok.rpt"

        CRV.RefreshReport()

    End Sub

 

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

        CRV.ReportSource = "barang.rpt"

        CRV.RefreshReport()

    End Sub

 

    Private Sub BTNTutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNTutup.Click

        Me.Close()

    End Sub

End Class