1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace AvaloniaBaseTeacher.Models
- {
- public partial class Teacher
- {
- public string FIO
- {
- get
- {
- return Surname + " " + Name + " " + Patronymic;
- }
- }
- public string Exp
- {
- get
- {
- long? month = Experience % 12;
- long? year = (Experience - month) / 12;
- if (year == 0)
- {
- return $"{month} {(month == 1 ? "месяц" : (month >= 2 && month <= 4 ? "месяца" : "месяцев"))}";
- }
- else if (month == 0)
- {
- return $"{year} {(year % 10 == 1 && year % 100 != 11 ? "год" : (year % 10 >= 2 && year % 10 <= 4 && (year % 100 < 10 || year % 100 >= 20) ? "года" : "лет"))}";
- }
- else
- {
- return $"{year} {(year % 10 == 1 && year % 100 != 11 ? "год" : (year % 10 >= 2 && year % 10 <= 4 && (year % 100 < 10 || year % 100 >= 20) ? "года" : "лет"))} " +
- $"{month} {(month == 1 ? "месяц" : (month >= 2 && month <= 4 ? "месяца" : "месяцев"))}";
- }
- }
- }
- public string Phonee
- {
- get
- {
- if (Phone == "")
- {
- return "не указан";
- }
- else
- {
- return Phone;
- }
- }
- }
- }
- }
|