public ActionResult TicketModel(int id = -1, int page = 1, string sort = "Date", string sortDir = "Ascending") { int totalRecords = 10; IEnumerable<TicketModel> tickets = new List<TicketModel>() { new TicketModel { ID = 1, Date = "01/01/2012", TicketType = TicketType.CarMigration, CarNumber = "1233211", Customer = "Client1" }, new TicketModel { ID = 2, Date = "02/02/2012", TicketType = TicketType.CarRepair, CarNumber = "1233211", Customer = "Client2" }, new TicketModel { ID = 3, Date = "03/03/2012", TicketType = TicketType.ContinueRent, CarNumber = "1233211", Customer = "Client3" } }; ViewBag.current_ticket = (id == -1) ? 1 : id; PagedTickets<TicketModel> model = new PagedTickets<TicketModel> { PageSize = pageSize, PageNumber = page, Tickets = tickets, TotalRows = totalRecords }; if (Request.IsAjaxRequest()) { return PartialView("AjaxTicketModel_Grid", model); } return View(model); }
public ActionResult TicketHistoryModel(int page = 1, string sort = "OpenDate", string sortDir = "Ascending") { int totalRecords = 10; IEnumerable<TicketHistoryModel> tickets = new List<TicketHistoryModel>() { new TicketHistoryModel { OpenDate = "01/01/2012", CloseDate = "01/02/2012", Department = "Dep1", Executor = "Exec1", }, new TicketHistoryModel { OpenDate = "01/01/2012", CloseDate = "01/02/2012", Department = "Dep2", Executor = "Exec2", }, new TicketHistoryModel { OpenDate = "01/01/2012", CloseDate = "01/02/2012", Department = "Dep3", Executor = "Exec3", } }; PagedTickets<TicketHistoryModel> model = new PagedTickets<TicketHistoryModel> { PageSize = pageSize, PageNumber = page, Tickets = tickets, TotalRows = totalRecords }; if (Request.IsAjaxRequest()) { return PartialView("AjaxTicketHistoryModel_Grid", model); } return View(); }