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

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)
</td>
<td>
@Html.DisplayFor(modelItem => item.TeacherId)
@Html.DisplayFor(modelItem => item.TeacherName)
</td>
</tr>
}

View File

@ -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("Дата оформления ведомости")]

View File

@ -21,7 +21,7 @@ namespace UniversityRestApi.Controllers
}
[HttpGet]
public List<StatementViewModel>? GetStatements(int teacherId)
public List<StatementViewModel>? 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)
{