19-03-24, 01:33 AM
بارك الله فيك أخي العزيز على قلبي عبد العزيز
وحقيقةً توصلتُ إلى هذا الكود الذي يفي بالغرض
وحقيقةً توصلتُ إلى هذا الكود الذي يفي بالغرض
كود :
For i As Integer = 0 To dgv1.Rows.Count - 1
' المجمـوع الكلي
dgv1.Rows(i).Cells(5).Value = (dgv1.Rows(i).Cells(2).Value + dgv1.Rows(i).Cells(3).Value) + dgv1.Rows(i).Cells(4).Value
' ايجاد المعدل
dgv1.Rows(i).Cells(6).Value = (dgv1.Rows(i).Cells(5).Value / 150) * 100
'استخراج التقدير
Dim a As Double
a = dgv1.Rows(i).Cells(6).Value
If a <= 100 And a >= 95 Then
dgv1.Rows(i).Cells(7).Value = "ممتاز"
ElseIf a < 95 And a >= 85 Then
dgv1.Rows(i).Cells(7).Value = "جيد جداً"
ElseIf a < 85 And a >= 75 Then
dgv1.Rows(i).Cells(7).Value = "جيد"
ElseIf a < 80 And a >= 75 Then
dgv1.Rows(i).Cells(7).Value = "مقبول"
ElseIf a < 75 And a >= 0 Then
dgv1.Rows(i).Cells(7).Value = "/"
Else
End If
' عدد مواد الرسوب
dgv1.Rows(i).Cells(8).Value = If(dgv1.Rows(i).Cells(2).Value >= 50, 0, 1) + If(dgv1.Rows(i).Cells(3).Value >= 50, 0, 1) + If(dgv1.Rows(i).Cells(4).Value >= 50, 0, 1)
If dgv1.Rows(i).Cells(8).Value = 0 Then
dgv1.Rows(i).Cells(9).Value = "ناجح"
ElseIf dgv1.Rows(i).Cells(8).Value < 3 Then
dgv1.Rows(i).Cells(9).Value = "مكمل"
ElseIf dgv1.Rows(i).Cells(8).Value > 2 Then
dgv1.Rows(i).Cells(9).Value = "راسب"
Else
End If
Next
إذا طُعِنتَ من الخلفِ فاعلمْ أنك في المقدمةِ

