1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- 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<string> CollectionCourse
- {
- get
- {
- List<string> list = new List<string>();
- foreach (var item in TeacherCourses)
- {
- list.Add(item.IdCourseNavigation.NameCourses);
- }
- return list;
- }
- }
- public List<string> CollectionSubject
- {
- get
- {
- List<string> list = new List<string>();
- foreach (var item in TeachersSubjects)
- {
- list.Add("- " + item.IdSubjectsNavigation.NameSubjects);
- }
- return list;
- }
- }
- }
- }
|