stazh.cs 773 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using DynamicData;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace AvaloniaApplication5.Models
  8. {
  9. public partial class Teacher
  10. {
  11. public string stazh
  12. {
  13. get
  14. {
  15. int yearr = 0;
  16. int monthr = 0;
  17. yearr = Convert.ToInt32(Experience) / 12;
  18. monthr = Convert.ToInt32(Experience) % 12;
  19. if (monthr > 0)
  20. {
  21. return yearr + " года(лет) " + monthr + " месяцев(а)";
  22. }
  23. else
  24. {
  25. return yearr + " года(лет) ";
  26. }
  27. }
  28. }
  29. }
  30. }