Browse Source

Made Ticket index razor page.

pull/179/head
Halil İbrahim Kalkan 9 years ago
parent
commit
0e7dd6628d
  1. 31
      src/AbpDesk/AbpDesk.Web.Mvc/Controllers/TicketsController.cs
  2. 10
      src/AbpDesk/AbpDesk.Web.Mvc/Models/Tickets/IndexViewModel.cs
  3. 4
      src/AbpDesk/AbpDesk.Web.Mvc/Pages/Tickets/Index.cshtml
  4. 26
      src/AbpDesk/AbpDesk.Web.Mvc/Pages/Tickets/Index.cshtml.cs

31
src/AbpDesk/AbpDesk.Web.Mvc/Controllers/TicketsController.cs

@ -1,31 +0,0 @@
using System.Threading.Tasks;
using AbpDesk.Tickets;
using AbpDesk.Tickets.Dtos;
using AbpDesk.Web.Mvc.Models.Tickets;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
namespace AbpDesk.Web.Mvc.Controllers
{
public class TicketsController : AbpController
{
private readonly ITicketAppService _ticketAppService;
public TicketsController(ITicketAppService ticketAppService)
{
_ticketAppService = ticketAppService;
}
public async Task<IActionResult> Index(GetAllTicketsInput input)
{
var result = await _ticketAppService.GetAll(input);
var model = new IndexViewModel
{
Tickets = result.Items
};
return View(model);
}
}
}

10
src/AbpDesk/AbpDesk.Web.Mvc/Models/Tickets/IndexViewModel.cs

@ -1,10 +0,0 @@
using System.Collections.Generic;
using AbpDesk.Tickets.Dtos;
namespace AbpDesk.Web.Mvc.Models.Tickets
{
public class IndexViewModel
{
public IReadOnlyList<TicketDto> Tickets { get; set; }
}
}

4
src/AbpDesk/AbpDesk.Web.Mvc/Views/Tickets/Index.cshtml → src/AbpDesk/AbpDesk.Web.Mvc/Pages/Tickets/Index.cshtml

@ -1,5 +1,5 @@
@using AbpDesk.Web.Mvc.Models.Tickets
@model IndexViewModel
@page
@model AbpDesk.Web.Mvc.Pages.Tickets.IndexModel
@section styles
{

26
src/AbpDesk/AbpDesk.Web.Mvc/Pages/Tickets/Index.cshtml.cs

@ -0,0 +1,26 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using AbpDesk.Tickets;
using AbpDesk.Tickets.Dtos;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace AbpDesk.Web.Mvc.Pages.Tickets
{
public class IndexModel : PageModel
{
public IReadOnlyList<TicketDto> Tickets { get; set; }
private readonly ITicketAppService _ticketAppService;
public IndexModel(ITicketAppService ticketAppService)
{
_ticketAppService = ticketAppService;
}
public async Task OnGetAsync(GetAllTicketsInput input)
{
var result = await _ticketAppService.GetAll(input);
Tickets = result.Items;
}
}
}
Loading…
Cancel
Save