123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace AvaloniaApplication1.Models
- {
- public partial class Course
- {
- public string CountTeachers
- {
- get
- {
- int count = 0;
- foreach (var item in TeachersCourses)
- {
- count++;
- }
- if (count == 0)
- {
- return $"Никто не записался на этот курс";
- }
- else
- {
- return $"{count} чел.";
- }
- }
- }
- public int? HoursCount
- {
- get
- {
- int? count = 0;
- foreach (var item in TeachersCourses)
- {
- if(count == 0)
- {
- count += item.Hours;
- }
- }
- return count;
- }
- }
- }
- }
|