diff --git a/Lieb/Pages/Users/Create.cshtml b/Lieb/Pages/Users/Create.cshtml deleted file mode 100644 index 3705ab8..0000000 --- a/Lieb/Pages/Users/Create.cshtml +++ /dev/null @@ -1,44 +0,0 @@ -@page -@model Lieb.Pages.Users.CreateModel - -@{ - ViewData["Title"] = "Create"; -} - -

Create

- -

User

-
-
-
-
-
-
- - - -
-
- - - -
-
- - - -
-
- -
-
-
-
- -
- Back to List -
- -@section Scripts { - @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} -} diff --git a/Lieb/Pages/Users/Create.cshtml.cs b/Lieb/Pages/Users/Create.cshtml.cs deleted file mode 100644 index e6ba4c0..0000000 --- a/Lieb/Pages/Users/Create.cshtml.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using Lieb.Data; -using Lieb.Models; - -namespace Lieb.Pages.Users -{ - public class CreateModel : PageModel - { - private readonly Lieb.Data.LiebContext _context; - - public CreateModel(Lieb.Data.LiebContext context) - { - _context = context; - } - - public IActionResult OnGet() - { - return Page(); - } - - [BindProperty] - public LiebUser User { get; set; } - - // To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.LiebUsers.Add(User); - await _context.SaveChangesAsync(); - - return RedirectToPage("./Index"); - } - } -} diff --git a/Lieb/Pages/Users/Delete.cshtml b/Lieb/Pages/Users/Delete.cshtml deleted file mode 100644 index 3ef308f..0000000 --- a/Lieb/Pages/Users/Delete.cshtml +++ /dev/null @@ -1,40 +0,0 @@ -@page -@model Lieb.Pages.Users.DeleteModel - -@{ - ViewData["Title"] = "Delete"; -} - -

Delete

- -

Are you sure you want to delete this?

-
-

User

-
-
-
- @Html.DisplayNameFor(model => model.User.DiscordUserId) -
-
- @Html.DisplayFor(model => model.User.DiscordUserId) -
-
- @Html.DisplayNameFor(model => model.User.Name) -
-
- @Html.DisplayFor(model => model.User.Name) -
-
- @Html.DisplayNameFor(model => model.User.Birthday) -
-
- @Html.DisplayFor(model => model.User.Birthday) -
-
- -
- - | - Back to List -
-
diff --git a/Lieb/Pages/Users/Delete.cshtml.cs b/Lieb/Pages/Users/Delete.cshtml.cs deleted file mode 100644 index d79b0af..0000000 --- a/Lieb/Pages/Users/Delete.cshtml.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using Lieb.Data; -using Lieb.Models; - -namespace Lieb.Pages.Users -{ - public class DeleteModel : PageModel - { - private readonly Lieb.Data.LiebContext _context; - - public DeleteModel(Lieb.Data.LiebContext context) - { - _context = context; - } - - [BindProperty] - public LiebUser User { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.LiebUsers.FirstOrDefaultAsync(m => m.LiebUserId == id); - - if (User == null) - { - return NotFound(); - } - return Page(); - } - - public async Task OnPostAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.LiebUsers.FindAsync(id); - - if (User != null) - { - _context.LiebUsers.Remove(User); - await _context.SaveChangesAsync(); - } - - return RedirectToPage("./Index"); - } - } -} diff --git a/Lieb/Pages/Users/Details.cshtml b/Lieb/Pages/Users/Details.cshtml deleted file mode 100644 index 80fb772..0000000 --- a/Lieb/Pages/Users/Details.cshtml +++ /dev/null @@ -1,37 +0,0 @@ -@page -@model Lieb.Pages.Users.DetailsModel - -@{ - ViewData["Title"] = "Details"; -} - -

Details

- -
-

User

-
-
-
- @Html.DisplayNameFor(model => model.User.DiscordUserId) -
-
- @Html.DisplayFor(model => model.User.DiscordUserId) -
-
- @Html.DisplayNameFor(model => model.User.Name) -
-
- @Html.DisplayFor(model => model.User.Name) -
-
- @Html.DisplayNameFor(model => model.User.Birthday) -
-
- @Html.DisplayFor(model => model.User.Birthday) -
-
-
-
- Edit | - Back to List -
diff --git a/Lieb/Pages/Users/Details.cshtml.cs b/Lieb/Pages/Users/Details.cshtml.cs deleted file mode 100644 index 2b1fbd2..0000000 --- a/Lieb/Pages/Users/Details.cshtml.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using Lieb.Data; -using Lieb.Models; - -namespace Lieb.Pages.Users -{ - public class DetailsModel : PageModel - { - private readonly Lieb.Data.LiebContext _context; - - public DetailsModel(Lieb.Data.LiebContext context) - { - _context = context; - } - - public LiebUser User { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.LiebUsers.FirstOrDefaultAsync(m => m.LiebUserId == id); - - if (User == null) - { - return NotFound(); - } - return Page(); - } - } -} diff --git a/Lieb/Pages/Users/Edit.cshtml b/Lieb/Pages/Users/Edit.cshtml deleted file mode 100644 index 5d53b71..0000000 --- a/Lieb/Pages/Users/Edit.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@page -@model Lieb.Pages.Users.EditModel - -@{ - ViewData["Title"] = "Edit"; -} - -

Edit

- -

User

-
-
-
-
-
- -
- - - -
-
- - - -
-
- - - -
-
- -
-
-
-
- -
- Back to List -
- -@section Scripts { - @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} -} diff --git a/Lieb/Pages/Users/Edit.cshtml.cs b/Lieb/Pages/Users/Edit.cshtml.cs deleted file mode 100644 index 000bb99..0000000 --- a/Lieb/Pages/Users/Edit.cshtml.cs +++ /dev/null @@ -1,78 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.EntityFrameworkCore; -using Lieb.Data; -using Lieb.Models; - -namespace Lieb.Pages.Users -{ - public class EditModel : PageModel - { - private readonly Lieb.Data.LiebContext _context; - - public EditModel(Lieb.Data.LiebContext context) - { - _context = context; - } - - [BindProperty] - public LiebUser User { get; set; } - - public async Task OnGetAsync(int? id) - { - if (id == null) - { - return NotFound(); - } - - User = await _context.LiebUsers.FirstOrDefaultAsync(m => m.LiebUserId == id); - - if (User == null) - { - return NotFound(); - } - return Page(); - } - - // To protect from overposting attacks, enable the specific properties you want to bind to. - // For more details, see https://aka.ms/RazorPagesCRUD. - public async Task OnPostAsync() - { - if (!ModelState.IsValid) - { - return Page(); - } - - _context.Attach(User).State = EntityState.Modified; - - try - { - await _context.SaveChangesAsync(); - } - catch (DbUpdateConcurrencyException) - { - if (!UserExists(User.LiebUserId)) - { - return NotFound(); - } - else - { - throw; - } - } - - return RedirectToPage("./Index"); - } - - private bool UserExists(int id) - { - return _context.LiebUsers.Any(e => e.LiebUserId == id); - } - } -} diff --git a/Lieb/Pages/Users/Index.cshtml b/Lieb/Pages/Users/Index.cshtml deleted file mode 100644 index 17d3529..0000000 --- a/Lieb/Pages/Users/Index.cshtml +++ /dev/null @@ -1,48 +0,0 @@ -@page -@model Lieb.Pages.Users.IndexModel - -@{ - ViewData["Title"] = "Index"; -} - -

Index

- -

- Create New -

- - - - - - - - - - -@foreach (var item in Model.User) { - - - - - - -} - -
- @Html.DisplayNameFor(model => model.User[0].DiscordUserId) - - @Html.DisplayNameFor(model => model.User[0].Name) - - @Html.DisplayNameFor(model => model.User[0].Birthday) -
- @Html.DisplayFor(modelItem => item.DiscordUserId) - - @Html.DisplayFor(modelItem => item.Name) - - @Html.DisplayFor(modelItem => item.Birthday) - - Edit | - Details | - Delete -
diff --git a/Lieb/Pages/Users/Index.cshtml.cs b/Lieb/Pages/Users/Index.cshtml.cs deleted file mode 100644 index 9a79d27..0000000 --- a/Lieb/Pages/Users/Index.cshtml.cs +++ /dev/null @@ -1,30 +0,0 @@ -#nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.EntityFrameworkCore; -using Lieb.Data; -using Lieb.Models; - -namespace Lieb.Pages.Users -{ - public class IndexModel : PageModel - { - private readonly Lieb.Data.LiebContext _context; - - public IndexModel(Lieb.Data.LiebContext context) - { - _context = context; - } - - public IList User { get;set; } - - public async Task OnGetAsync() - { - User = await _context.LiebUsers.ToListAsync(); - } - } -}