diff --git a/Uriagekun/Controllers/GoodController.cs b/Uriagekun/Controllers/GoodController.cs index 8115c79..73a5ec9 100644 --- a/Uriagekun/Controllers/GoodController.cs +++ b/Uriagekun/Controllers/GoodController.cs @@ -21,11 +21,11 @@ public class GoodController : Controller } var good = await this.repository.GetGoodRegisterFromBarcode(id); - if (good is null) + if (good is null || good.Count == 0) { return NotFound(); } - return Json(good); + return View(good); } } diff --git a/Uriagekun/Views/Good/View.cshtml b/Uriagekun/Views/Good/View.cshtml new file mode 100644 index 0000000..497297f --- /dev/null +++ b/Uriagekun/Views/Good/View.cshtml @@ -0,0 +1,30 @@ +@model List +@{ + ViewData["Title"] = $"{Model[0].Label} - 売上管理"; +} + +
+

@(Model[0].Label)

+
+ + + + + + + + + + + @foreach(var data in Model) { + + + + + + + } + +
日時販売個数販売単価純利益
@(data.Date)@(data.Count)@(data.Price)@(data.Count * data.Price)
+
+
diff --git a/Uriagekun/Views/Shared/_Layout.cshtml b/Uriagekun/Views/Shared/_Layout.cshtml index 36728cf..b389eec 100644 --- a/Uriagekun/Views/Shared/_Layout.cshtml +++ b/Uriagekun/Views/Shared/_Layout.cshtml @@ -3,7 +3,7 @@ - @ViewData["Title"] - 売上管理 + @ViewData["Title"] - うりあげくん @@ -25,6 +25,9 @@ +