private void AddEstimation(string from, string to, double value, double workedHours) { Node employee = CurrentEvaluation.Nodes.Find(n => n.Employee.Name == from); Node next = CurrentEvaluation.Nodes.Find(n => n.Employee.Name == to); Neighbour neighbour = new Neighbour(employee, next, value, workedHours); employee.AddNeighbour(neighbour); next.AddNeighbour(neighbour); }
public void AddNeighbour(Neighbour n) { if (Neighbours.Exists(ne => ne.ContainsEmployee(n.FromNode, n.ToNode))) { Neighbour current = Neighbours.Find(ne => ne.ContainsEmployee(n.FromNode, n.ToNode)); current.ValueForCompany = n.ValueForCompany; current.WorkedHours = n.WorkedHours; //Console.WriteLine("TO: " + n.ToNode.Employee.Name); } else { Neighbours.Add(n); } }