public IHttpResponse All() { var user = this.GetUser(); if (user.Role != UserRole.Admin) { return(this.Redirect("/")); } return(this.View(receiptsService.GetAllReceipts())); }
public IActionResult Index() { Model["Receipts"] = receiptsService.GetAllReceipts() .Select(r => new ReceiptViewModel() { Id = r.Id, Fee = $"${r.Fee:F2}", IssueDate = r.IssuedOn.ToString("dd'/'MM'/'yyyy", CultureInfo.InvariantCulture), Recipient = r.Recipient.Username }); return(View()); }