public static bool TryRemove(RelationProjectEmployee toRemove) { if (GetEmployeesOnProject(toRemove.NameOfProject).Count == 1) { return(false); } AllRelations.Remove(toRemove); return(true); }
public static bool TryAdd(string nameOfProject, string oib, int hoursOfWork) { foreach (var relation in AllRelations) { if (relation.NameOfProject == nameOfProject && relation.Oib == oib) { return(false); } } var newRelation = new RelationProjectEmployee(nameOfProject, oib, hoursOfWork); AllRelations.Add(newRelation); return(true); }
public static void Remove(RelationProjectEmployee toRemove) { AllRelations.Remove(toRemove); }