I need to select all rows from a table with a status as closed, and then I need to display results in a list in a asp.net mvc view.
What should I place in the cshtml first line?
@model HelpDesk.Domain.Entities.Ticket
@{
ViewBag.Title = "Help Desk | Admin Console";
Layout = "~/Views/Shared/_Layout.cshtml";
ViewBag.selectedSub = 0;
}
How about here.
@using (Html.BeginForm())
{
}
Here is the method.
public Tickets GetTicketByStatus(string status)
{
return context.dbentity.Where()........
}
Here is the model
public class Ticket
{
public int CaseID { get; set; }
public string Title { get; set; }
[Required]
public string UFirstName { get; set; }
[Required]
public string ULastName { get; set; }
//public string UDisplayName { get; set; }
[Required]
public string UDep_Location { get; set; }
[Required]
public string UEmailAddress { get; set; }
//public string UComputerName { get; set; }
//public string UIPAddress { get; set; }
[Required]
public string UPhoneNumber { get; set; }
[Required]
public string Priority { get; set; }
[Required]
public string ProbCat { get; set; }
//public string IniDateTime { get; set; }
//public string UpdateProbDetails { get; set; }
//public string UpdatedBy { get; set; }
public string InitiatedBy_tech { get; set; }
public string AssignedBy { get; set; }
[Required]
public string TechAssigned { get; set; }
[Required]
[DataType(DataType.MultilineText)]
public string ProbDetails { get; set; }
[Required]
public string TicketStatus { get; set; }
public string TicketSource { get; set; }
}