123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- using Avalonia.Controls.Shapes;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace N11_1.Models
- {
- public partial class TbTeacher
- {
- public string FullName
- {
- get
- {
- return LastName + " " + FirstName + " " + Patronymic;
- }
- }
- public string DB
- {
- get
- {
- return DateOf.ToString("Дата рождения: d MMMM yyyy года");
- }
- }
- public string Gender
- {
- get
- {
- switch (IdGenderNavigation.Name)
- {
- case "м":
- {
- return "Пол: мужской";
- }
- case "ж":
- {
- return "Пол: женский";
- }
- }
- return "пол не определен";
- }
- }
- public string Working
- {
- get
- {
- string line = "";
- int year = (int)WorkExperience / 12;
- double month = (double)WorkExperience - year * 12;
- if (year > 0)
- {
- if (year != 11 && year != 12 && year != 13 && year != 14)
- {
- switch (year % 10)
- {
- case 1:
- {
- line += year + " год ";
- break;
- }
- case 2:
- case 3:
- case 4:
- {
- line += year + " года ";
- break;
- }
- default:
- {
- line += year + " лет ";
- break;
- }
- }
- }
- else
- {
- line += year + " лет ";
- }
- }
- if (month > 0)
- {
- switch ((int)month % 12)
- {
- case 1:
- {
- line += Math.Round(month, 1) + " месяц ";
- break;
- }
- case 2:
- case 3:
- case 4:
- {
- line += Math.Round(month, 1) + " месяца ";
- break;
- }
- default:
- {
- line += Math.Round(month, 1) + " месяцев ";
- break;
- }
- }
- }
- line += (line == "") ? "нет опыта работы" : "";
- line = "Стаж работы: " + line;
- return line;
- }
- }
- public string PhoneNumber
- {
- get
- {
- if (Phone == null || Phone == "NULL")
- {
- return "\t Номер телефона не указан";
- }
- else
- {
- return "\t Телефон: " + Phone;
- }
- }
- }
- public string CourseHeader
- {
- get
- {
- string line = "Курсы в общем объеме ";
- int hours = 0;
- foreach (var item in TbTeachersCourses)
- {
- hours += item.Hours;
- }
- if (hours != 11 && hours != 12 && hours != 13 && hours != 14)
- {
- switch (hours % 10)
- {
- case 1:
- {
- line += hours + " час ";
- break;
- }
- case 2:
- case 3:
- case 4:
- {
- line += hours + " часа ";
- break;
- }
- default:
- {
- line += hours + " часов ";
- break;
- }
- }
- }
- else
- {
- line += hours + " часов ";
- }
- return line;
- }
- }
- public string Course
- {
- get
- {
- string line = "";
- foreach (var item in TbTeachersCourses)
- {
- line += "- " + item.IdCoursesNavigation.Name + "\n";
- }
- line += (line == "") ? "Пройденных курсов нет" : "";
- return line;
- }
- }
- public string Lesson
- {
- get
- {
- string line = "";
- foreach (var item in TbTeachersLessons)
- {
- line += "- " + item.IdLessonNavigation.Name + "\n";
- }
- line += (line == "") ? "Преподаваемых уроков нет" : "";
- return line;
- }
- }
- }
- }
|