diff --git a/University/UniversityContracts/BindingModels/ReportBindingModel.cs b/University/UniversityContracts/BindingModels/ReportBindingModel.cs new file mode 100644 index 0000000..1635afb --- /dev/null +++ b/University/UniversityContracts/BindingModels/ReportBindingModel.cs @@ -0,0 +1,15 @@ +namespace UniversityContracts.BindingModels; + +/// +/// Опции для сохранения отчета, при сохранении указать одно из двух +/// +public class ReportBindingModel +{ + public string? FileName { get; set; } + public Stream? Stream { get; set; } + + /// + /// Массив айдишников по которым происходит выборка + /// + public int[]? Ids { get; set; } +} \ No newline at end of file diff --git a/University/UniversityContracts/BindingModels/ReportDateRangeBindingModel.cs b/University/UniversityContracts/BindingModels/ReportDateRangeBindingModel.cs new file mode 100644 index 0000000..a0d7808 --- /dev/null +++ b/University/UniversityContracts/BindingModels/ReportDateRangeBindingModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UniversityContracts.BindingModels +{ + public class ReportDateRangeBindingModel + { + public string? FileName { get; set; } + public Stream? Stream { get; set; } + + public DateOnly DateFrom { get; set; } + public DateOnly DateTo { get; set; } + } +} diff --git a/University/UniversityContracts/BusinessLogicsContracts/IReportLogic.cs b/University/UniversityContracts/BusinessLogicsContracts/IReportLogic.cs new file mode 100644 index 0000000..799ca5a --- /dev/null +++ b/University/UniversityContracts/BusinessLogicsContracts/IReportLogic.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UniversityContracts.BindingModels; + +namespace UniversityContracts.BusinessLogicContracts +{ + public interface IReportLogic + { + void SaveDisciplinesToWord(ReportBindingModel option); + + void SaveDisciplinesToExcel(ReportBindingModel option); + + void SendAccountsToEmail(ReportDateRangeBindingModel option, string email); + void SaveClientsToWord(ReportBindingModel option); + + void SaveClientsToExcel(ReportBindingModel option); + + void SendDisciplinesToEmail(ReportDateRangeBindingModel option, string email); + } +} diff --git a/University/UniversityContracts/ViewModels/TeacherViewModel.cs b/University/UniversityContracts/ViewModels/TeacherViewModel.cs index 5a494cc..a6649f8 100644 --- a/University/UniversityContracts/ViewModels/TeacherViewModel.cs +++ b/University/UniversityContracts/ViewModels/TeacherViewModel.cs @@ -12,12 +12,30 @@ namespace UniversityContracts.ViewModels { public int Id { get; set; } public int UserId { get; set; } - public int StorekeeperId { get; set; } [DisplayName("ФИО")] public string Name { get; set; } = string.Empty; [DisplayName("Учёная степень")] public string AcademicDegree { get; set; } = string.Empty; [DisplayName("Должность")] public string Position { get; set; } = string.Empty; + + public List StudentViewModels { get; set; } = new(); + + /// + /// Для отчета по моделям + /// + /// + 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(); + } } }