исправила и добавила вывод названия симптома и процедуры во вью модель

This commit is contained in:
Елена Бакальская 2024-05-27 21:53:53 +04:00
parent fa8d5d9d8e
commit 171ca6d819
5 changed files with 40 additions and 31 deletions

View File

@ -8,9 +8,19 @@ namespace PolyclinicContracts.ViewModels
public int Id { get; set; } public int Id { get; set; }
public int ProcedureId { get; set; } public int ProcedureId { get; set; }
public int? SymptomId { get; set; } public int? SymptomId { get; set; }
[DisplayName("Название медикамента")] [DisplayName("Название медикамента")]
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
[DisplayName("Комментарий")] [DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty; public string Comment { get; set; } = string.Empty;
[DisplayName("Название симптома")]
public string SymptomName { get; set; } = string.Empty;
[DisplayName("Название процедуры")]
public string ProcedureName { get; set; } = string.Empty;
} }
} }

View File

@ -12,6 +12,8 @@ namespace PolyclinicContracts.ViewModels
[DisplayName("Комментарий")] [DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty; public string Comment { get; set; } = string.Empty;
[DisplayName("Номер курса")]
public int? CourseId { get; set; } public int? CourseId { get; set; }
public Dictionary<int, IProcedureModel> RecipeProcedures { get; } = new(); public Dictionary<int, IProcedureModel> RecipeProcedures { get; } = new();
} }

View File

@ -48,7 +48,9 @@ namespace PolyclinicDatabaseImplement.Models
Name = Name, Name = Name,
Comment = Comment, Comment = Comment,
ProcedureId = ProcedureId, ProcedureId = ProcedureId,
SymptomId = Symptom?.Id ?? null SymptomId = Symptom?.Id ?? null,
SymptomName = Symptom?.Name ?? string.Empty,
ProcedureName = Procedure?.Name ?? string.Empty,
}; };
} }
} }

View File

@ -45,15 +45,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<td> @foreach (var item in Model)
1 {
</td> <td>@item.Id</td>
<td> <td>@item.Name</td>
Фенибут <td>@item.SymptomId.</td>
</td>
<td>
Сопли до колен
</td>
<td> <td>
3 3
</td> </td>
@ -74,6 +70,7 @@
<path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8" stroke-linecap="round" /> <path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8" stroke-linecap="round" />
</svg> </svg>
</td> </td>
}
</tbody> </tbody>
</table> </table>
} }

View File

@ -32,8 +32,6 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach (var item in Model) @foreach (var item in Model)
{ {
<tr> <tr>