안녕하세요 저는 양식의 확인란 선택을 처리하기 위해 다음 코드를 작성했습니다. 총액은 선거에 기초하여 증분되어 표시되어야합니다. 누군가 이것에 관해서 어떻게에 관해서는 전에 나를 도와주세요. 다음은 선택을 처리하고 총계를 계산하는 방법입니다.vb.net의 확인란 목록에서 소계 계산하기
Private Sub computeCurrentSelection()
If chkugalis.Checked = True Then 'ugali fish selected
orderAmt = lab.Text
total = ugalif * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " plates of" & " Ugali n fish " & " Kshs" & total)
End If
If chkGitheri.Checked = True Then 'ugali dengu slected
orderAmt = lab3.Text
total = ugalid * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " plates of " & "Ugali n dengu " & " Kshs" & total)
End If
If chkUgaliB.Checked = True Then 'githeri selected
orderAmt = lab2.Text
total = githeri * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " plates of " & "Githeri " & " Kshs" & total)
End If
If chkPilau.Checked = True Then
orderAmt = lab4.Text
total = chapo * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " plates of " & "Pilau " & " Kshs" & total)
End If
If chkPizza.Checked = True Then
orderAmt = lab5.Text
total = pilau * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " plates of " & "Pizza " & " Kshs" & total)
End If
If chkMandazi.Checked = True Then
orderAmt = lab6.Text
total = pizza * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & "mandazi " & " Kshs" & total)
End If
If chkSamosa.Checked = True Then
orderAmt = lab7.Text
total = mandazi * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & "Samosa " & " Kshs" & total)
End If
If chkChapon.Checked = True Then
orderAmt = lab8.Text
total = samosa * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & "Chapati " & " Kshs" & total)
End If
If chkWater.Checked = True And chk300ml.Checked = True Then
orderAmt = lab9.Text
total = water1 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 300ml Water " & " Kshs" & total)
End If
If chkWater.Checked = True And chk500ml.Checked = True Then
orderAmt = lab9.Text
total = water2 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 500ml Water " & " Kshs" & total)
ElseIf chkWater.Checked = True And chk1l.Checked = True Then
orderAmt = lab9.Text
total = water3 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 1l Water " & " Kshs" & total)
End If
If chkWater.Checked = True And chk2l.Checked = True Then
orderAmt = lab9.Text
total = water4 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 2l Water " & " Kshs" & total)
End If
If chkSoda.Checked = True And chk300ml.Checked = True Then
orderAmt = lab10.Text
total = soda1 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 300ml Soda " & " Kshs" & total)
End If
If chkSoda.Checked = True And chk500ml.Checked = True Then
orderAmt = lab10.Text
total = soda2 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 500ml Soda " & " Kshs" & total)
End If
If chkSoda.Checked = True And chk1l.Checked = True Then
orderAmt = lab10.Text
total = soda3 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 1l Soda " & " Kshs" & total)
End If
If chkSoda.Checked = True And chk2l.Checked = True Then
orderAmt = lab10.Text
total = soda4 * orderAmt
lstReceipt.Items.Add(orderAmt & " Bottles of 2l Soda " & " Kshs" & total)
End If
If chkJuice.Checked = True And chk300ml.Checked = True Then
orderAmt = lab11.Text
total = juice1 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 300ml juice " & " Kshs" & total)
End If
If chkJuice.Checked = True And chk500ml.Checked = True Then
orderAmt = lab11.Text
total = juice2 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 500ml juice " & " Kshs" & total)
End If
If chkJuice.Checked = True And chk1l.Checked = True Then
orderAmt = lab11.Text
total = juice3 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 1l juice " & " Kshs" & total)
End If
If chkJuice.Checked = True And chk2l.Checked = True Then
orderAmt = lab11.Text
total = juice4 * orderAmt
subtotal = total
lstReceipt.Items.Add(orderAmt & " Bottles of 2l juice " & " Kshs" & total)
End If
End Sub
'즉, = total lstReceipt.Items.Add (orderAmt & "Plague"& "Ugali n fish"& "Kshs"& total) End If'부분 합계는 선택한 모든 확인란의 총 합계 여야합니다. if 하나의 확인란 만 선택하면 부분 합계는 확인란의 합계가되어야하지만 두 개 이상이 선택되면 부분 합계는 선택한 모든 확인란의 합계 합계 –