2024-04-19 19:30:16 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using UniversityDataModels.Models;
|
|
|
|
|
|
|
|
|
|
namespace UniversityContracts.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class TeacherViewModel : ITeacherModel
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
2024-04-29 15:37:19 +04:00
|
|
|
|
public int UserId { get; set; }
|
2024-04-19 19:30:16 +04:00
|
|
|
|
[DisplayName("ФИО")]
|
|
|
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
|
[DisplayName("Учёная степень")]
|
|
|
|
|
public string AcademicDegree { get; set; } = string.Empty;
|
|
|
|
|
[DisplayName("Должность")]
|
|
|
|
|
public string Position { get; set; } = string.Empty;
|
2024-05-01 15:22:03 +04:00
|
|
|
|
|
|
|
|
|
public List<StudentViewModel> StudentViewModels { get; set; } = new();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Для отчета по моделям
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
var result = new StringBuilder(
|
|
|
|
|
$"Преподаватель {Name} включает в себя группу студентов:");
|
|
|
|
|
for (int i = 0; i < StudentViewModels.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
var student = StudentViewModels[i];
|
|
|
|
|
result.Append($"\n\t{i + 1}. {student.Name}" +
|
|
|
|
|
$"{student.PhoneNumber}");
|
|
|
|
|
}
|
|
|
|
|
return result.ToString();
|
|
|
|
|
}
|
2024-04-19 19:30:16 +04:00
|
|
|
|
}
|
|
|
|
|
}
|