//------------------------------------------------------------------------------------------------------------------------------------------------------------- /// <summary> /// Compare project organisations based on ONLY the organisation acronym /// Note that we cannot use the ID to determine if the organisations are equivalent /// as they are common between the separate lists of Donors, PMs and IP/OPs /// Therefore the ID in the ProjectOrganisations are irrelevant (for now)! /// </summary> public bool Equals(ProjectOrganisation po) { bool isEqual = false; //if (this.ID > 0 && this.ID == po.ID) { // isEqual = true; //} else if (string.IsNullOrEmpty(this.acronym) == false && string.IsNullOrEmpty(po.acronym) == false && this.acronym.Equals(po.acronym) == true) { isEqual = true; } return(isEqual); }
//------------------------------------------------------------------------------------------------------------------------------------------------------------- /// <summary> /// Compare project organisations based on the ID and / or the organisation accronym /// </summary> public static ProjectOrganisation Find(List <ProjectOrganisation> poList, int id, string acronym) { // Here is the object to return ProjectOrganisation po = new ProjectOrganisation(); // The search tokens ProjectOrganisation searchPO = new ProjectOrganisation(id, acronym, null, null); if (poList != null) { foreach (ProjectOrganisation tempPO in poList) { if (tempPO.Equals(searchPO) == true) { po = tempPO; break; } } } return(po); }