public bool isDublicate(Job job) { for (int i = 0; i < jobs.Count; i++) { if (jobs[i].name == job.name) { return true; } } return false; }
private bool ValidateJob(Job job) { if (checkDuplicate) { if (isDublicate(job)) return false; } return job.ValidateJob(); }
public bool AddJob(Job job) { if (ValidateJob(job)) { jobs.Add(job); return true; } else return false; }