From 8dbce2351735c14530f0db68bc23cd469eb3025e Mon Sep 17 00:00:00 2001 From: GokaPek Date: Mon, 27 May 2024 20:10:56 +0400 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=81=D1=91=20=D1=81=D0=BB=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BB=D0=BE=D1=81=D1=8C,=20=D0=BD=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=BD=D0=B5=20=D0=BF=D0=BE=D0=BD=D1=8F=D1=82?= =?UTF-8?q?=D0=BD=D0=BE.=20=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D1=8E=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=BF=D1=80=D0=B5=D0=BF=D0=BE=D0=B4=D0=B0=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D0=B8=20=D0=BF=D1=80=D0=B8=20=D1=81?= =?UTF-8?q?=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D0=B8=20=D0=B2=D0=B5=D0=B4?= =?UTF-8?q?=D0=BC=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- University/UniversityClientApp/Views/Home/Statements.cshtml | 2 +- .../UniversityContracts/ViewModels/StatementViewModel.cs | 1 + .../UniversityRestApi/Controllers/StatementController.cs | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/University/UniversityClientApp/Views/Home/Statements.cshtml b/University/UniversityClientApp/Views/Home/Statements.cshtml index 9633069..54ed18b 100644 --- a/University/UniversityClientApp/Views/Home/Statements.cshtml +++ b/University/UniversityClientApp/Views/Home/Statements.cshtml @@ -59,7 +59,7 @@ @Html.DisplayFor(modelItem => item.Date) - @Html.DisplayFor(modelItem => item.TeacherId) + @Html.DisplayFor(modelItem => item.TeacherName) } diff --git a/University/UniversityContracts/ViewModels/StatementViewModel.cs b/University/UniversityContracts/ViewModels/StatementViewModel.cs index 4a2def6..ddfc4a3 100644 --- a/University/UniversityContracts/ViewModels/StatementViewModel.cs +++ b/University/UniversityContracts/ViewModels/StatementViewModel.cs @@ -13,6 +13,7 @@ namespace UniversityContracts.ViewModels public int Id { get; set; } public int UserId { get; set; } public int TeacherId { get; set; } + public string TeacherName { get; set; } = string.Empty; [DisplayName("Название ведомости")] public string Name { get; set; } = string.Empty; [DisplayName("Дата оформления ведомости")] diff --git a/University/UniversityRestApi/Controllers/StatementController.cs b/University/UniversityRestApi/Controllers/StatementController.cs index 1f85990..04e8857 100644 --- a/University/UniversityRestApi/Controllers/StatementController.cs +++ b/University/UniversityRestApi/Controllers/StatementController.cs @@ -21,7 +21,7 @@ namespace UniversityRestApi.Controllers } [HttpGet] - public List? GetStatements(int teacherId) + public List? GetStatements(int teacherId, int userId) { try { @@ -29,7 +29,7 @@ namespace UniversityRestApi.Controllers { return _logic.ReadList(null); } - return _logic.ReadList(new StatementSearchModel { TeacherId = teacherId }); + return _logic.ReadList(new StatementSearchModel { TeacherId = teacherId, UserId = userId }); } catch (Exception ex) { @@ -38,7 +38,6 @@ namespace UniversityRestApi.Controllers } } - [HttpPost] public void CreateStatement(StatementBindingModel model) {