From f352792d11e4011c038ef7a683d881cff55d8353 Mon Sep 17 00:00:00 2001 From: Regiaaaaaa Date: Mon, 24 Nov 2025 11:37:47 +0700 Subject: [PATCH] feat: create a new submenu Rumah (RW) in the Rumah Menu --- Controllers/RumahRwController.cs | 50 ++++ Views/DataRumahRw/Index.cshtml | 351 +++++++++++++++++++++++ Views/Shared/Layouts/App/_Sidebar.cshtml | 8 +- 3 files changed, 408 insertions(+), 1 deletion(-) create mode 100644 Controllers/RumahRwController.cs create mode 100644 Views/DataRumahRw/Index.cshtml diff --git a/Controllers/RumahRwController.cs b/Controllers/RumahRwController.cs new file mode 100644 index 0000000..61cb132 --- /dev/null +++ b/Controllers/RumahRwController.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Mvc; + +namespace BpsRwApp.Controllers +{ + [Route("[controller]/[action]")] + public class DataRumahRwController : AppControllerBase + { + public IActionResult Index() + { + return View(); + } + + [HttpGet] + public IActionResult Table() + { + var data = Enumerable.Range(0, 100) + .Select(index => + { + var wilayah = ControllerSampleData.WilayahSeeds[index % ControllerSampleData.WilayahSeeds.Length]; + var street = ControllerSampleData.StreetNames[(index + 2) % ControllerSampleData.StreetNames.Length]; + var pemilik = ControllerSampleData.PersonNames[(index + 5) % ControllerSampleData.PersonNames.Length]; + + var status = index % 4 == 0 ? "Tidak Aktif" : "Aktif"; + var checklist = index % 3 == 0 ? "Tidak" : "Ya"; + + return new + { + rt = ((index % 16) + 1).ToString("D3"), + rw = ((index / 4) + 1).ToString("D3"), + alamat = $"{street} No. {index + 1}", + kota = wilayah.Kota, + nama_pemilik = pemilik, + status = status, + checklist = checklist, + aksi = $@" +
+ + + {(status == "Aktif" + ? "" + : "")} +
" + }; + }) + .ToArray(); + + return Json(new { data }); + } + } +} diff --git a/Views/DataRumahRw/Index.cshtml b/Views/DataRumahRw/Index.cshtml new file mode 100644 index 0000000..85602a4 --- /dev/null +++ b/Views/DataRumahRw/Index.cshtml @@ -0,0 +1,351 @@ +@{ + ViewData["Title"] = "Data Rumah RW"; +} + + + +
+ +
+

Data Rumah RW

+
+
+ + +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + +
NoRTRWAlamatKotaNama PemilikStatusChecklistAksi
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Views/Shared/Layouts/App/_Sidebar.cshtml b/Views/Shared/Layouts/App/_Sidebar.cshtml index 437cdac..d004929 100644 --- a/Views/Shared/Layouts/App/_Sidebar.cshtml +++ b/Views/Shared/Layouts/App/_Sidebar.cshtml @@ -62,9 +62,15 @@
  • -
    +
    DATA RUMAH