PartialTeacher.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using Avalonia.Controls;
  2. using DynamicData;
  3. using Microsoft.CodeAnalysis;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace AvaloniaTeachersDB.Models
  10. {
  11. public partial class Teacher
  12. {
  13. public string FIO => NameTeacher + " " + PatronymicTeacher + " " + SurnameTeacher;
  14. public string strGender
  15. {
  16. get
  17. {
  18. if (IdGenderNavigation.NameGender == "ж")
  19. return "Пол: Женский";
  20. else
  21. return "Пол: Мужской";
  22. }
  23. }
  24. public string strBirthday => "Дата рождения: " + BirthdayTeacher;
  25. public string strExperience
  26. {
  27. get
  28. {
  29. int y = (int)(ExperienceTeacher / 12);
  30. int m = (int)(ExperienceTeacher % 12);
  31. return $"Стаж работы: {y} год {m} мес";
  32. }
  33. }
  34. public string strEmail => "Почта: " + Mail;
  35. public string strPhone => "Телефон: " + Phone;
  36. public string Allhourse
  37. {
  38. get
  39. {
  40. int count = 0;
  41. foreach (var item in TeacherCourses)
  42. {
  43. count += Convert.ToInt32(item.TimeHours);
  44. }
  45. if(count == 0)
  46. return $"Курсов нет";
  47. return $"Курсы в общем объеме {count}ч:";
  48. }
  49. }
  50. public List<string> CollectionCourse
  51. {
  52. get
  53. {
  54. List<string> list = new List<string>();
  55. foreach (var item in TeacherCourses)
  56. {
  57. list.Add(item.IdCourseNavigation.NameCourses);
  58. }
  59. return list;
  60. }
  61. }
  62. public List<string> CollectionSubject
  63. {
  64. get
  65. {
  66. List<string> list = new List<string>();
  67. foreach (var item in TeachersSubjects)
  68. {
  69. list.Add("- " + item.IdSubjectsNavigation.NameSubjects);
  70. }
  71. return list;
  72. }
  73. }
  74. }
  75. }