Teache.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Xml.Linq;
  8. using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
  9. namespace AvaloniaApplication5.Models
  10. {
  11. public partial class Teacher
  12. {
  13. public string summa
  14. {
  15. get
  16. {
  17. int summ = 0;
  18. foreach(var item in TeacherCourses)
  19. {
  20. if (item.TeacherId == Id)
  21. {
  22. int a = Convert.ToInt32(item.Course.Time);
  23. summ += a;
  24. }
  25. }
  26. if (summ > 0)
  27. {
  28. return "Курсы в общем объеме "+ summ +" часов:";
  29. }
  30. else
  31. {
  32. return "Курсы не пройдены";
  33. }
  34. }
  35. }
  36. public string FIO
  37. {
  38. get
  39. {
  40. return LastName + " " + FirstName + " " + PatronymicName;
  41. }
  42. }
  43. }
  44. }