FRMLogin.vb FRMBarang.vb

133 LAMPIRAN C LAMPIRAN SOURCE CODE

1. FRMLogin.vb

Public Class Login Private Sub butLogin_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butLogin.Click ProgressBar1.Minimum = 0 ProgressBar1.Maximum = 10 Dim i As Integer For i = 1 To 10 ProgressBar1.Value = i Application.DoEvents System.Threading.Thread.Sleep100 Next Visible = False If txtAdmin.Text = admin And txtPassword.Text = Admin Then FRMInventaris.Show Else MsgBox Gagal Login End If End Sub End Class

2. FRMBarang.vb

Public Class Form1 Inherits System.Windows.Forms.Form Dim statusSimpan As String Dim btApp As BarTender.ApplicationClass Dim btFormat As BarTender.Format Private Sub Form1_FormClosing ByVal sender As Object , ByVal e As System.Windows.Forms.FormClosingEventArgs Handles Me .FormClosing btApp.Quit End Sub Private Sub Form1_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 statusSimpan = update btApp = New BarTender.ApplicationClass End Sub Private Sub butSimpan_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butSimpan.Click Try If statusSimpan.Equals simpan Then 134 Me .TBLBarangTableAdapter.InsertQuery Me .txtKodeBarang.Text, Me .txtNamaBarang.Text, Me .txtTipeBarang.Text, Me .comKondisi.Text, _ Me .dateTglMasuk.Text, Me .txtJumlah.Text, Me .comDivisi.Text, Me .txtHarga.Text Else Me .TBLBarangTableAdapter.UpdateQuery Me .txtNamaBarang.Text, Me .txtTipeBarang.Text, Me .comKondisi.Text, _ Me .dateTglMasuk.Text, Me .txtJumlah.Text, Me .comDivisi.Text, Me .txtHarga.Text, Me .txtKodeBarang.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 BindingNavigatorAddNewItem.Click statusSimpan = simpan End Sub Private Sub BindingNavigatorDeleteItem_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles BindingNavigatorDeleteItem.Click If MessageBox.Show Apakah akan dihapus ? , Hapus Data , MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1 = Windows.Forms.DialogResult.Yes Then Me .TBLBarangTableAdapter.DeleteQuery Me .txtKodeBarang.Text End If End Sub Private Sub butCari_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butCari.Click Me .TBLBarangTableAdapter.Fill_CariDataINVENDataSet.TBLBarang, Me .txtCari.Text End Sub Private Sub butRefresh_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles butRefresh.Click Me .TBLBarangTableAdapter.FillINVENDataSet.TBLBarang End Sub Private Sub Button1_Click ByVal sender As System.Object, ByVal e As System.EventArgs Handles Button1.Click btFormat = btApp.Formats.Open c:\Inventaris.btw , False , btFormat.PrintOut False , False btFormat.CloseBarTender.BtSaveOptions.btDoNotSaveChanges 135 End Sub End Class

3. FRMKembali.vb