using Avalonia.Controls; using DynamicData; using Microsoft.CodeAnalysis; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AvaloniaTeachersDB.Models { public partial class Teacher { public string FIO => NameTeacher + " " + PatronymicTeacher + " " + SurnameTeacher; public string strGender { get { if (IdGenderNavigation.NameGender == "ж") return "Пол: Женский"; else return "Пол: Мужской"; } } public string strBirthday => "Дата рождения: " + BirthdayTeacher; public string strExperience { get { int y = (int)(ExperienceTeacher / 12); int m = (int)(ExperienceTeacher % 12); return $"Стаж работы: {y} год {m} мес"; } } public string strEmail => "Почта: " + Mail; public string strPhone => "Телефон: " + Phone; public string Allhourse { get { int count = 0; foreach (var item in TeacherCourses) { count += Convert.ToInt32(item.TimeHours); } if(count == 0) return $"Курсов нет"; return $"Курсы в общем объеме {count}ч:"; } } public List CollectionCourse { get { List list = new List(); foreach (var item in TeacherCourses) { list.Add(item.IdCourseNavigation.NameCourses); } return list; } } public List CollectionSubject { get { List list = new List(); foreach (var item in TeachersSubjects) { list.Add("- " + item.IdSubjectsNavigation.NameSubjects); } return list; } } } }