From ec2c405e28e09aad2fd3079f912f0c4f7ad20418 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 31 Aug 2026 03:09:49 +0100 Subject: [PATCH] code cleanup --- .../Contracting/FormsController.cs | 120 ------------------ .../Models/ApplicationDbContext.cs | 3 - src/Yavsc.Server/Models/Forms/Form.cs | 12 -- .../FrontOffice/PerformerProfileViewModel.cs | 3 +- 4 files changed, 1 insertion(+), 137 deletions(-) delete mode 100644 src/Yavsc.Org/Controllers/Contracting/FormsController.cs delete mode 100644 src/Yavsc.Server/Models/Forms/Form.cs diff --git a/src/Yavsc.Org/Controllers/Contracting/FormsController.cs b/src/Yavsc.Org/Controllers/Contracting/FormsController.cs deleted file mode 100644 index 423cf2f4..00000000 --- a/src/Yavsc.Org/Controllers/Contracting/FormsController.cs +++ /dev/null @@ -1,120 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Yavsc.Models; -using Yavsc.Models.Forms; -using Yavsc.Server.Helpers; - -namespace Yavsc.Controllers -{ - public class FormsController : Controller - { - private readonly ApplicationDbContext _context; - - public FormsController(ApplicationDbContext context) - { - _context = context; - } - - // GET: Forms - public async Task Index() - { - return View(await _context.Form.ToListAsync()); - } - - // GET: Forms/Details/5 - public async Task Details(string id) - { - if (id == null) - { - return NotFound(); - } - - Form form = await _context.Form.SingleAsync(m => m.Id == id); - if (form == null) - { - return NotFound(); - } - - return View(form); - } - - // GET: Forms/Create - public IActionResult Create() - { - return View(); - } - - // POST: Forms/Create - [HttpPost] - [ValidateAntiForgeryToken] - public async Task Create(Form form) - { - if (ModelState.IsValid) - { - _context.Form.Add(form); - await _context.SaveChangesAsync(User.GetUserId()); - return RedirectToAction("Index"); - } - return View(form); - } - - // GET: Forms/Edit/5 - public async Task Edit(string id) - { - if (id == null) - { - return NotFound(); - } - - Form form = await _context.Form.SingleAsync(m => m.Id == id); - if (form == null) - { - return NotFound(); - } - return View(form); - } - - // POST: Forms/Edit/5 - [HttpPost] - [ValidateAntiForgeryToken] - public async Task Edit(Form form) - { - if (ModelState.IsValid) - { - _context.Update(form); - await _context.SaveChangesAsync(User.GetUserId()); - return RedirectToAction("Index"); - } - return View(form); - } - - // GET: Forms/Delete/5 - [ActionName("Delete")] - public async Task Delete(string id) - { - if (id == null) - { - return NotFound(); - } - - Form form = await _context.Form.SingleAsync(m => m.Id == id); - if (form == null) - { - return NotFound(); - } - - return View(form); - } - - // POST: Forms/Delete/5 - [HttpPost, ActionName("Delete")] - [ValidateAntiForgeryToken] - public async Task DeleteConfirmed(string id) - { - Form form = await _context.Form.SingleAsync(m => m.Id == id); - _context.Form.Remove(form); - await _context.SaveChangesAsync(User.GetUserId()); - return RedirectToAction("Index"); - } - } -} diff --git a/src/Yavsc.Server/Models/ApplicationDbContext.cs b/src/Yavsc.Server/Models/ApplicationDbContext.cs index 0ddab58e..7bb5ed18 100644 --- a/src/Yavsc.Server/Models/ApplicationDbContext.cs +++ b/src/Yavsc.Server/Models/ApplicationDbContext.cs @@ -13,7 +13,6 @@ namespace Yavsc.Models using Blog; using Chat; using Drawing; - using Forms; using Haircut; using Identity; using IT.Evolution; @@ -352,8 +351,6 @@ namespace Yavsc.Models public DbSet CommandForm { get; set; } - public DbSet
Form { get; set; } - public DbSet Ban { get; set; } public DbSet HairTaint { get; set; } diff --git a/src/Yavsc.Server/Models/Forms/Form.cs b/src/Yavsc.Server/Models/Forms/Form.cs deleted file mode 100644 index eb6da137..00000000 --- a/src/Yavsc.Server/Models/Forms/Form.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Yavsc.Models.Forms -{ - - public class Form - { - [Key] - public string Id {get; set;} - public string Summary { get; set; } - } -} diff --git a/src/Yavsc.Server/ViewModels/FrontOffice/PerformerProfileViewModel.cs b/src/Yavsc.Server/ViewModels/FrontOffice/PerformerProfileViewModel.cs index d2a23319..7d8cfa9e 100644 --- a/src/Yavsc.Server/ViewModels/FrontOffice/PerformerProfileViewModel.cs +++ b/src/Yavsc.Server/ViewModels/FrontOffice/PerformerProfileViewModel.cs @@ -30,8 +30,7 @@ namespace Yavsc.ViewModels.FrontOffice Settings = settings; WebSite = profile.WebSite; Extra = profile.Activity.Where(a => a.DoesCode != activityCode).ToArray(); - } } -} \ No newline at end of file +}