mirror of https://github.com/abpframework/abp.git
4 changed files with 28 additions and 43 deletions
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -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; } |
|
||||
} |
|
||||
} |
|
||||
@ -1,5 +1,5 @@ |
|||||
@using AbpDesk.Web.Mvc.Models.Tickets |
@page |
||||
@model IndexViewModel |
@model AbpDesk.Web.Mvc.Pages.Tickets.IndexModel |
||||
|
|
||||
@section styles |
@section styles |
||||
{ |
{ |
||||
@ -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…
Reference in new issue