public override int GetHashCode() { unchecked { var hashCode = (Curriculum != null ? Curriculum.GetHashCode() : 0); hashCode = (hashCode * 397) ^ DateTime.GetHashCode(); hashCode = (hashCode * 397) ^ Timeslot; return(hashCode); } }
//get from database - DataGridView public static Curriculum FromDatabase(DataGridView datagridView, int i = -1) { if (i == -1) { if (datagridView.CurrentRow != null) { i = datagridView.CurrentRow.Index; } } if (i == -1) { return(null); } //new curriculum with code string curriculumCode = datagridView[0, i].CellValue(); Curriculum curriculum = FromDatabase(curriculumCode); return(curriculum); }
// compare based on name (for hashset and lists) protected bool Equals(Curriculum other) { return(string.Equals(CurriculumCode, other.CurriculumCode)); }