FRMLaporanBarang.vb FRMLaporanTransaksi.vb FRMTransaksi.vb

136 Me .datetglKembali.Text, Me .labKeperluan.Text, Me .labKeperluan.Text Else Me .TBLKeluarHeaderTableAdapter.UpdateTransaksiBaru Me .txtNoTransak si.Text, Me .labKeluar.Text, Me .labNamaPegawai.Text, Me .datetglKembali.Text, Me .labKeperluan.Text, Me .labKeperluan.Text End If Catch ex As Exception MessageBox.Show Gagal Simpan Data End Try Me .TBLBarangTableAdapter.FillINVENDataSet.TBLBarang statusSimpan = update End Sub Private Sub BindingNavigatorAddNewItem_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butTambah.Click Me .BinKembali.AddNew Me .BindingNavigatorPositionItem.Enabled = False Me .BindingNavigatorMovePreviousItem.Enabled = False Me .BindingNavigatorMoveFirstItem.Enabled = False Me .butTambah.Enabled = False End Sub Private Sub butCari_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butCari.Click Me .TBLKeluarHeaderTableAdapter.Fill_CariTransaksiINVENDataSet.TBL KeluarHeader, Me .txtCariTransaksi.Text End Sub Private Sub butRefresh_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butRefresh.Click Me .TBLKeluarHeaderTableAdapter.FillINVENDataSet.TBLKeluarHeader End Sub End Class

4. FRMLaporanBarang.vb

Imports System.Data Public Class FRMLaporanBarang Dim rep As RPTBarang Private Sub ButTampil_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles ButTampil.Click rep = New RPTBarang Dim dtBarang As DataTable If Me .cmbDivisi.Text = Semua Data Then dtBarang = Me .TblBarangTableAdapter1.GetData Else dtBarang = Me .TblBarangTableAdapter1.FilterDenganDivisi Me .cmbDivisi.Text End If 137 rep.SetDataSourcedtBarang Me .repViewer.ReportSource = rep End Sub Private Sub FRMLaporanBarang_Load ByVal sender As System.Object, ByVal e As System.EventArgs Handles MyBase .Load Dim dtDivisi As DataTable Dim dataTableDivisi As INVENDataSetTableAdapters.TBLBarangDivisiTableAdapter dataTableDivisi = New INVENDataSetTableAdapters.TBLBarangDivisiTableAdapter dtDivisi = dataTableDivisi.PilihDivisi Tampilkan jenis - jenis barang pada combobox jenis Me .cmbDivisi.Items.Add Semua Data For Each drDivisi As DataRow In dtDivisi.Rows Me .cmbDivisi.Items.AdddrDivisi.Item0 Next End Sub End Class 138

5. FRMLaporanTransaksi.vb

Imports System.Data Public Class FRMLaporanTransaksi Dim rep As RPTTransaksi Private Sub butTampilkan_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butTampilkan.Click rep = New RPTTransaksi Dim dt As DataTable Dim dtTransaksi As INVENDataSetTableAdapters.TBLTransaksiTableAdapter dtTransaksi = New INVENDataSetTableAdapters.TBLTransaksiTableAdapter dt = dtTransaksi.GetData rep.SetDataSourcedt Me .repViewerT.ReportSource = rep End Sub Private Sub butFilter_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butFilter.Click rep = New RPTTransaksi Dim dt As DataTable Dim dtTransaksi As INVENDataSetTableAdapters.TBLTransaksiTableAdapter dtTransaksi = New INVENDataSetTableAdapters.TBLTransaksiTableAdapter dt = dtTransaksi.FilterBerdasarkanTanggal Me .dtDariTanggal.Value, Me .dtSampaiTanggal.Value rep.SetDataSourcedt Me .repViewerT.ReportSource = rep End Sub End Class

6. FRMTransaksi.vb

