0

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; }
    }
3
  • 3
    There are tons of examples online about this. Check out http://www.asp.net/mvc. It has lots of tutorials about getting data from databases and displaying in your MVC web site. Commented Jul 12, 2013 at 19:10
  • 1
    Could you post the code of your Entity?! Commented Jul 12, 2013 at 19:21
  • posted code for entity Commented Jul 12, 2013 at 19:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.