31-10-17, 08:50 AM
(30-10-17, 11:50 PM)أسامة السالمي كتب :كانت فيه مشكله المشكله دلواتى انه مش شغال صح فيه مشكله انه بيختار اول صف بس وكمان بيكون غلط(29-10-17, 11:22 AM)نبيل فتحى كتب : نبيل فتحى
الكود ده بس الى غلط الى بيشيل السالبPHP كود :
'Me.dgvcust.CurrentRow.Cells(4).Value = Me.dgvcust.CurrentRow.Cells(4).Value.Replace("-", "")
كيف عرفت إنه خطأ (هل في قيمة ما تبدلت أو تبدلت بشكل خاطئ) ؟!
كود :
Dim SS As String = "عام"
dtcustm.Rows.Clear()
Dim CMD As New OleDbCommand("select ID as [رقم العميل],fullname as [اسم العميل],tel as [التليفون],adress as [العنوان],cus_pa as [الرصيد],cus_typ as [الحاله] from tab_cus where fullname <> @PASS", con)
CMD.Parameters.AddWithValue("@date", SS)
con.Open()
dtcustm.Load(CMD.ExecuteReader)
dgvcust.DataSource = dtcustm
'أمر الانتقال الى السطر الأول
For Each r As DataGridViewRow In dgvcust.Rows
If Val(r.Cells(4).Value) = 0 Then
Me.dgvcust.CurrentRow.Cells(5).Value = "خالص"
ElseIf Val(r.Cells(4).Value) < 0 Then
Me.dgvcust.CurrentRow.Cells(5).Value = "دائن"
Me.dgvcust.CurrentRow.Cells(4).Value = Me.dgvcust.CurrentRow.Cells(4).Value.ToString.Replace("-", "")
Else
Me.dgvcust.CurrentRow.Cells(5).Value = "مدين"
End If
Next
con.Close()