public bool Equals(Horario other) { try { return(Curso.Equals(other.Curso) && Asignatura.Equals(other.Asignatura) && HoraFinal.Equals(other.HoraFinal) && HoraInicio.Equals(other.HoraInicio) && Dia.Equals(other.Dia) && Anyo.Equals(other.Anyo)); } catch (Exception) { return(false); } }
public int CompareTo(Horario other) { var outterDia = other.Dia; var innerHoraInicio = HoraInicio.Hour + HoraInicio.Minute; var outterHoraInicio = other.HoraInicio.Hour + other.HoraInicio.Minute; if (Dia.Equals(outterDia) && innerHoraInicio.Equals(outterHoraInicio)) { return(0); } else if (Dia > outterDia || (Dia.Equals(outterDia) && innerHoraInicio > outterHoraInicio)) { return(1); } else { return(-1); } }
/// <summary> /// Returns true if Profile instances are equal /// </summary> /// <param name="other">Instance of Profile to be compared</param> /// <returns>Boolean</returns> public bool Equals(Profile other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Sens == other.Sens || Sens != null && Sens.Equals(other.Sens) ) && ( Dia == other.Dia || Dia != null && Dia.Equals(other.Dia) ) && ( Carbratio == other.Carbratio || Carbratio != null && Carbratio.Equals(other.Carbratio) ) && ( CarbsHr == other.CarbsHr || CarbsHr != null && CarbsHr.Equals(other.CarbsHr) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) )); }