要用就少在那機掰
Would you like to react to this message? Create an account in a few clicks or log in to continue.

★國際電話費用 2010 10 4

向下

★國際電話費用 2010 10 4 Empty ★國際電話費用 2010 10 4

發表  stty0910 周一 10月 04, 2010 10:51 am

Public Class Form1
Public flags As Byte = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Pay, Paysum As Single
Dim UseTime As Integer
Dim BaseRate As Single
Dim DiscountStr As String
Pay = 0
If RadioButton8.Checked = True Then
BaseRate = 1.3
Else
BaseRate = 1.24
End If
If IsNumeric(TextBox1.Text) And flags > 0 Then
UseTime = Val(TextBox1.Text) \ 6
If Val(TextBox1.Text) Mod 6 <> 0 Then
UseTime = UseTime + 1
End If
Select Case flags
Case 1
Pay = UseTime * BaseRate
Case 2
Pay = UseTime * BaseRate * 0.1
Case 3
Pay = UseTime * BaseRate * 0.15
Case 4
Pay = UseTime * BaseRate * 0.18
Case 5
Pay = UseTime * BaseRate * 0.2
Case 6, 7
Pay = UseTime * BaseRate * 0.22
End Select
DiscountStr = ""
Select Case Pay
Case Is < 700
Paysum = Pay
DiscountStr = " 優惠折扣 0% "
Case 700 To 999
Paysum = Pay * 0.95
DiscountStr = " 優惠折扣 95% "
Case 1000 To 4999
Paysum = Pay * 0.9
DiscountStr = " 優惠折扣 90% "
Case 5000 To 9999
Paysum = Pay * 0.85
DiscountStr = " 優惠折扣 85% "
Case Is >= 10000
Paysum = Pay * 0.8
DiscountStr = " 優惠折扣 80% "
End Select
Label2.Text = Paysum.ToString & "元" & DiscountStr
Else
MsgBox("選取資料有錯誤 請檢查 ", MsgBoxStyle.Information, "錯誤訊息")
End If
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
flags = 1
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
flags = 2
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
flags = 3
End Sub

Private Sub RadioButton7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton7.CheckedChanged
flags = 7
End Sub

Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
flags = 4
End Sub

Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged
flags = 5
End Sub

Private Sub RadioButton6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.CheckedChanged
flags = 6
End Sub
End Class

stty0910
終極管理員
終極管理員

文章數 : 68
注冊日期 : 2010-08-06
年齡 : 30
來自 : 地球某個角落

https://bear.666forum.com

回頂端 向下

回頂端


 
這個論壇的權限:
無法 在這個版面回復文章