26-02-18, 07:50 PM
(آخر تعديل لهذه المشاركة : 26-02-18, 07:56 PM {2} بواسطة طالب برمجة.)
PHP كود :
For i = 0 To Me.DataGridView1.Rows.Count - 1
Dim t As String = DataGridView1.Rows(i).Cells(10).Value
Dim fromDate As String = Regex.Match(t, "(?<=من\s).+?(?=\s)").Value
Dim toDate As String = Regex.Match(t, "(?<=الي\s).+?(?=\s)").Value
If IsDate(fromDate) And IsDate(toDate) Then
Dim d1 As Date = CDate(fromDate)
DataGridView1.Rows(i).Cells(7).Value = DateDiff("d", d1, Today)
Dim d2 As Date = CDate(toDate)
DataGridView1.Rows(i).Cells(8).Value = DateDiff("d", Today, d2)
Else
DataGridView1.Rows(i).Cells(7).Value = 0
DataGridView1.Rows(i).Cells(8).Value = 0
End If
If DataGridView1.Rows(i).Cells(10).Value Is Nothing Then
DataGridView1.Rows(i).Cells(7).Value = 0
DataGridView1.Rows(i).Cells(8).Value = 0
End If
Next

