Всё сломалось, ничего не понятно. Создаются преподаватели при создании ведмости

This commit is contained in:
GokaPek 2024-05-27 20:10:56 +04:00
parent 75ead823e8
commit 8dbce23517
3 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@
@Html.DisplayFor(modelItem => item.Date) @Html.DisplayFor(modelItem => item.Date)
</td> </td>
<td> <td>
@Html.DisplayFor(modelItem => item.TeacherId) @Html.DisplayFor(modelItem => item.TeacherName)
</td> </td>
</tr> </tr>
} }

View File

@ -13,6 +13,7 @@ namespace UniversityContracts.ViewModels
public int Id { get; set; } public int Id { get; set; }
public int UserId { get; set; } public int UserId { get; set; }
public int TeacherId { get; set; } public int TeacherId { get; set; }
public string TeacherName { get; set; } = string.Empty;
[DisplayName("Название ведомости")] [DisplayName("Название ведомости")]
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
[DisplayName("Дата оформления ведомости")] [DisplayName("Дата оформления ведомости")]

View File

@ -21,7 +21,7 @@ namespace UniversityRestApi.Controllers
} }
[HttpGet] [HttpGet]
public List<StatementViewModel>? GetStatements(int teacherId) public List<StatementViewModel>? GetStatements(int teacherId, int userId)
{ {
try try
{ {
@ -29,7 +29,7 @@ namespace UniversityRestApi.Controllers
{ {
return _logic.ReadList(null); return _logic.ReadList(null);
} }
return _logic.ReadList(new StatementSearchModel { TeacherId = teacherId }); return _logic.ReadList(new StatementSearchModel { TeacherId = teacherId, UserId = userId });
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -38,7 +38,6 @@ namespace UniversityRestApi.Controllers
} }
} }
[HttpPost] [HttpPost]
public void CreateStatement(StatementBindingModel model) public void CreateStatement(StatementBindingModel model)
{ {