diff --git a/Yavsc/Controllers/FormationSettingsController.cs b/Yavsc/Controllers/FormationSettingsController.cs new file mode 100644 index 00000000..2672cb49 --- /dev/null +++ b/Yavsc/Controllers/FormationSettingsController.cs @@ -0,0 +1,122 @@ +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.Data.Entity; +using Yavsc.Models; +using Yavsc.Models.Workflow.Profiles; + +namespace Yavsc.Controllers +{ + public class FormationSettingsController : Controller + { + private ApplicationDbContext _context; + + public FormationSettingsController(ApplicationDbContext context) + { + _context = context; + } + + // GET: FormationSettings + public async Task Index() + { + return View(await _context.FormationSettings.ToListAsync()); + } + + // GET: FormationSettings/Details/5 + public async Task Details(string id) + { + if (id == null) + { + return HttpNotFound(); + } + + FormationSettings formationSettings = await _context.FormationSettings.SingleAsync(m => m.UserId == id); + if (formationSettings == null) + { + return HttpNotFound(); + } + + return View(formationSettings); + } + + // GET: FormationSettings/Create + public IActionResult Create() + { + return View(); + } + + // POST: FormationSettings/Create + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Create(FormationSettings formationSettings) + { + if (ModelState.IsValid) + { + _context.FormationSettings.Add(formationSettings); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + return View(formationSettings); + } + + // GET: FormationSettings/Edit/5 + public async Task Edit(string id) + { + if (id == null) + { + return HttpNotFound(); + } + + FormationSettings formationSettings = await _context.FormationSettings.SingleAsync(m => m.UserId == id); + if (formationSettings == null) + { + return HttpNotFound(); + } + return View(formationSettings); + } + + // POST: FormationSettings/Edit/5 + [HttpPost] + [ValidateAntiForgeryToken] + public async Task Edit(FormationSettings formationSettings) + { + if (ModelState.IsValid) + { + _context.Update(formationSettings); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + return View(formationSettings); + } + + // GET: FormationSettings/Delete/5 + [ActionName("Delete")] + public async Task Delete(string id) + { + if (id == null) + { + return HttpNotFound(); + } + + FormationSettings formationSettings = await _context.FormationSettings.SingleAsync(m => m.UserId == id); + if (formationSettings == null) + { + return HttpNotFound(); + } + + return View(formationSettings); + } + + // POST: FormationSettings/Delete/5 + [HttpPost, ActionName("Delete")] + [ValidateAntiForgeryToken] + public async Task DeleteConfirmed(string id) + { + FormationSettings formationSettings = await _context.FormationSettings.SingleAsync(m => m.UserId == id); + _context.FormationSettings.Remove(formationSettings); + await _context.SaveChangesAsync(); + return RedirectToAction("Index"); + } + } +} diff --git a/Yavsc/Views/FormationSettings/Create.cshtml b/Yavsc/Views/FormationSettings/Create.cshtml new file mode 100644 index 00000000..b439d33d --- /dev/null +++ b/Yavsc/Views/FormationSettings/Create.cshtml @@ -0,0 +1,25 @@ +@model Yavsc.Models.Workflow.Profiles.FormationSettings + +@{ + ViewData["Title"] = "Create"; +} + +

Create

+ +
+
+

FormationSettings

+
+
+
+
+ +
+
+
+
+ + + diff --git a/Yavsc/Views/FormationSettings/Delete.cshtml b/Yavsc/Views/FormationSettings/Delete.cshtml new file mode 100644 index 00000000..c14f9061 --- /dev/null +++ b/Yavsc/Views/FormationSettings/Delete.cshtml @@ -0,0 +1,22 @@ +@model Yavsc.Models.Workflow.Profiles.FormationSettings + +@{ + ViewData["Title"] = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

FormationSettings

+
+
+
+ +
+
+ | + Back to List +
+
+
diff --git a/Yavsc/Views/FormationSettings/Details.cshtml b/Yavsc/Views/FormationSettings/Details.cshtml new file mode 100644 index 00000000..4581dc98 --- /dev/null +++ b/Yavsc/Views/FormationSettings/Details.cshtml @@ -0,0 +1,18 @@ +@model Yavsc.Models.Workflow.Profiles.FormationSettings + +@{ + ViewData["Title"] = "Details"; +} + +

Details

+ +
+

FormationSettings

+
+
+
+
+

+ Edit | + Back to List +

diff --git a/Yavsc/Views/FormationSettings/Edit.cshtml b/Yavsc/Views/FormationSettings/Edit.cshtml new file mode 100644 index 00000000..6cc0fa3c --- /dev/null +++ b/Yavsc/Views/FormationSettings/Edit.cshtml @@ -0,0 +1,26 @@ +@model Yavsc.Models.Workflow.Profiles.FormationSettings + +@{ + ViewData["Title"] = "Edit"; +} + +

Edit

+ +
+
+

FormationSettings

+
+
+ +
+
+ +
+
+
+
+ + + diff --git a/Yavsc/Views/FormationSettings/Index.cshtml b/Yavsc/Views/FormationSettings/Index.cshtml new file mode 100644 index 00000000..6b90a9f0 --- /dev/null +++ b/Yavsc/Views/FormationSettings/Index.cshtml @@ -0,0 +1,26 @@ +@model IEnumerable + +@{ + ViewData["Title"] = "Index"; +} + +

Index

+ +

+ Create New +

+ + + + + +@foreach (var item in Model) { + + + +} +
+ Edit | + Details | + Delete +