Source kode sederana untuk menampilkan data
Public Class Fpesanan
Dim listtxt(9) As String
Dim listitem As ListViewItem
Private Sub Fpesanan_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Call kodemakanan()
Call setlisttview()
End Sub
Private Sub Fpesanan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label10.Text = Format(Now(), "dddd, d MMM yyyy")
End Sub
Sub setlisttview()
ListView1.View = View.Details
ListView1.Columns.Add("No Nota", 60, HorizontalAlignment.Center)
ListView1.Columns.Add("Kode Makanan", 90, HorizontalAlignment.Left)
ListView1.Columns.Add("Kode Pelanggan", 90, HorizontalAlignment.Left)
ListView1.Columns.Add("Kode Petugas", 90, HorizontalAlignment.Left)
ListView1.Columns.Add("Satuan", 50, HorizontalAlignment.Left)
ListView1.Columns.Add("Tgl Nota", 60, HorizontalAlignment.Left)
ListView1.Columns.Add("Qty", 50, HorizontalAlignment.Left)
ListView1.Columns.Add("Harga", 50, HorizontalAlignment.Left)
ListView1.Columns.Add("Jumlah", 50, HorizontalAlignment.Left)
End Sub
Sub simpan()
listtxt(0) = Trim(TextBox1.Text)
listtxt(1) = Trim(ComboBox1.Text)
listtxt(2) = Trim(ComboBox2.Text)
listtxt(3) = Trim(ComboBox3.Text)
listtxt(4) = Trim(ComboBox4.Text)
listtxt(5) = Trim(TextBox2.Text)
listtxt(6) = Trim(TextBox3.Text)
listtxt(7) = Trim(TextBox4.Text)
listtxt(8) = Trim(TextBox5.Text)
listitem = New ListViewItem(listtxt)
ListView1.Items.Add(listitem)
End Sub
Sub bersih()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
ComboBox1.Text = "Select"
ComboBox2.Text = "Select"
ComboBox3.Text = "Select"
ComboBox4.Text = "Select"
TextBox1.Focus()
End Sub
Sub kodemakanan()
'Mengisi Kode Makanan'
ComboBox1.Items.Add("K001")
ComboBox1.Items.Add("K002")
ComboBox1.Items.Add("S001")
ComboBox1.Items.Add("S001")
ComboBox1.Items.Add("G001")
ComboBox1.Items.Add("R001")
'Mengisi Code Pelanggan'
ComboBox2.Items.Add("P001")
ComboBox2.Items.Add("P002")
ComboBox2.Items.Add("P003")
ComboBox2.Items.Add("P004")
ComboBox2.Items.Add("P005")
ComboBox2.Items.Add("P006")
'Mengisi Code Petugas'
ComboBox3.Items.Add("T001")
ComboBox3.Items.Add("T002")
ComboBox3.Items.Add("T003")
ComboBox3.Items.Add("T004")
ComboBox3.Items.Add("T005")
ComboBox3.Items.Add("T006")
'Mengisi Code Petugas'
ComboBox4.Items.Add("KG")
ComboBox4.Items.Add("PCS")
ComboBox4.Items.Add("Dus")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Fmenu.Show()
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call simpan()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Call bersih()
End Sub
End Class
Dim listtxt(9) As String
Dim listitem As ListViewItem
Private Sub Fpesanan_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Call kodemakanan()
Call setlisttview()
End Sub
Private Sub Fpesanan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label10.Text = Format(Now(), "dddd, d MMM yyyy")
End Sub
Sub setlisttview()
ListView1.View = View.Details
ListView1.Columns.Add("No Nota", 60, HorizontalAlignment.Center)
ListView1.Columns.Add("Kode Makanan", 90, HorizontalAlignment.Left)
ListView1.Columns.Add("Kode Pelanggan", 90, HorizontalAlignment.Left)
ListView1.Columns.Add("Kode Petugas", 90, HorizontalAlignment.Left)
ListView1.Columns.Add("Satuan", 50, HorizontalAlignment.Left)
ListView1.Columns.Add("Tgl Nota", 60, HorizontalAlignment.Left)
ListView1.Columns.Add("Qty", 50, HorizontalAlignment.Left)
ListView1.Columns.Add("Harga", 50, HorizontalAlignment.Left)
ListView1.Columns.Add("Jumlah", 50, HorizontalAlignment.Left)
End Sub
Sub simpan()
listtxt(0) = Trim(TextBox1.Text)
listtxt(1) = Trim(ComboBox1.Text)
listtxt(2) = Trim(ComboBox2.Text)
listtxt(3) = Trim(ComboBox3.Text)
listtxt(4) = Trim(ComboBox4.Text)
listtxt(5) = Trim(TextBox2.Text)
listtxt(6) = Trim(TextBox3.Text)
listtxt(7) = Trim(TextBox4.Text)
listtxt(8) = Trim(TextBox5.Text)
listitem = New ListViewItem(listtxt)
ListView1.Items.Add(listitem)
End Sub
Sub bersih()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
ComboBox1.Text = "Select"
ComboBox2.Text = "Select"
ComboBox3.Text = "Select"
ComboBox4.Text = "Select"
TextBox1.Focus()
End Sub
Sub kodemakanan()
'Mengisi Kode Makanan'
ComboBox1.Items.Add("K001")
ComboBox1.Items.Add("K002")
ComboBox1.Items.Add("S001")
ComboBox1.Items.Add("S001")
ComboBox1.Items.Add("G001")
ComboBox1.Items.Add("R001")
'Mengisi Code Pelanggan'
ComboBox2.Items.Add("P001")
ComboBox2.Items.Add("P002")
ComboBox2.Items.Add("P003")
ComboBox2.Items.Add("P004")
ComboBox2.Items.Add("P005")
ComboBox2.Items.Add("P006")
'Mengisi Code Petugas'
ComboBox3.Items.Add("T001")
ComboBox3.Items.Add("T002")
ComboBox3.Items.Add("T003")
ComboBox3.Items.Add("T004")
ComboBox3.Items.Add("T005")
ComboBox3.Items.Add("T006")
'Mengisi Code Petugas'
ComboBox4.Items.Add("KG")
ComboBox4.Items.Add("PCS")
ComboBox4.Items.Add("Dus")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Fmenu.Show()
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call simpan()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Call bersih()
End Sub
End Class
Tidak ada komentar:
Posting Komentar