Public Class Frm
Private Sub btn10001_Click(sender As System.Object, e As System.EventArgs) Handles btn10001.Click
DataGridView1.Rows(0).Cells(0).Value = "10001." '--- รหัสสินค้า
DataGridView1.Rows(0).Cells(1).Value = "กุดั่นเข็ม" '--- รายการ
DataGridView1.Rows(0).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(0).Cells(3).Value = 400 '--- ราคา
DataGridView1.Rows(0).Cells(4).Value = (DataGridView1.Rows(0).Cells(2).Value) * (DataGridView1.Rows(0).Cells(3).Value)
End Sub
Private Sub btn10002_Click(sender As System.Object, e As System.EventArgs) Handles btn10002.Click
DataGridView1.Rows(1).Cells(0).Value = "10002." '--- รหัสสินค้า
DataGridView1.Rows(1).Cells(1).Value = "เข็มกุดั่น 2 ต้น" '--- รายการ
DataGridView1.Rows(1).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(1).Cells(3).Value = 1500 '--- ราคา
DataGridView1.Rows(1).Cells(4).Value = (DataGridView1.Rows(1).Cells(2).Value) * (DataGridView1.Rows(1).Cells(3).Value)
End Sub
Private Sub Frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i As Int16 = 0 To 330
DataGridView1.Rows.Add()
Next
End Sub
Private Sub btn10003_Click(sender As System.Object, e As System.EventArgs) Handles btn10003.Click
DataGridView1.Rows(2).Cells(0).Value = "10003." '--- รหัสสินค้า
DataGridView1.Rows(2).Cells(1).Value = "เข็มชมพูแคระ 4"" '--- รายการ"
DataGridView1.Rows(2).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(2).Cells(3).Value = 50 '--- ราคา
DataGridView1.Rows(2).Cells(4).Value = (DataGridView1.Rows(2).Cells(2).Value) * (DataGridView1.Rows(2).Cells(3).Value)
End Sub
Private Sub btn10004_Click(sender As System.Object, e As System.EventArgs) Handles btn10004.Click
DataGridView1.Rows(3).Cells(0).Value = "10004." '--- รหัสสินค้า
DataGridView1.Rows(3).Cells(1).Value = "เข็ม 3 สี" '--- รายการ"
DataGridView1.Rows(3).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(3).Cells(3).Value = 25 '--- ราคา
DataGridView1.Rows(3).Cells(4).Value = (DataGridView1.Rows(3).Cells(2).Value) * (DataGridView1.Rows(3).Cells(3).Value)
End Sub
Private Sub btn10005_Click(sender As System.Object, e As System.EventArgs) Handles btn10005.Click
DataGridView1.Rows(4).Cells(0).Value = "10005." '--- รหัสสินค้า
DataGridView1.Rows(4).Cells(1).Value = "เข็มโบว์" '--- รายการ"
DataGridView1.Rows(4).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(4).Cells(3).Value = 7 '--- ราคา
DataGridView1.Rows(4).Cells(4).Value = (DataGridView1.Rows(4).Cells(2).Value) * (DataGridView1.Rows(4).Cells(3).Value)
End Sub
Private Sub btn10006_Click(sender As System.Object, e As System.EventArgs) Handles btn10006.Click
DataGridView1.Rows(5).Cells(0).Value = "10006." '--- รหัสสินค้า
DataGridView1.Rows(5).Cells(1).Value = "เข็มฮ่องกง 4"" '--- รายการ"
DataGridView1.Rows(5).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(5).Cells(3).Value = 40 '--- ราคา
DataGridView1.Rows(5).Cells(4).Value = (DataGridView1.Rows(5).Cells(2).Value) * (DataGridView1.Rows(5).Cells(3).Value)
End Sub
Private Sub btn10007_Click(sender As System.Object, e As System.EventArgs) Handles btn10007.Click
DataGridView1.Rows(6).Cells(0).Value = "10007." '--- รหัสสินค้า
DataGridView1.Rows(6).Cells(1).Value = "เข็มศรีลังกา 8"" '--- รายการ"
DataGridView1.Rows(6).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(6).Cells(3).Value = 120 '--- ราคา
DataGridView1.Rows(6).Cells(4).Value = (DataGridView1.Rows(6).Cells(2).Value) * (DataGridView1.Rows(6).Cells(3).Value)
End Sub
Private Sub btn10008_Click(sender As System.Object, e As System.EventArgs) Handles btn10008.Click
DataGridView1.Rows(7).Cells(0).Value = "10008." '--- รหัสสินค้า
DataGridView1.Rows(7).Cells(1).Value = "เข็ม 3 สี กระถาง 1.80 ม." '--- รายการ"
DataGridView1.Rows(7).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(7).Cells(3).Value = 550 '--- ราคา
DataGridView1.Rows(7).Cells(4).Value = (DataGridView1.Rows(7).Cells(2).Value) * (DataGridView1.Rows(7).Cells(3).Value)
End Sub
Private Sub btn10009_Click(sender As System.Object, e As System.EventArgs) Handles btn10009.Click
DataGridView1.Rows(8).Cells(0).Value = "10009." '--- รหัสสินค้า
DataGridView1.Rows(8).Cells(1).Value = "เข็มรั้วแดง 70 ซม." '--- รายการ"
DataGridView1.Rows(8).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(8).Cells(3).Value = 250 '--- ราคา
DataGridView1.Rows(8).Cells(4).Value = (DataGridView1.Rows(8).Cells(2).Value) * (DataGridView1.Rows(8).Cells(3).Value)
End Sub
Private Sub btn10010_Click(sender As System.Object, e As System.EventArgs) Handles btn10010.Click
DataGridView1.Rows(9).Cells(0).Value = "10010." '--- รหัสสินค้า
DataGridView1.Rows(9).Cells(1).Value = "จั๋ง ลำละ '--- รายการ"
DataGridView1.Rows(9).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(9).Cells(3).Value = 70 '--- ราคา
DataGridView1.Rows(9).Cells(4).Value = (DataGridView1.Rows(9).Cells(2).Value) * (DataGridView1.Rows(9).Cells(3).Value)
End Sub
Private Sub btn10011_Click(sender As System.Object, e As System.EventArgs) Handles btn10011.Click
DataGridView1.Rows(10).Cells(0).Value = "10011." '--- รหัสสินค้า
DataGridView1.Rows(10).Cells(1).Value = "จั๋งด่าง ลำละ '--- รายการ"
DataGridView1.Rows(10).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(10).Cells(3).Value = 300 '--- ราคา
DataGridView1.Rows(10).Cells(4).Value = (DataGridView1.Rows(10).Cells(2).Value) * (DataGridView1.Rows(10).Cells(3).Value)
End Sub
Private Sub btn10012_Click(sender As System.Object, e As System.EventArgs) Handles btn10012.Click
DataGridView1.Rows(11).Cells(0).Value = "10012." '--- รหัสสินค้า
DataGridView1.Rows(11).Cells(1).Value = "จั๋งแคระ -60 ซม. '--- รายการ"
DataGridView1.Rows(11).Cells(2).Value += 1 '--- จำนวน
DataGridView1.Rows(11).Cells(3).Value = 200 '--- ราคา
DataGridView1.Rows(11).Cells(4).Value = (DataGridView1.Rows(11).Cells(2).Value) * (DataGridView1.Rows(11).Cells(3).Value)
End Sub
Private Sub btn10013_Click(sender As System.Object, e As System.EventArgs) Handles btn10013.Click
DataGridView1.Rows(12).Cells(0).Value = "10013." '--- รหัสสินค้า
Private Sub Btncal_Click(sender As System.Object, e As System.EventArgs) Handles Btncal.Click
txtAmt.Text = 0 '--- clear ค่าใน label QTY ก่อน
txtTotalMoney.Text = 0.0 '--- clear ค่าใน label Total Money ก่อน
For i As Int16 = 0 To 330
txtAmt.Text += DataGridView1.Rows(i).Cells(2).Value
txtTotalMoney.Text += DataGridView1.Rows(i).Cells(4).Value
Next
txtNET.Text = txtTotalMoney.Text
'--- จัดรูปแบบ ยอดสุทธิ -----------------------------------------------------
Dim X As Double
X = txtNET.Text
txtNET.Text = Format(X, "#,#.00฿")
End Sub