Public Class FRMTransaksi Dim statusSimpan As String Private Sub FRMTransaksi_Load ByVal sender As System.Object, ByVal e As System.EventArgs Handles MyBase .Load TODO: This line of code loads data into the INVENDataSet.TBLBarang table. You can move, or remove it, as needed. Me .TBLBarangTableAdapter.Fill Me .INVENDataSet.TBLBarang TODO: This line of code loads data into the INVENDataSet.TBLKeluarDetail table. You can move, or remove it, as needed. Me .TBLKeluarDetailTableAdapter.Fill Me .INVENDataSet.TBLKeluarDetai l TODO: This line of code loads data into the INVENDataSet.TBLKeluarHeader table. You can move, or remove it, as needed. 139 Me .TBLKeluarHeaderTableAdapter.Fill Me .INVENDataSet.TBLKeluarHeade r statusSimpan = update End Sub Private Sub butTambahTr_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butTambahTr.Click Me .BinTransaksi.AddNew Me .BindingNavigatorPositionItem.Enabled = False Me .BindingNavigatorMovePreviousItem.Enabled = False Me .BindingNavigatorMoveFirstItem.Enabled = False Me .butTambahTr.Enabled = False End Sub Private Sub butHapusTr_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butHapusTr.Click Me .BinTransaksi.RemoveAt CInt Me .BindingNavigatorPositionItem.Text - 1 Me .butTambahTr.Enabled = True Me .BindingNavigatorPositionItem.Enabled = True Me .BindingNavigatorMovePreviousItem.Enabled = True Me .BindingNavigatorMoveFirstItem.Enabled = True End Sub Private Sub butSimpanTr_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butSimpanTr.Click Me .BinTransaksi.EndEdit Me .butTambahTr.Enabled = True Me .BindingNavigatorPositionItem.Enabled = True Me .BindingNavigatorMovePreviousItem.Enabled = True Me .BindingNavigatorMoveFirstItem.Enabled = True Try If statusSimpan.Equals simpan Then Me .TBLKeluarHeaderTableAdapter.InsertTransaksiBaru Me .txtNoTransak si.Text, Me .dateTglKeluar.Text, Me .txtNamaPegawai.Text, Me .datetglKembali.Text, Me .txtKeperluan.Text, Me .txtKeperluan.Text Else Me .TBLKeluarHeaderTableAdapter.UpdateTransaksiBaru Me .txtNoTransak si.Text, Me .dateTglKeluar.Text, Me .txtNamaPegawai.Text, Me .datetglKembali.Text, Me .txtKeperluan.Text, Me .txtKeperluan.Text End If Catch ex As Exception MessageBox.Show Gagal Simpan Data End Try Me .TBLBarangTableAdapter.FillINVENDataSet.TBLBarang statusSimpan = update End Sub 140 Private Sub butTambah_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butTambah.Click Me .TBLKeluarDetailTableAdapter.TambahTransaksitxtNoTransaksi.Text , txtKodeBarang.Text, txtDivisi.Text, Convert.ToDecimaltxtJumlah.Text Me .TBLKeluarDetailTableAdapter.Fill Me .INVENDataSet.TBLKeluarDetai l Me .FKTBLKeluarDetailTBLKeluarHeaderBindingSource.ResetBindings Fal se Me .BinTransaksi.ResetBindings False End Sub Private Sub txtKodeBarang_TextChanged ByVal sender As System.Object, ByVal e As System.EventArgs Handles txtKodeBarang.TextChanged Me .TBLBarangTableAdapter.Fill_CariDataINVENDataSet.TBLBarang, txtKodeBarang.Text End Sub Private Sub FKTBLKeluarDetailTBLKeluarHeaderBindingSource_CurrentChanged ByVal sender As System.Object, ByVal e As System.EventArgs Handles FKTBLKeluarDetailTBLKeluarHeaderBindingSource.CurrentChanged End Sub Private Sub butCetak_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butCetak.Click Me .butSimpanTr_Clicksender, e Tampilkan Faktur FakturTransaksi.MdiParent = Me .MdiParent FakturTransaksi.setNoTransaksi Me .txtNoTransaksi.Text FakturTransaksi.Show End Sub End Class

7. FRMFakturTransaksi.vb