respond (buggy)

This commit is contained in:
2024-08-02 22:08:18 +03:30
parent fbb2d406cb
commit 780bfc94c8
18 changed files with 965 additions and 10 deletions

View File

@ -0,0 +1,59 @@
@model WebApplication1.Models.response
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>response</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.title, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.title, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.title, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.content, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.content, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.content, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.adminid, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.adminid, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.adminid, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.ticketid, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.ticketid, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.ticketid, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>

View File

@ -0,0 +1,56 @@
@model WebApplication1.Models.response
@{
ViewBag.Title = "Delete";
}
<h2>Delete</h2>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>response</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.title)
</dt>
<dd>
@Html.DisplayFor(model => model.title)
</dd>
<dt>
@Html.DisplayNameFor(model => model.content)
</dt>
<dd>
@Html.DisplayFor(model => model.content)
</dd>
<dt>
@Html.DisplayNameFor(model => model.adminid)
</dt>
<dd>
@Html.DisplayFor(model => model.adminid)
</dd>
<dt>
@Html.DisplayNameFor(model => model.ticketid)
</dt>
<dd>
@Html.DisplayFor(model => model.ticketid)
</dd>
</dl>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
<div class="form-actions no-color">
<input type="submit" value="Delete" class="btn btn-default" /> |
@Html.ActionLink("Back to List", "Index")
</div>
}
</div>

View File

@ -0,0 +1,50 @@
@model WebApplication1.Models.response
@{
ViewBag.Title = "Details";
}
<h2>Details</h2>
<div>
<h4>response</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.title)
</dt>
<dd>
@Html.DisplayFor(model => model.title)
</dd>
<dt>
@Html.DisplayNameFor(model => model.content)
</dt>
<dd>
@Html.DisplayFor(model => model.content)
</dd>
<dt>
@Html.DisplayNameFor(model => model.adminid)
</dt>
<dd>
@Html.DisplayFor(model => model.adminid)
</dd>
<dt>
@Html.DisplayNameFor(model => model.ticketid)
</dt>
<dd>
@Html.DisplayFor(model => model.ticketid)
</dd>
</dl>
</div>
<p>
@Html.ActionLink("Edit", "Edit", new { id = Model.ID }) |
@Html.ActionLink("Back to List", "Index")
</p>

View File

@ -0,0 +1,39 @@
@model IEnumerable<WebApplication1.Models.ticket>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<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></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>
}
</table>

View File

@ -0,0 +1,99 @@
@model WebApplication1.Models.response
@{
ViewBag.Title = "Edit";
string priority = "";
if (ViewBag.targetTicket.priority == 1)
{
priority = "Urgant";
}
else if (ViewBag.targetTicket.priority == 2)
{
priority = "Important";
}
else
{
priority = "Normal";
}
}
<h2>Edit</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<h4>response</h4>
<hr />
<div class="row">
<section class="col-md-4">
<div class="form-group">
Title
<div class="col-md-10">
<input class="form-control" placeholder=@ViewBag.targetTicket.title readonly />
</div>
</div>
<div class="form-group">
Sender
<div class="col-md-10">
<input class="form-control" placeholder=@ViewBag.sender readonly />
</div>
</div>
<div class="form-group">
Priority
<div class="col-md-10">
<input class="form-control" placeholder=@priority readonly />
</div>
</div>
<div class="form-group">
Content
<div class="col-md-10">
<textarea class="form-control" placeholder=@ViewBag.targetTicket.content></textarea>
</div>
</div>
<br />
</section>
<section class="col-md-4">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.title, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.title, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.title, "", new { @class = "text-danger" })
</div>
</div>
<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.ValidationMessageFor(model => model.content, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-10">
<input class="form-control" name="ticketid" value=@ViewBag.targetTicket.ID hidden />
</div>
</div>
</section>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-outline-dark" />
</div>
</div>
</div>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>