-- 甘特图多时间段问题
If DrawGannt Then
Dim r As Row = Tables("进口业务进度表").Rows(e.Row.Index)
Dim dt1 As Date = r("到港日期")
Dim dt2 As Date = r("换单商检")
Dim dt3 As Date = r("报关日期")
Dim dt4 As Date = r("送货日期")
Dim dt As Date = e.Col.Name.Replace("年","-").Replace("月_","-")
If dt>=dt1 AndAlso dt<=dt2 Then
e.StartDraw()
If dt < Date.Today Then
e.Graphics.FillRectangle(Brushes.Green,e.x ,e.y + 5, e.Width, e.Height - 10)
Else
e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y + 3, e.Width, e.Height - 7)
End If
e.EndDraw()
End If
If dt>=dt2 AndAlso dt<=dt3 Then
e.StartDraw()
If dt < Date.Today Then
e.Graphics.FillRectangle(Brushes.Yellow,e.x ,e.y + 5, e.Width, e.Height - 10)
Else
e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y + 3, e.Width, e.Height - 7)
End If
e.EndDraw()
End If
If dt>=dt3 AndAlso dt<=dt4 Then
e.StartDraw()
If dt < Date.Today Then
e.Graphics.FillRectangle(Brushes.Blue,e.x ,e.y + 5, e.Width, e.Height - 10)
Else
e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y + 3, e.Width, e.Height - 7)
End If
e.EndDraw()
End If
End If