Merge branch 'vnext' of https://github.com/pazof/yavsc into vnext
* 'vnext' of https://github.com/pazof/yavsc: (38 commits) fixe le premier démarrage Corrige le mot de passe perdu d'un utilisateur au nom contenant des espaces traductions fixe la reccupération du mot de passe refabrique: MEP index blogs Specialized the book query notification Updated the Licence validity cleaned up log warnings label event date cleans the code Adds support for SIREN exceptions to validation from the external provider layout trads refactoring refactoring Google maps: a map image implements an AccessDenied page A better layout ... # Conflicts: # Yavsc.Api/project.lock.json # Yavsc.Client/Yavsc.Client.csproj # Yavsc.Client/packages.config # sendmsg/Program.cs
This commit is contained in:
commit
e3a73e8146
190 changed files with 6664 additions and 763 deletions
121
Yavsc/Controllers/SIRENExceptionsController.cs
Normal file
121
Yavsc/Controllers/SIRENExceptionsController.cs
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
using System.Linq;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
[Authorize(Roles="Administrator")]
|
||||
public class SIRENExceptionsController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public SIRENExceptionsController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: SIRENExceptions
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View(_context.ExceptionsSIREN.ToList());
|
||||
}
|
||||
|
||||
// GET: SIRENExceptions/Details/5
|
||||
public IActionResult Details(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
ExceptionSIREN exceptionSIREN = _context.ExceptionsSIREN.Single(m => m.SIREN == id);
|
||||
if (exceptionSIREN == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(exceptionSIREN);
|
||||
}
|
||||
|
||||
// GET: SIRENExceptions/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: SIRENExceptions/Create
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public IActionResult Create(ExceptionSIREN exceptionSIREN)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.ExceptionsSIREN.Add(exceptionSIREN);
|
||||
_context.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(exceptionSIREN);
|
||||
}
|
||||
|
||||
// GET: SIRENExceptions/Edit/5
|
||||
public IActionResult Edit(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
ExceptionSIREN exceptionSIREN = _context.ExceptionsSIREN.Single(m => m.SIREN == id);
|
||||
if (exceptionSIREN == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return View(exceptionSIREN);
|
||||
}
|
||||
|
||||
// POST: SIRENExceptions/Edit/5
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public IActionResult Edit(ExceptionSIREN exceptionSIREN)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(exceptionSIREN);
|
||||
_context.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(exceptionSIREN);
|
||||
}
|
||||
|
||||
// GET: SIRENExceptions/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public IActionResult Delete(string id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
ExceptionSIREN exceptionSIREN = _context.ExceptionsSIREN.Single(m => m.SIREN == id);
|
||||
if (exceptionSIREN == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(exceptionSIREN);
|
||||
}
|
||||
|
||||
// POST: SIRENExceptions/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public IActionResult DeleteConfirmed(string id)
|
||||
{
|
||||
ExceptionSIREN exceptionSIREN = _context.ExceptionsSIREN.Single(m => m.SIREN == id);
|
||||
_context.ExceptionsSIREN.Remove(exceptionSIREN);
|
||||
_context.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue