ð Source Code Menu Utama:
Public Class Menuutama
Private Sub ObatToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ObatToolStripMenuItem.Click
obat.Show()
End Sub
Private Sub PasienToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasienToolStripMenuItem.Click
pasien.Show()
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub PenjualanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PenjualanToolStripMenuItem.Click
Penjualan.Show()
End Sub
Private Sub KwitansiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KwitansiToolStripMenuItem.Click
notapenjualan.Show()
End Sub
Private Sub LaporanPenjualanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LaporanPenjualanToolStripMenuItem.Click
L_Penjualan.Show()
End Sub
Private Sub Menuutama_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
ð Source Code Obat:
Public Class obat
Dim isitext(6) As String
Dim mlistitem As ListViewItem
Private Sub obat_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Call bersih()
Call settampilan()
End Sub
Private Sub obat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Button2.Text = "Simpan" Then
Button2.Text = "Ok"
Button1.Enabled = False
Button3.Enabled = False
Button4.Text = "Batal"
TextBox1.Focus()
Else
isitext(0) = Trim(TextBox1.Text)
isitext(1) = Trim(TextBox2.Text)
isitext(2) = Trim(TextBox3.Text)
isitext(3) = Trim(TextBox4.Text)
isitext(4) = Trim(TextBox5.Text)
isitext(5) = Trim(TextBox6.Text)
mlistitem = New ListViewItem(isitext)
ListView1.Items.Add(mlistitem)
Call bersih()
TextBox1.Focus()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If Button3.Text = "Hapus" Then
Button3.Text = "Ok"
Button1.Enabled = False
Button2.Enabled = False
Button4.Text = "Batal"
TextBox1.Focus()
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If Button4.Text = "keluar" Then
Me.Close()
Else
Call bersih()
Call normal()
TextBox1.Focus()
End If
End Sub
Sub bersih()
TextBox1.Text = " "
TextBox2.Text = " "
TextBox3.Text = " "
TextBox4.Text = " "
TextBox5.Text = " "
TextBox6.Text = " "
End Sub
Sub settampilan()
ListView1.View = View.Details
ListView1.Columns.Add("Kaaaaaaaat", 80, HorizontalAlignment.Center)
ListView1.Columns.Add("Nm Obat", 100, HorizontalAlignment.Left)
ListView1.Columns.Add("Jenis", 100, HorizontalAlignment.Left)
ListView1.Columns.Add("Golongan", 80, HorizontalAlignment.Left)
ListView1.Columns.Add("Satuan", 80, HorizontalAlignment.Left)
ListView1.Columns.Add("Harga", 150, HorizontalAlignment.Left)
End Sub
Sub normal()
Button1.Text = "Cari"
Button1.Enabled = True
Button2.Text = "Simpan"
Button2.Enabled = True
Button3.Text = "Hapus"
Button3.Enabled = True
Button4.Text = "Keluar"
End Sub
End Class
ð Source Code Penjualan :
Public Class Penjualan
Dim isitext(6) As String
Dim mlistitem As ListViewItem
Private Sub Penjualan_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Call bersih()
Call settampilan()
End Sub
Private Sub Penjualan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Button2.Text = "Simpan" Then
Button2.Text = "Ok"
Button1.Enabled = False
Button3.Enabled = False
Button4.Text = "Batal"
Button5.Enabled = False
TextBox1.Focus()
Else
isitext(0) = Trim(TextBox1.Text)
isitext(1) = Trim(DateTimePicker1.Text)
isitext(2) = Trim(TextBox3.Text)
isitext(3) = Trim(TextBox4.Text)
isitext(4) = Trim(TextBox5.Text)
isitext(5) = Trim(TextBox6.Text)
mlistitem = New ListViewItem(isitext)
ListView1.Items.Add(mlistitem)
Call bersih()
TextBox1.Focus()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If Button3.Text = "Hapus" Then
Button3.Text = "Ok"
Button1.Enabled = False
Button2.Enabled = False
Button4.Text = "Batal"
Button5.Enabled = False
TextBox1.Focus()
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If Button4.Text = "keluar" Then
Me.Close()
Else
Call bersih()
Call normal()
TextBox1.Focus()
End If
End Sub
Sub bersih()
TextBox1.Text = " "
TextBox3.Text = " "
TextBox4.Text = " "
TextBox5.Text = " "
TextBox6.Text = " "
End Sub
Sub settampilan()
ListView1.View = View.Details
ListView1.Columns.Add("Kd Obat", 80, HorizontalAlignment.Center)
ListView1.Columns.Add("Nm Obat", 100, HorizontalAlignment.Left)
ListView1.Columns.Add("Jenis", 100, HorizontalAlignment.Left)
ListView1.Columns.Add("Golongan", 80, HorizontalAlignment.Left)
ListView1.Columns.Add("Satuan", 80, HorizontalAlignment.Left)
ListView1.Columns.Add("Harga", 150, HorizontalAlignment.Left)
End Sub
Sub normal()
Button1.Text = "Cari"
Button1.Enabled = True
Button2.Text = "Simpan"
Button2.Enabled = True
Button3.Text = "Hapus"
Button3.Enabled = True
Button4.Text = "Keluar"
Button5.Enabled = True
Button4.Text = "Cetak"
End Sub
End Class
0 komentar:
Posting Komentar