ticket and respond
This commit is contained in:
@ -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>
|
||||
|
||||
@ -15,6 +15,16 @@
|
||||
{
|
||||
priority = "Normal";
|
||||
}
|
||||
string status = "";
|
||||
if (ViewBag.targetTicket.status == 1)
|
||||
{
|
||||
status = "awaiting response";
|
||||
}
|
||||
else if (ViewBag.targetTicket.status == 3)
|
||||
{
|
||||
status = "open";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
@ -49,11 +59,17 @@
|
||||
<input class="form-control" placeholder=@priority readonly />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
Status
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" placeholder=@status readonly />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
Content
|
||||
<div class="col-md-10">
|
||||
<textarea class="form-control" placeholder=@ViewBag.targetTicket.content></textarea>
|
||||
<textarea class="form-control">@ViewBag.targetTicket.content</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
@ -71,7 +87,7 @@
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.content, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@Html.TextAreaFor(model => model.content, new { @class = "form-control" } )
|
||||
@Html.TextAreaFor(model => model.content, new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(model => model.content, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
@ -80,7 +96,8 @@
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" name="ticketid" value=@ViewBag.targetTicket.ID hidden />
|
||||
<input class="form-control" name="ticketid" value=@ViewBag.targetTicket.ID readonly hidden />
|
||||
<input class="form-control" name="ID" value=@ViewBag.targetTicket.responsid readonly hidden />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
45
Views/responses/test.cshtml
Normal file
45
Views/responses/test.cshtml
Normal file
@ -0,0 +1,45 @@
|
||||
@model IEnumerable<WebApplication1.Models.response>
|
||||
|
||||
<p>
|
||||
@Html.ActionLink("Create New", "Create")
|
||||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.title)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.content)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.adminid)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ticketid)
|
||||
</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.DisplayFor(modelItem => item.adminid)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ticketid)
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
|
||||
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
|
||||
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</table>
|
||||
Reference in New Issue
Block a user