16-04-17, 02:33 PM
السلام عليكم ورحمة الله وبركاته أعضاء المنتدي
لدي هذا الكود وأريد إختصاره في دالة إن أمكن
لدي هذا الكود وأريد إختصاره في دالة إن أمكن
PHP كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ZC, ZE As Integer
Try
ZC = Integer.Parse(CboZCAT.Text)
ZE = Integer.Parse(CBoze.Text)
If ZC = 1 And ZE = 1 Then
Txtone.Text = (1500 * 35) / 100.ToString
ElseIf ZC = 1 And ZE = 2 Then
Txtone.Text = (1520 * 35) / 100.ToString
ElseIf ZC = 1 And ZE = 3 Then
Txtone.Text = (1540 * 35) / 100.ToString
ElseIf ZC = 2 And ZE = 1 Then
Txtone.Text = (1560 * 35) / 100.ToString
ElseIf ZC = 2 And ZE = 2 Then
Txtone.Text = (1580 * 35) / 100.ToString
ElseIf ZC = 2 And ZE = 3 Then
Txtone.Text = (1600 * 35) / 100.ToString
ElseIf ZC = 3 And ZE = 1 Then
Txtone.Text = (1620 * 35) / 100.ToString
ElseIf ZC = 3 And ZE = 2 Then
Txtone.Text = (1640 * 35) / 100.ToString
ElseIf ZC = 3 And ZE = 3 Then
Txtone.Text = (1660 * 35) / 100.ToString
ElseIf ZC = 4 And ZE = 1 Then
Txtone.Text = (1680 * 35) / 100.ToString
ElseIf ZC = 4 And ZE = 2 Then
Txtone.Text = (1700 * 35) / 100.ToString
ElseIf ZC = 4 And ZE = 3 Then
Txtone.Text = (1745 * 35) / 100.ToString
ElseIf ZC = 5 And ZE = 1 Then
Txtone.Text = (1790 * 35) / 100.ToString
ElseIf ZC = 5 And ZE = 2 Then
Txtone.Text = (1850 * 35) / 100.ToString
ElseIf ZC = 5 And ZE = 3 Then
Txtone.Text = (1910 * 35) / 100.ToString
ElseIf ZC = 6 And ZE = 1 Then
Txtone.Text = (1970 * 35) / 100.ToString
ElseIf ZC = 6 And ZE = 2 Then
Txtone.Text = (2040 * 35) / 100.ToString
ElseIf ZC = 6 And ZE = 3 Then
Txtone.Text = (2100 * 35) / 100.ToString
ElseIf ZC = 7 And ZE = 1 Then
Txtone.Text = (2170 * 35) / 100.ToString
ElseIf ZC = 7 And ZE = 2 Then
Txtone.Text = (2240 * 35) / 100.ToString
ElseIf ZC = 7 And ZE = 3 Then
Txtone.Text = (2300 * 35) / 100.ToString
ElseIf ZC = 8 And ZE = 1 Then
Txtone.Text = (2380 * 35) / 100.ToString
ElseIf ZC = 8 And ZE = 2 Then
Txtone.Text = (2460 * 35) / 100.ToString
ElseIf ZC = 8 And ZE = 3 Then
Txtone.Text = (2530 * 35) / 100.ToString
ElseIf ZC = 9 And ZE = 1 Then
Txtone.Text = (2610 * 35) / 100.ToString
ElseIf ZC = 9 And ZE = 2 Then
Txtone.Text = (2700 * 35) / 100.ToString
ElseIf ZC = 9 And ZE = 3 Then
Txtone.Text = (2780 * 35) / 100.ToString
ElseIf ZC = 10 And ZE = 1 Then
Txtone.Text = (2850 * 35) / 100.ToString
ElseIf ZC = 10 And ZE = 2 Then
Txtone.Text = (2920 * 35) / 100.ToString
ElseIf ZC = 10 And ZE = 3 Then
Txtone.Text = (2990 * 35) / 100.ToString
ElseIf ZC = 10 And ZE = 4 Then
Txtone.Text = (3060 * 35) / 100.ToString
ElseIf ZC = 11 And ZE = 1 Then
Txtone.Text = (3070 * 35) / 100.ToString
ElseIf ZC = 11 And ZE = 2 Then
Txtone.Text = (3130 * 35) / 100.ToString
ElseIf ZC = 11 And ZE = 3 Then
Txtone.Text = (3190 * 35) / 100.ToString
ElseIf ZC = 11 And ZE = 4 Then
Txtone.Text = (3250 * 35) / 100.ToString
ElseIf ZC = 12 And ZE = 1 Then
Txtone.Text = (3320 * 35) / 100.ToString
ElseIf ZC = 12 And ZE = 2 Then
Txtone.Text = (3380 * 35) / 100.ToString
ElseIf ZC = 12 And ZE = 3 Then
Txtone.Text = (3450 * 35) / 100.ToString
ElseIf ZC = 12 And ZE = 4 Then
Txtone.Text = (3530 * 35) / 100.ToString
ElseIf ZC = 13 And ZE = 1 Then
Txtone.Text = (3540 * 35) / 100.ToString
ElseIf ZC = 13 And ZE = 2 Then
Txtone.Text = (3640 * 35) / 100.ToString
ElseIf ZC = 13 And ZE = 3 Then
Txtone.Text = (3730 * 35) / 100.ToString
ElseIf ZC = 13 And ZE = 4 Then
Txtone.Text = (3830 * 35) / 100.ToString
ElseIf ZC = 14 And ZE = 1 Then
Txtone.Text = (3920 * 35) / 100.ToString
ElseIf ZC = 14 And ZE = 2 Then
Txtone.Text = (4000 * 35) / 100.ToString
ElseIf ZC = 14 And ZE = 3 Then
Txtone.Text = (4080 * 35) / 100.ToString
ElseIf ZC = 14 And ZE = 4 Then
Txtone.Text = (4160 * 35) / 100.ToString
ElseIf ZC = 14 And ZE = 5 Then
Txtone.Text = (4240 * 35) / 100.ToString
ElseIf ZC = 15 And ZE = 1 Then
Txtone.Text = (4340 * 35) / 100.ToString
ElseIf ZC = 15 And ZE = 2 Then
Txtone.Text = (4430 * 35) / 100.ToString
ElseIf ZC = 15 And ZE = 3 Then
Txtone.Text = (4520 * 35) / 100.ToString
ElseIf ZC = 15 And ZE = 4 Then
Txtone.Text = (4620 * 35) / 100.ToString
ElseIf ZC = 15 And ZE = 5 Then
Txtone.Text = (4720 * 35) / 100.ToString
ElseIf ZC = 16 And ZE = 1 Then
Txtone.Text = (4820 * 35) / 100.ToString
ElseIf ZC = 16 And ZE = 2 Then
Txtone.Text = (4920 * 35) / 100.ToString
ElseIf ZC = 16 And ZE = 3 Then
Txtone.Text = (5020 * 35) / 100.ToString
ElseIf ZC = 16 And ZE = 4 Then
Txtone.Text = (5120 * 35) / 100.ToString
ElseIf ZC = 16 And ZE = 5 Then
Txtone.Text = (5220 * 35) / 100.ToString
ElseIf ZC = 17 And ZE = 1 Then
Txtone.Text = (5340 * 35) / 100.ToString
ElseIf ZC = 17 And ZE = 2 Then
Txtone.Text = (5450 * 35) / 100.ToString
ElseIf ZC = 17 And ZE = 3 Then
Txtone.Text = (5560 * 35) / 100.ToString
ElseIf ZC = 17 And ZE = 4 Then
Txtone.Text = (5690 * 35) / 100.ToString
ElseIf ZC = 17 And ZE = 5 Then
Txtone.Text = (5810 * 35) / 100.ToString
ElseIf ZC = 18 And ZE = 1 Then
Txtone.Text = (5930 * 35) / 100.ToString
ElseIf ZC = 18 And ZE = 2 Then
Txtone.Text = (6060 * 35) / 100.ToString
ElseIf ZC = 18 And ZE = 3 Then
Txtone.Text = (6190 * 35) / 100.ToString
ElseIf ZC = 18 And ZE = 4 Then
Txtone.Text = (6320 * 35) / 100.ToString
ElseIf ZC = 18 And ZE = 5 Then
Txtone.Text = (6450 * 35) / 100.ToString
ElseIf ZC = 19 And ZE = 1 Then
Txtone.Text = (6580 * 35) / 100.ToString
ElseIf ZC = 19 And ZE = 2 Then
Txtone.Text = (6720 * 35) / 100.ToString
ElseIf ZC = 19 And ZE = 3 Then
Txtone.Text = (6860 * 35) / 100.ToString
ElseIf ZC = 19 And ZE = 4 Then
Txtone.Text = (7000 * 35) / 100.ToString
ElseIf ZC = 19 And ZE = 5 Then
Txtone.Text = (7140 * 35) / 100.ToString
ElseIf ZC = 20 And ZE = 1 Then
Txtone.Text = (7300 * 35) / 100.ToString
ElseIf ZC = 20 And ZE = 2 Then
Txtone.Text = (7460 * 35) / 100.ToString
ElseIf ZC = 20 And ZE = 3 Then
Txtone.Text = (7620 * 35) / 100.ToString
ElseIf ZC = 20 And ZE = 4 Then
Txtone.Text = (7780 * 35) / 100.ToString
ElseIf ZC = 20 And ZE = 5 Then
Txtone.Text = (7940 * 35) / 100.ToString
ElseIf ZC = 0 And ZE = 0 Then
Txtone.Text = 0.ToString
End If
Catch ex As Exception
End Try
End Sub