ticket and respond

This commit is contained in:
2024-08-03 17:35:24 +03:30
parent 780bfc94c8
commit be864f564b
11 changed files with 246 additions and 105 deletions

View File

@ -1,7 +1,12 @@
@model IEnumerable<WebApplication1.Models.ticket>
@using WebApplication1.Models
@model IEnumerable<ticketlist>
@{
ViewBag.Title = "Index";
string status = "";
}
<h2>Index</h2>
@ -12,28 +17,38 @@
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.title)
Title
</th>
<th>
@Html.DisplayNameFor(model => model.content)
Sender username
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.title)
</td>
<td>
@Html.DisplayFor(modelItem => item.content)
</td>
<td>
@Html.ActionLink("Respond", "Respond", new { id=item.ID }) |
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
</td>
</tr>
}
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.ticketTitle)
</td>
<td>
@Html.DisplayFor(modelItem => item.username)
</td>
<td>
@if (item.status == 1)
{
status = "awaiting response";
}
else if (item.status == 3)
{
status = "open";
}
@status
</td>
<td>
@Html.ActionLink("Respond", "Respond", new { id = item.ticketID })
</td>
</tr>
}
</table>