예제 #1
0
        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);
        }
예제 #2
0
 /// <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));
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }