new settings
parent
9f2a74338c
commit
5746694b38
@ -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.Musical.Profiles;
|
||||||
|
|
||||||
|
namespace Yavsc.Controllers
|
||||||
|
{
|
||||||
|
public class DjSettingsController : Controller
|
||||||
|
{
|
||||||
|
private ApplicationDbContext _context;
|
||||||
|
|
||||||
|
public DjSettingsController(ApplicationDbContext context)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: DjSettings
|
||||||
|
public async Task<IActionResult> Index()
|
||||||
|
{
|
||||||
|
return View(await _context.DjSettings.ToListAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: DjSettings/Details/5
|
||||||
|
public async Task<IActionResult> Details(string id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
if (djSettings == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(djSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: DjSettings/Create
|
||||||
|
public IActionResult Create()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: DjSettings/Create
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<IActionResult> Create(DjSettings djSettings)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
_context.DjSettings.Add(djSettings);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
return View(djSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: DjSettings/Edit/5
|
||||||
|
public async Task<IActionResult> Edit(string id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
if (djSettings == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(djSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: DjSettings/Edit/5
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<IActionResult> Edit(DjSettings djSettings)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
_context.Update(djSettings);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
return View(djSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: DjSettings/Delete/5
|
||||||
|
[ActionName("Delete")]
|
||||||
|
public async Task<IActionResult> Delete(string id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
if (djSettings == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(djSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: DjSettings/Delete/5
|
||||||
|
[HttpPost, ActionName("Delete")]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||||
|
{
|
||||||
|
DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
_context.DjSettings.Remove(djSettings);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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.Musical.Profiles;
|
||||||
|
|
||||||
|
namespace Yavsc.Controllers
|
||||||
|
{
|
||||||
|
public class GeneralSettingsController : Controller
|
||||||
|
{
|
||||||
|
private ApplicationDbContext _context;
|
||||||
|
|
||||||
|
public GeneralSettingsController(ApplicationDbContext context)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: GeneralSettings
|
||||||
|
public async Task<IActionResult> Index()
|
||||||
|
{
|
||||||
|
return View(await _context.GeneralSettings.ToListAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: GeneralSettings/Details/5
|
||||||
|
public async Task<IActionResult> Details(string id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
if (generalSettings == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(generalSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: GeneralSettings/Create
|
||||||
|
public IActionResult Create()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: GeneralSettings/Create
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<IActionResult> Create(GeneralSettings generalSettings)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
_context.GeneralSettings.Add(generalSettings);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
return View(generalSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: GeneralSettings/Edit/5
|
||||||
|
public async Task<IActionResult> Edit(string id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
if (generalSettings == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
return View(generalSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: GeneralSettings/Edit/5
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<IActionResult> Edit(GeneralSettings generalSettings)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
_context.Update(generalSettings);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
return View(generalSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: GeneralSettings/Delete/5
|
||||||
|
[ActionName("Delete")]
|
||||||
|
public async Task<IActionResult> Delete(string id)
|
||||||
|
{
|
||||||
|
if (id == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
if (generalSettings == null)
|
||||||
|
{
|
||||||
|
return HttpNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(generalSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST: GeneralSettings/Delete/5
|
||||||
|
[HttpPost, ActionName("Delete")]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
|
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||||
|
{
|
||||||
|
GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
|
||||||
|
_context.GeneralSettings.Remove(generalSettings);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return RedirectToAction("Index");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Create";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Create</h2>
|
||||||
|
|
||||||
|
<form asp-action="Create">
|
||||||
|
<div class="form-horizontal">
|
||||||
|
<h4>DjSettings</h4>
|
||||||
|
<hr />
|
||||||
|
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="SoundCloudId" class="col-md-2 control-label"></label>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<input asp-for="SoundCloudId" class="form-control" />
|
||||||
|
<span asp-validation-for="SoundCloudId" class="text-danger" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-md-offset-2 col-md-10">
|
||||||
|
<input type="submit" value="Create" class="btn btn-default" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<a asp-action="Index">Back to List</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Delete";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Delete</h2>
|
||||||
|
|
||||||
|
<h3>Are you sure you want to delete this?</h3>
|
||||||
|
<div>
|
||||||
|
<h4>DjSettings</h4>
|
||||||
|
<hr />
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>
|
||||||
|
@Html.DisplayNameFor(model => model.SoundCloudId)
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.SoundCloudId)
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<form asp-action="Delete">
|
||||||
|
<div class="form-actions no-color">
|
||||||
|
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||||
|
<a asp-action="Index">Back to List</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Details";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Details</h2>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4>DjSettings</h4>
|
||||||
|
<hr />
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt>
|
||||||
|
@Html.DisplayNameFor(model => model.SoundCloudId)
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
@Html.DisplayFor(model => model.SoundCloudId)
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<a asp-action="Edit" asp-route-id="@Model.UserId">Edit</a> |
|
||||||
|
<a asp-action="Index">Back to List</a>
|
||||||
|
</p>
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
@model Yavsc.Models.Musical.Profiles.DjSettings
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Edit</h2>
|
||||||
|
|
||||||
|
<form asp-action="Edit">
|
||||||
|
<div class="form-horizontal">
|
||||||
|
<h4>DjSettings</h4>
|
||||||
|
<hr />
|
||||||
|
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||||
|
<input type="hidden" asp-for="UserId" />
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="SoundCloudId" class="col-md-2 control-label"></label>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<input asp-for="SoundCloudId" class="form-control" />
|
||||||
|
<span asp-validation-for="SoundCloudId" class="text-danger" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-md-offset-2 col-md-10">
|
||||||
|
<input type="submit" value="Save" class="btn btn-default" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<a asp-action="Index">Back to List</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
@model IEnumerable<Yavsc.Models.Musical.Profiles.DjSettings>
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Index";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Index</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a asp-action="Create">Create New</a>
|
||||||
|
</p>
|
||||||
|
<table class="table">
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.SoundCloudId)
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@foreach (var item in Model) {
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.SoundCloudId)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a asp-action="Edit" asp-route-id="@item.UserId">Edit</a> |
|
||||||
|
<a asp-action="Details" asp-route-id="@item.UserId">Details</a> |
|
||||||
|
<a asp-action="Delete" asp-route-id="@item.UserId">Delete</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</table>
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
@model Yavsc.Models.Musical.Profiles.GeneralSettings
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Delete";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Delete</h2>
|
||||||
|
|
||||||
|
<h3>Are you sure you want to delete this?</h3>
|
||||||
|
<div>
|
||||||
|
<h4>GeneralSettings</h4>
|
||||||
|
<hr />
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<form asp-action="Delete">
|
||||||
|
<div class="form-actions no-color">
|
||||||
|
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||||
|
<a asp-action="Index">Back to List</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
@model Yavsc.Models.Musical.Profiles.GeneralSettings
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Edit</h2>
|
||||||
|
|
||||||
|
<form asp-action="Edit">
|
||||||
|
<div class="form-horizontal">
|
||||||
|
<h4>GeneralSettings</h4>
|
||||||
|
<hr />
|
||||||
|
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||||
|
<input type="hidden" asp-for="UserId" />
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-md-offset-2 col-md-10">
|
||||||
|
<input type="submit" value="Save" class="btn btn-default" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<a asp-action="Index">Back to List</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
@model Yavsc.Models.Musical.Profiles.GeneralSettings
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Details";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h2>Details</h2>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4>GeneralSettings</h4>
|
||||||
|
<hr />
|
||||||
|
@if (Model!=null) {
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
</dl>
|
||||||
|
<p>
|
||||||
|
<a asp-action="Delete" asp-route-id="@Model.UserId">@SR["Delete"]</a>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
<p>
|
||||||
|
@SR["Aucun profile renseigné"]
|
||||||
|
<a asp-action="Create" class="btn btn-success">@SR["Renseigner ce paramêtrage"]</a>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
Loading…
Reference in New Issue