respond (buggy)
This commit is contained in:
160
Controllers/responsesController.cs
Normal file
160
Controllers/responsesController.cs
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using WebApplication1.Models;
|
||||||
|
|
||||||
|
namespace WebApplication1.Controllers
|
||||||
|
{
|
||||||
|
public class responsesController : Controller
|
||||||
|
{
|
||||||
|
private newswebappEntities db = new newswebappEntities();
|
||||||
|
|
||||||
|
// GET: responses
|
||||||
|
public ActionResult Index()
|
||||||
|
{
|
||||||
|
if (Convert.ToInt32(Session["Userrole"]) > 0)
|
||||||
|
{
|
||||||
|
return View(db.tickets.OrderByDescending(p => p.priority).Where(s=> s.status == 1).ToList());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@ViewBag.role = "user";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Session["User"] != null)
|
||||||
|
{
|
||||||
|
if (Session["Userid"] == null)
|
||||||
|
{
|
||||||
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||||
|
}
|
||||||
|
user user = db.users.Find(Session["Userid"]);
|
||||||
|
if (user == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(user);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return RedirectToAction("Login","users");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: responses/Details/5
|
||||||
|
public ActionResult Details(int? id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||||
|
}
|
||||||
|
response response = db.responses.Find(id);
|
||||||
|
if (response == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: responses/Create
|
||||||
|
public ActionResult Create()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: responses/Create
|
||||||
|
// To protect from overposting attacks, enable the specific properties you want to bind to, for
|
||||||
|
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public ActionResult Create([Bind(Include = "ID,title,content,adminid,ticketid")] response response)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
|
||||||
|
db.responses.Add(response);
|
||||||
|
db.SaveChanges();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: responses/Edit/5
|
||||||
|
public ActionResult Respond(int? id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||||
|
}
|
||||||
|
ViewBag.targetTicket = db.tickets.Find(id);
|
||||||
|
ViewBag.sender = db.users.Find(db.tickets.Find(id).senderid);
|
||||||
|
|
||||||
|
if (ViewBag.targetTicket == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: responses/Edit/5
|
||||||
|
// To protect from overposting attacks, enable the specific properties you want to bind to, for
|
||||||
|
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public ActionResult Respond([Bind(Include = "ID,title,content,adminid,ticketid")] response response)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
response.adminid = Convert.ToInt32(Session["Userid"]);
|
||||||
|
//wtf
|
||||||
|
db.responses.Add(response);
|
||||||
|
db.SaveChanges();
|
||||||
|
|
||||||
|
var targetTicket= db.tickets.Find(response.ticketid);
|
||||||
|
targetTicket.status = 0;
|
||||||
|
db.SaveChanges();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
return View(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: responses/Delete/5
|
||||||
|
public ActionResult Delete(int? id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||||
|
}
|
||||||
|
response response = db.responses.Find(id);
|
||||||
|
if (response == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: responses/Delete/5
|
||||||
|
[HttpPost, ActionName("Delete")]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public ActionResult DeleteConfirmed(int id)
|
||||||
|
{
|
||||||
|
response response = db.responses.Find(id);
|
||||||
|
db.responses.Remove(response);
|
||||||
|
db.SaveChanges();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
db.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
142
Controllers/ticketsController.cs
Normal file
142
Controllers/ticketsController.cs
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using WebApplication1.Models;
|
||||||
|
|
||||||
|
namespace WebApplication1.Controllers
|
||||||
|
{
|
||||||
|
public class ticketsController : Controller
|
||||||
|
{
|
||||||
|
private newswebappEntities db = new newswebappEntities();
|
||||||
|
|
||||||
|
// GET: tickets
|
||||||
|
public ActionResult Index()
|
||||||
|
{
|
||||||
|
if (Session["User"] != null)
|
||||||
|
{
|
||||||
|
int uid = Convert.ToInt32(Session["Userid"]);
|
||||||
|
return View(db.tickets.Where(n => n.senderid == uid));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return RedirectToAction("Login");
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: tickets/Details/5
|
||||||
|
public ActionResult Details(int? id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||||
|
}
|
||||||
|
ticket ticket = db.tickets.Find(id);
|
||||||
|
if (ticket == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: tickets/Create
|
||||||
|
public ActionResult Create()
|
||||||
|
{
|
||||||
|
if (Session["User"] != null)
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return RedirectToAction("Login","users");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: tickets/Create
|
||||||
|
// To protect from overposting attacks, enable the specific properties you want to bind to, for
|
||||||
|
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public ActionResult Create([Bind(Include = "ID,title,content,priority,senderid,status")] ticket ticket)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
ticket.senderid = Convert.ToInt32(Session["Userid"]);
|
||||||
|
ticket.status = 1;
|
||||||
|
|
||||||
|
db.tickets.Add(ticket);
|
||||||
|
db.SaveChanges();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: tickets/Edit/5
|
||||||
|
public ActionResult Edit(int? id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||||
|
}
|
||||||
|
ticket ticket = db.tickets.Find(id);
|
||||||
|
if (ticket == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: tickets/Edit/5
|
||||||
|
// To protect from overposting attacks, enable the specific properties you want to bind to, for
|
||||||
|
// more details see https://go.microsoft.com/fwlink/?LinkId=317598.
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public ActionResult Edit([Bind(Include = "ID,title,content,priority,senderid,status")] ticket ticket)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
db.Entry(ticket).State = EntityState.Modified;
|
||||||
|
db.SaveChanges();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
return View(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: tickets/Delete/5
|
||||||
|
public ActionResult Delete(int? id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||||
|
}
|
||||||
|
ticket ticket = db.tickets.Find(id);
|
||||||
|
if (ticket == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: tickets/Delete/5
|
||||||
|
[HttpPost, ActionName("Delete")]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public ActionResult DeleteConfirmed(int id)
|
||||||
|
{
|
||||||
|
ticket ticket = db.tickets.Find(id);
|
||||||
|
db.tickets.Remove(ticket);
|
||||||
|
db.SaveChanges();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
db.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -30,5 +30,6 @@ namespace WebApplication1.Models
|
|||||||
public virtual DbSet<tag> tags { get; set; }
|
public virtual DbSet<tag> tags { get; set; }
|
||||||
public virtual DbSet<ticket> tickets { get; set; }
|
public virtual DbSet<ticket> tickets { get; set; }
|
||||||
public virtual DbSet<user> users { get; set; }
|
public virtual DbSet<user> users { get; set; }
|
||||||
|
public virtual DbSet<response> responses { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,16 @@
|
|||||||
<Property Name="Content" Type="nvarchar(max)" Nullable="false" />
|
<Property Name="Content" Type="nvarchar(max)" Nullable="false" />
|
||||||
<Property Name="views" Type="int" />
|
<Property Name="views" Type="int" />
|
||||||
</EntityType>
|
</EntityType>
|
||||||
|
<EntityType Name="response">
|
||||||
|
<Key>
|
||||||
|
<PropertyRef Name="ID" />
|
||||||
|
</Key>
|
||||||
|
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||||
|
<Property Name="title" Type="nchar" MaxLength="10" />
|
||||||
|
<Property Name="content" Type="nchar" MaxLength="10" />
|
||||||
|
<Property Name="adminid" Type="int" />
|
||||||
|
<Property Name="ticketid" Type="int" />
|
||||||
|
</EntityType>
|
||||||
<EntityType Name="tag">
|
<EntityType Name="tag">
|
||||||
<Key>
|
<Key>
|
||||||
<PropertyRef Name="code" />
|
<PropertyRef Name="code" />
|
||||||
@ -42,10 +52,11 @@
|
|||||||
<PropertyRef Name="ID" />
|
<PropertyRef Name="ID" />
|
||||||
</Key>
|
</Key>
|
||||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||||
<Property Name="title" Type="nvarchar" MaxLength="50" />
|
<Property Name="title" Type="nvarchar" MaxLength="50" Nullable="false" />
|
||||||
<Property Name="content" Type="nvarchar(max)" />
|
<Property Name="content" Type="nvarchar(max)" Nullable="false" />
|
||||||
<Property Name="priority" Type="nvarchar" MaxLength="50" />
|
<Property Name="priority" Type="int" Nullable="false" />
|
||||||
<Property Name="senderid" Type="int" />
|
<Property Name="senderid" Type="int" Nullable="false" />
|
||||||
|
<Property Name="status" Type="int" />
|
||||||
</EntityType>
|
</EntityType>
|
||||||
<EntityType Name="user">
|
<EntityType Name="user">
|
||||||
<Key>
|
<Key>
|
||||||
@ -60,6 +71,7 @@
|
|||||||
<EntityContainer Name="newswebappModelStoreContainer">
|
<EntityContainer Name="newswebappModelStoreContainer">
|
||||||
<EntitySet Name="category" EntityType="Self.category" Schema="dbo" store:Type="Tables" />
|
<EntitySet Name="category" EntityType="Self.category" Schema="dbo" store:Type="Tables" />
|
||||||
<EntitySet Name="news" EntityType="Self.news" Schema="dbo" store:Type="Tables" />
|
<EntitySet Name="news" EntityType="Self.news" Schema="dbo" store:Type="Tables" />
|
||||||
|
<EntitySet Name="response" EntityType="Self.response" Schema="dbo" store:Type="Tables" />
|
||||||
<EntitySet Name="tag" EntityType="Self.tag" Schema="dbo" store:Type="Tables" />
|
<EntitySet Name="tag" EntityType="Self.tag" Schema="dbo" store:Type="Tables" />
|
||||||
<EntitySet Name="ticket" EntityType="Self.ticket" Schema="dbo" store:Type="Tables" />
|
<EntitySet Name="ticket" EntityType="Self.ticket" Schema="dbo" store:Type="Tables" />
|
||||||
<EntitySet Name="user" EntityType="Self.user" Schema="dbo" store:Type="Tables" />
|
<EntitySet Name="user" EntityType="Self.user" Schema="dbo" store:Type="Tables" />
|
||||||
@ -74,6 +86,7 @@
|
|||||||
<EntitySet Name="tags" EntityType="newswebappModel.tag" />
|
<EntitySet Name="tags" EntityType="newswebappModel.tag" />
|
||||||
<EntitySet Name="tickets" EntityType="newswebappModel.ticket" />
|
<EntitySet Name="tickets" EntityType="newswebappModel.ticket" />
|
||||||
<EntitySet Name="users" EntityType="newswebappModel.user" />
|
<EntitySet Name="users" EntityType="newswebappModel.user" />
|
||||||
|
<EntitySet Name="responses" EntityType="newswebappModel.response" />
|
||||||
</EntityContainer>
|
</EntityContainer>
|
||||||
<EntityType Name="category">
|
<EntityType Name="category">
|
||||||
<Key>
|
<Key>
|
||||||
@ -112,10 +125,11 @@
|
|||||||
<PropertyRef Name="ID" />
|
<PropertyRef Name="ID" />
|
||||||
</Key>
|
</Key>
|
||||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||||
<Property Name="title" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
|
<Property Name="title" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
|
||||||
<Property Name="content" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
|
<Property Name="content" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
|
||||||
<Property Name="priority" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
|
<Property Name="priority" Type="Int32" Nullable="false" />
|
||||||
<Property Name="senderid" Type="Int32" />
|
<Property Name="senderid" Type="Int32" Nullable="false" />
|
||||||
|
<Property Name="status" Type="Int32" />
|
||||||
</EntityType>
|
</EntityType>
|
||||||
<EntityType Name="user">
|
<EntityType Name="user">
|
||||||
<Key>
|
<Key>
|
||||||
@ -127,6 +141,16 @@
|
|||||||
<Property Name="displayname" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
|
<Property Name="displayname" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
|
||||||
<Property Name="role" Type="Int32" Nullable="false" />
|
<Property Name="role" Type="Int32" Nullable="false" />
|
||||||
</EntityType>
|
</EntityType>
|
||||||
|
<EntityType Name="response">
|
||||||
|
<Key>
|
||||||
|
<PropertyRef Name="ID" />
|
||||||
|
</Key>
|
||||||
|
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||||
|
<Property Name="title" Type="String" MaxLength="10" FixedLength="true" Unicode="true" />
|
||||||
|
<Property Name="content" Type="String" MaxLength="10" FixedLength="true" Unicode="true" />
|
||||||
|
<Property Name="adminid" Type="Int32" />
|
||||||
|
<Property Name="ticketid" Type="Int32" />
|
||||||
|
</EntityType>
|
||||||
</Schema>
|
</Schema>
|
||||||
</edmx:ConceptualModels>
|
</edmx:ConceptualModels>
|
||||||
<!-- C-S mapping content -->
|
<!-- C-S mapping content -->
|
||||||
@ -171,6 +195,7 @@
|
|||||||
<EntitySetMapping Name="tickets">
|
<EntitySetMapping Name="tickets">
|
||||||
<EntityTypeMapping TypeName="newswebappModel.ticket">
|
<EntityTypeMapping TypeName="newswebappModel.ticket">
|
||||||
<MappingFragment StoreEntitySet="ticket">
|
<MappingFragment StoreEntitySet="ticket">
|
||||||
|
<ScalarProperty Name="status" ColumnName="status" />
|
||||||
<ScalarProperty Name="senderid" ColumnName="senderid" />
|
<ScalarProperty Name="senderid" ColumnName="senderid" />
|
||||||
<ScalarProperty Name="priority" ColumnName="priority" />
|
<ScalarProperty Name="priority" ColumnName="priority" />
|
||||||
<ScalarProperty Name="content" ColumnName="content" />
|
<ScalarProperty Name="content" ColumnName="content" />
|
||||||
@ -190,6 +215,17 @@
|
|||||||
</MappingFragment>
|
</MappingFragment>
|
||||||
</EntityTypeMapping>
|
</EntityTypeMapping>
|
||||||
</EntitySetMapping>
|
</EntitySetMapping>
|
||||||
|
<EntitySetMapping Name="responses">
|
||||||
|
<EntityTypeMapping TypeName="newswebappModel.response">
|
||||||
|
<MappingFragment StoreEntitySet="response">
|
||||||
|
<ScalarProperty Name="ticketid" ColumnName="ticketid" />
|
||||||
|
<ScalarProperty Name="adminid" ColumnName="adminid" />
|
||||||
|
<ScalarProperty Name="content" ColumnName="content" />
|
||||||
|
<ScalarProperty Name="title" ColumnName="title" />
|
||||||
|
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||||
|
</MappingFragment>
|
||||||
|
</EntityTypeMapping>
|
||||||
|
</EntitySetMapping>
|
||||||
</EntityContainerMapping>
|
</EntityContainerMapping>
|
||||||
</Mapping>
|
</Mapping>
|
||||||
</edmx:Mappings>
|
</edmx:Mappings>
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
<EntityTypeShape EntityType="newswebappModel.tag" Width="1.5" PointX="4.75" PointY="0.75" />
|
<EntityTypeShape EntityType="newswebappModel.tag" Width="1.5" PointX="4.75" PointY="0.75" />
|
||||||
<EntityTypeShape EntityType="newswebappModel.ticket" Width="1.5" PointX="0.75" PointY="4.75" />
|
<EntityTypeShape EntityType="newswebappModel.ticket" Width="1.5" PointX="0.75" PointY="4.75" />
|
||||||
<EntityTypeShape EntityType="newswebappModel.user" Width="1.5" PointX="2.75" PointY="4.75" />
|
<EntityTypeShape EntityType="newswebappModel.user" Width="1.5" PointX="2.75" PointY="4.75" />
|
||||||
|
<EntityTypeShape EntityType="newswebappModel.response" Width="1.5" PointX="4.75" PointY="4.625" />
|
||||||
</Diagram>
|
</Diagram>
|
||||||
</edmx:Diagrams>
|
</edmx:Diagrams>
|
||||||
</edmx:Designer>
|
</edmx:Designer>
|
||||||
|
|||||||
23
Models/response.cs
Normal file
23
Models/response.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated from a template.
|
||||||
|
//
|
||||||
|
// Manual changes to this file may cause unexpected behavior in your application.
|
||||||
|
// Manual changes to this file will be overwritten if the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace WebApplication1.Models
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public partial class response
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string title { get; set; }
|
||||||
|
public string content { get; set; }
|
||||||
|
public Nullable<int> adminid { get; set; }
|
||||||
|
public Nullable<int> ticketid { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -17,7 +17,8 @@ namespace WebApplication1.Models
|
|||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
public string title { get; set; }
|
public string title { get; set; }
|
||||||
public string content { get; set; }
|
public string content { get; set; }
|
||||||
public string priority { get; set; }
|
public int priority { get; set; }
|
||||||
public Nullable<int> senderid { get; set; }
|
public int senderid { get; set; }
|
||||||
|
public Nullable<int> status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
59
Views/responses/Create.cshtml
Normal file
59
Views/responses/Create.cshtml
Normal 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>
|
||||||
56
Views/responses/Delete.cshtml
Normal file
56
Views/responses/Delete.cshtml
Normal 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>
|
||||||
50
Views/responses/Details.cshtml
Normal file
50
Views/responses/Details.cshtml
Normal 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>
|
||||||
39
Views/responses/Index.cshtml
Normal file
39
Views/responses/Index.cshtml
Normal 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>
|
||||||
99
Views/responses/Respond.cshtml
Normal file
99
Views/responses/Respond.cshtml
Normal 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>
|
||||||
55
Views/tickets/Create.cshtml
Normal file
55
Views/tickets/Create.cshtml
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
@model WebApplication1.Models.ticket
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewBag.Title = "Create";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Create</h2>
|
||||||
|
|
||||||
|
@using (Html.BeginForm())
|
||||||
|
{
|
||||||
|
@Html.AntiForgeryToken()
|
||||||
|
|
||||||
|
<div class="form-horizontal">
|
||||||
|
<h4>ticket</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.TextAreaFor(model => model.content, new { @class = "form-control" })
|
||||||
|
@Html.ValidationMessageFor(model => model.content, "", new { @class = "text-danger" })
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.priority, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||||
|
<div class="col-md-10">
|
||||||
|
<select name="priority" class="form-control">
|
||||||
|
<Option value=1>Urgant</Option>
|
||||||
|
<Option value=2>Important</Option>
|
||||||
|
<Option value=3>Notmal</Option>
|
||||||
|
</select>
|
||||||
|
</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>
|
||||||
56
Views/tickets/Delete.cshtml
Normal file
56
Views/tickets/Delete.cshtml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
@model WebApplication1.Models.ticket
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewBag.Title = "Delete";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Delete</h2>
|
||||||
|
|
||||||
|
<h3>Are you sure you want to delete this?</h3>
|
||||||
|
<div>
|
||||||
|
<h4>ticket</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.priority)
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.priority)
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>
|
||||||
|
@Html.DisplayNameFor(model => model.senderid)
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.senderid)
|
||||||
|
</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>
|
||||||
50
Views/tickets/Details.cshtml
Normal file
50
Views/tickets/Details.cshtml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
@model WebApplication1.Models.ticket
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewBag.Title = "Details";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Details</h2>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4>ticket</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.priority)
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.priority)
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>
|
||||||
|
@Html.DisplayNameFor(model => model.senderid)
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.senderid)
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
@Html.ActionLink("Edit", "Edit", new { id = Model.ID }) |
|
||||||
|
@Html.ActionLink("Back to List", "Index")
|
||||||
|
</p>
|
||||||
61
Views/tickets/Edit.cshtml
Normal file
61
Views/tickets/Edit.cshtml
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
@model WebApplication1.Models.ticket
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewBag.Title = "Edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Edit</h2>
|
||||||
|
|
||||||
|
@using (Html.BeginForm())
|
||||||
|
{
|
||||||
|
@Html.AntiForgeryToken()
|
||||||
|
|
||||||
|
<div class="form-horizontal">
|
||||||
|
<h4>ticket</h4>
|
||||||
|
<hr />
|
||||||
|
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
|
||||||
|
@Html.HiddenFor(model => model.ID)
|
||||||
|
|
||||||
|
<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.priority, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||||
|
<div class="col-md-10">
|
||||||
|
@Html.EditorFor(model => model.priority, new { htmlAttributes = new { @class = "form-control" } })
|
||||||
|
@Html.ValidationMessageFor(model => model.priority, "", new { @class = "text-danger" })
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
@Html.LabelFor(model => model.senderid, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||||
|
<div class="col-md-10">
|
||||||
|
@Html.EditorFor(model => model.senderid, new { htmlAttributes = new { @class = "form-control" } })
|
||||||
|
@Html.ValidationMessageFor(model => model.senderid, "", new { @class = "text-danger" })
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-md-offset-2 col-md-10">
|
||||||
|
<input type="submit" value="Save" class="btn btn-default" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
@Html.ActionLink("Back to List", "Index")
|
||||||
|
</div>
|
||||||
51
Views/tickets/Index.cshtml
Normal file
51
Views/tickets/Index.cshtml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
@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>
|
||||||
|
@Html.DisplayNameFor(model => model.priority)
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.senderid)
|
||||||
|
</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.priority)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.senderid)
|
||||||
|
</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>
|
||||||
@ -145,6 +145,8 @@
|
|||||||
<Compile Include="Controllers\categoriesController.cs" />
|
<Compile Include="Controllers\categoriesController.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
<Compile Include="Controllers\newsController.cs" />
|
<Compile Include="Controllers\newsController.cs" />
|
||||||
|
<Compile Include="Controllers\responsesController.cs" />
|
||||||
|
<Compile Include="Controllers\ticketsController.cs" />
|
||||||
<Compile Include="Controllers\usersController.cs" />
|
<Compile Include="Controllers\usersController.cs" />
|
||||||
<Compile Include="Global.asax.cs">
|
<Compile Include="Global.asax.cs">
|
||||||
<DependentUpon>Global.asax</DependentUpon>
|
<DependentUpon>Global.asax</DependentUpon>
|
||||||
@ -156,6 +158,9 @@
|
|||||||
<Compile Include="Models\newsModel.cs" />
|
<Compile Include="Models\newsModel.cs" />
|
||||||
<Compile Include="Models\Register.cs" />
|
<Compile Include="Models\Register.cs" />
|
||||||
<Compile Include="Controllers\tagsController.cs" />
|
<Compile Include="Controllers\tagsController.cs" />
|
||||||
|
<Compile Include="Models\response.cs">
|
||||||
|
<DependentUpon>Model1.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Models\TheNews.cs" />
|
<Compile Include="Models\TheNews.cs" />
|
||||||
<Compile Include="Models\Model1.Context.cs">
|
<Compile Include="Models\Model1.Context.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
@ -276,6 +281,16 @@
|
|||||||
<Content Include="Views\tags\Edit.cshtml" />
|
<Content Include="Views\tags\Edit.cshtml" />
|
||||||
<Content Include="Views\tags\Index.cshtml" />
|
<Content Include="Views\tags\Index.cshtml" />
|
||||||
<Content Include="Views\news\Latest.cshtml" />
|
<Content Include="Views\news\Latest.cshtml" />
|
||||||
|
<Content Include="Views\tickets\Create.cshtml" />
|
||||||
|
<Content Include="Views\tickets\Delete.cshtml" />
|
||||||
|
<Content Include="Views\tickets\Details.cshtml" />
|
||||||
|
<Content Include="Views\tickets\Edit.cshtml" />
|
||||||
|
<Content Include="Views\tickets\Index.cshtml" />
|
||||||
|
<Content Include="Views\responses\Create.cshtml" />
|
||||||
|
<Content Include="Views\responses\Delete.cshtml" />
|
||||||
|
<Content Include="Views\responses\Details.cshtml" />
|
||||||
|
<Content Include="Views\responses\Respond.cshtml" />
|
||||||
|
<Content Include="Views\responses\Index.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="App_Data\" />
|
<Folder Include="App_Data\" />
|
||||||
|
|||||||
Reference in New Issue
Block a user