If DrawGannt Dim dt As Date = e.Col.Name.Replace("年","-").Replace("月_","-") If e.Row.Index Mod 2 = 0 Then Dim r As Row = Tables("项目资料_Table1").Rows(e.Row.Index/2) Dim dt1 As Date = r("计划_开始日期") Dim dt2 As Date = r("计划_结束日期") 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 Else Dim s As Row = Tables("项目资料_Table1").Rows((e.Row.Index-1)/2) Dim sdt1 As Date = s("实际_开始日期") Dim sdt2 As Date = s("实际_结束日期") If dt>=sdt1 AndAlso dt<=sdt2 Then e.StartDraw() e.Graphics.FillRectangle(Brushes.Purple,e.x ,e.y + 5, e.Width, e.Height - 10) e.EndDraw() End If Dim r As Row = Tables("项目资料_Table1").Rows(e.Row.Index\2) Dim fdr As DataRow = DataTables("工作记录总表").find("计划日期=#" & dt & "# and 节点代号='" & r("节点代号") & "' and 项目代号='" & r("项目代号") & "'") If fdr IsNot Nothing Then e.text = fdr("总用时") End If End If End If
|