Guys, I need again your help. I have to generate automatically a unique schedule for each subjects with only one click of a button. I'm having trouble with it. Please suggest....here's my codes:
Do Until conflict = False
For y As Integer = 0 To DataGridClass.RowCount - 1
If txtbxClassID.Text <> DataGridClass.Rows(y).Cells(ClassID).Value And txtbxSection.Text = DataGridClass.Rows(y).Cells(SectionEnrolled).Value And txtbxDay.Text = DataGridClass.Rows(y).Cells(Day).Value And (timestart >= DataGridClass.Rows(y).Cells(TimeStart).Value And timestart <= DataGridClass.Rows(y).Cells(TimeEnd).Value) Then
conflict = True
Exit For
End If
conflict = False
y = y + 1
Next
If conflict = True Then
txtbxDay.Text = day(GetRandom(0, 5))
timestart = timestart1(GetRandom(0, 15))
timeend = timestart + 2
txtbxTimeStart.Text = timestart
txtbxTimeEnd.Text = timeend
End If
Loop
Please help. I need your suggestions ASAP. Thanks so much.