//check if there is any clash in terms of time and venue public bool ifClash(Event eventObj) { string str1 = eventName; string str2 = eventObj.getEventName(); str1 = str1.ToLower(); str2 = str2.ToLower(); if (str1 == str2) return true; else if (startDate == eventObj.getStartDate() && endDate == eventObj.getEndDate()) { if (startTime <= eventObj.getEndTime() || endTime >= eventObj.getStartTime()) { //store two venues in two strings then transform them into lower cases string str3 = venue; string str4 = eventObj.getVenue(); str3 = str3.ToLower(); str4 = str4.ToLower(); if (String.Compare(str3, str4) == 0) return true; else return false; } else return false; } else return false; }
public bool compareEvents(Event a, Event b) { if (a.getEventName() != b.getEventName()) return false; if (a.getStartDate() != b.getStartDate()) return false; if (a.getEndDate() != b.getEndDate()) return false; if (a.getStartTime() != b.getStartTime()) return false; if (a.getEndTime() != b.getEndTime()) return false; if (a.getVenue() != b.getVenue()) return false; if (a.getDescription() != b.getDescription()) return false; else return true; }