using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Prak12 { public partial class Teacher { public string FIO { get => TeacherName + " " + TeacherPatronymic + " " + TeacherSurname; } public string LabeledGender { get { if (IdGenderNavigation.GenderName == "м") { return "Пол: мужской"; } else return "Пол: женский"; } } public string LabeledBirthDate { get => "Дата рождения: " + TeacherBirthdate.ToShortDateString() + " года"; } public string LabeledEmail { get => "Почта: " + TeacherEmail; } public string LabeledPhone { get => "Телефон: " + TeacherPhoneNumber; } public string LabeledWorkTime { get { if (TeacherWorkTime is null) { return "Стаж работы: отсутсвует"; } string Year = ""; if ((int)TeacherWorkTime / 12 == 0) Year = ""; if ((int)TeacherWorkTime / 12 == 1) Year = " " + (int)TeacherWorkTime / 12 + " год"; if ((int)TeacherWorkTime / 12 >= 2 && (int)TeacherWorkTime / 12 <= 4) Year = " " + (int)TeacherWorkTime / 12 + " года"; else Year = " " + (int)TeacherWorkTime / 12 + " лет"; string Month = ""; if ((int)TeacherWorkTime % 12 == 0) Month = " 0 месяцев"; if ((int)TeacherWorkTime % 12 == 1) Month = " " + (int)TeacherWorkTime % 12 + " месяц"; if ((int)TeacherWorkTime % 12 >= 2 && (int)TeacherWorkTime % 12 <= 4) Month = " " + (int)TeacherWorkTime % 12 + " месяца"; else Month = " " + (int)TeacherWorkTime % 12 + " месяцев"; return "Стаж работы:" + Year + Month; } } public int SummaryVolume { get { int summaryVolume = 0; foreach (var item in TeachersCourses) { summaryVolume += item.IdCourseNavigation.CourseHoursNumber; } return summaryVolume; } } public string LabeledSummaryVolume { get => "Курсы в общем объеме " + SummaryVolume + " часов:"; } } }