private NetworkDiagramItem setLastNetworkDiagramItem(List <NetworkDiagramItem> listItem) { int maxCS = PERTTaskResult.Max(x => x.CS); PERTTask tmpPertTask = PERTTaskResult.Where(x => x.CS == maxCS).FirstOrDefault(); NetworkDiagramItem lastItem = new NetworkDiagramItem { DisplayedText = "End", Content = "End" }; lastItem.Effort = TimeSpan.Zero; lastItem.EarlyStart = StartProject.AddDays(maxCS); lastItem.EarlyFinish = StartProject.AddDays(maxCS); lastItem.LateStart = StartProject.AddDays(maxCS); lastItem.LateFinish = StartProject.AddDays(maxCS); lastItem.Slack = TimeSpan.Zero; listItem.Add(lastItem); return(lastItem); }
private void setNetworkDiagramItems(List <NetworkDiagramItem> listItem) { for (int i = 0; i < PERTTaskResult.Count(); i++) { NetworkDiagramItem item = new NetworkDiagramItem { DisplayedText = PERTTaskResult[i].Name, Content = PERTTaskResult[i].Name }; item.Effort = TimeSpan.Parse(PERTTaskResult[i].Expected_t + ":00:00:00"); item.EarlyStart = StartProject.AddDays(PERTTaskResult[i].ES); item.EarlyFinish = StartProject.AddDays(PERTTaskResult[i].EF); item.LateStart = StartProject.AddDays(PERTTaskResult[i].LS); item.LateFinish = StartProject.AddDays(PERTTaskResult[i].LF); item.Slack = item.LateStart - item.EarlyStart; listItem.Add(item); } }