private string GetPhotoFile() { var files = Directory.GetFiles("DB\\PlayersPhoto"); string str = "DB\\PlayersPhoto\\" + Surname.ToLower(); bool findPhoto = files.Contains(str + ".jpg"); if (!findPhoto) { str += " " + Name.ToLower(); findPhoto = files.Contains(str + ".jpg"); if (!findPhoto) { if (Patronymic == null) { str = "DB\\PlayersPhoto\\no_photo.jpg"; return(str); } str += " " + Patronymic.ToLower(); findPhoto = files.Contains(str + ".jpg"); if (!findPhoto) { str = "DB\\PlayersPhoto\\no_photo.jpg"; return(str); } } } str += ".jpg"; return(str); }
/// <summary> /// Сравнивает объекты /// </summary> /// <param name="other"></param> /// <returns></returns> protected bool Equals(Person other) { return(Id == other.Id && string.Equals(SurName.ToLower(), other.SurName.ToLower()) && string.Equals(Name.ToLower(), other.Name.ToLower()) && string.Equals(Patronymic.ToLower(), other.Patronymic.ToLower()) && string.Equals(Organization, other.Organization) && string.Equals(Position, other.Position) && string.Equals(Email, other.Email) && string.Equals(NumberPhone, other.NumberPhone)); }
public override bool Equals(object obj) { Student another = (Student)obj; return(LastName.ToLower().Equals(another.LastName.ToLower()) && FirstName.ToLower().Equals(another.FirstName.ToLower()) && Patronymic.ToLower().Equals(another.Patronymic.ToLower()) && BirthDate.Equals(another.BirthDate) && EnterDate.Equals(another.EnterDate) && Char.ToLower(GroupIndex).Equals(Char.ToLower(another.GroupIndex)) && Faculty.ToLower().Equals(another.Faculty.ToLower()) && Specialization.ToLower().Equals(another.Specialization.ToLower()) && Performance == another.Performance); }
public override bool Equals(object obj) { Student another = (Student)obj; return(Surname.ToLower().Equals(another.Surname.ToLower()) && Name.ToLower().Equals(another.Name.ToLower()) && Patronymic.ToLower().Equals(another.Patronymic.ToLower()) && DateOfBirth.Equals(another.DateOfBirth) && EnterDate.Equals(another.EnterDate) && GroupIndex.ToLower().Equals(another.GroupIndex.ToLower()) && Faculty.ToLower().Equals(another.Faculty.ToLower()) && Specialty.ToLower().Equals(another.Specialty.ToLower()) && AcademicPerformance == another.AcademicPerformance); }