Exemple #1
0
        public IHttpResponse All()
        {
            var user = this.GetUser();

            if (user.Role != UserRole.Admin)
            {
                return(this.Redirect("/"));
            }

            return(this.View(receiptsService.GetAllReceipts()));
        }
Exemple #2
0
 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());
 }