|
@@ -11,113 +11,113 @@ using CD67.ModeleMVC.Factory;
|
|
|
|
|
|
|
|
namespace CD67.ModeleMVC.MVC.Controllers
|
|
namespace CD67.ModeleMVC.MVC.Controllers
|
|
|
{
|
|
{
|
|
|
- public class PARAMsController : Controller
|
|
|
|
|
|
|
+ public class TYPE_VIKINGController : Controller
|
|
|
{
|
|
{
|
|
|
private Entities db = new Entities();
|
|
private Entities db = new Entities();
|
|
|
|
|
|
|
|
- // GET: PARAMs
|
|
|
|
|
|
|
+ // GET: TYPE_VIKING
|
|
|
public ActionResult Index()
|
|
public ActionResult Index()
|
|
|
{
|
|
{
|
|
|
- PARAMFactory paramFactory = new PARAMFactory(db);
|
|
|
|
|
- return View(paramFactory.getAll());
|
|
|
|
|
|
|
+ TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
|
|
|
|
|
+ return View(typeVikingFactory.getAll());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // GET: PARAMs/Details/5
|
|
|
|
|
- public ActionResult Details(string id)
|
|
|
|
|
|
|
+ // GET: TYPE_VIKING/Details/5
|
|
|
|
|
+ public ActionResult Details(int? id)
|
|
|
{
|
|
{
|
|
|
if (id == null)
|
|
if (id == null)
|
|
|
{
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
}
|
|
|
- PARAMFactory paramFactory = new PARAMFactory(db);
|
|
|
|
|
- PARAM param = paramFactory.getById(id);
|
|
|
|
|
- if (param == null)
|
|
|
|
|
|
|
+ TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
|
|
|
|
|
+ EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id.Value);
|
|
|
|
|
+ if (typeViking == null)
|
|
|
{
|
|
{
|
|
|
return HttpNotFound();
|
|
return HttpNotFound();
|
|
|
}
|
|
}
|
|
|
- return View(param);
|
|
|
|
|
|
|
+ return View(typeViking);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // GET: PARAMs/Create
|
|
|
|
|
|
|
+ // GET: TYPE_VIKING/Create
|
|
|
public ActionResult Create()
|
|
public ActionResult Create()
|
|
|
{
|
|
{
|
|
|
- PARAM param = new PARAM();
|
|
|
|
|
- return View(param);
|
|
|
|
|
|
|
+ EXEMPLE_TYPE_VIKING typeViking = new EXEMPLE_TYPE_VIKING();
|
|
|
|
|
+ return View(typeViking);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // POST: PARAMs/Create
|
|
|
|
|
|
|
+ // POST: TYPE_VIKING/Create
|
|
|
// Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour
|
|
// Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour
|
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
|
[HttpPost]
|
|
[HttpPost]
|
|
|
[ValidateAntiForgeryToken]
|
|
[ValidateAntiForgeryToken]
|
|
|
- public ActionResult Create([Bind(Include = "PRM_CLE,PRM_LIB1,PRM_LIB2")] PARAM param)
|
|
|
|
|
|
|
+ public ActionResult Create([Bind(Include = "ID,TYPE")] EXEMPLE_TYPE_VIKING typeViking)
|
|
|
{
|
|
{
|
|
|
if (ModelState.IsValid)
|
|
if (ModelState.IsValid)
|
|
|
{
|
|
{
|
|
|
- PARAMFactory paramFactory = new PARAMFactory(db);
|
|
|
|
|
- paramFactory.add(ref param);
|
|
|
|
|
|
|
+ TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
|
|
|
|
|
+ typeVikingFactory.add(ref typeViking);
|
|
|
return RedirectToAction("Index");
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return View(param);
|
|
|
|
|
|
|
+ return View(typeViking);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // GET: PARAMs/Edit/5
|
|
|
|
|
- public ActionResult Edit(string id)
|
|
|
|
|
|
|
+ // GET: TYPE_VIKING/Edit/5
|
|
|
|
|
+ public ActionResult Edit(int? id)
|
|
|
{
|
|
{
|
|
|
if (id == null)
|
|
if (id == null)
|
|
|
{
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
}
|
|
|
- PARAMFactory paramFactory = new PARAMFactory(db);
|
|
|
|
|
- PARAM param = paramFactory.getById(id);
|
|
|
|
|
- if (param == null)
|
|
|
|
|
|
|
+ TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
|
|
|
|
|
+ EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id.Value);
|
|
|
|
|
+ if (typeViking == null)
|
|
|
{
|
|
{
|
|
|
return HttpNotFound();
|
|
return HttpNotFound();
|
|
|
}
|
|
}
|
|
|
- return View(param);
|
|
|
|
|
|
|
+ return View(typeViking);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // POST: PARAMs/Edit/5
|
|
|
|
|
|
|
+ // POST: TYPE_VIKING/Edit/5
|
|
|
// Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour
|
|
// Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour
|
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
// plus de détails, voir http://go.microsoft.com/fwlink/?LinkId=317598.
|
|
|
[HttpPost]
|
|
[HttpPost]
|
|
|
[ValidateAntiForgeryToken]
|
|
[ValidateAntiForgeryToken]
|
|
|
- public ActionResult Edit([Bind(Include = "PRM_CLE,PRM_LIB1,PRM_LIB2")] PARAM param)
|
|
|
|
|
|
|
+ public ActionResult Edit([Bind(Include = "ID,TYPE")] EXEMPLE_TYPE_VIKING typeViking)
|
|
|
{
|
|
{
|
|
|
if (ModelState.IsValid)
|
|
if (ModelState.IsValid)
|
|
|
{
|
|
{
|
|
|
- PARAMFactory paramFactory = new PARAMFactory(db);
|
|
|
|
|
- paramFactory.update(ref param);
|
|
|
|
|
|
|
+ TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
|
|
|
|
|
+ typeVikingFactory.update(ref typeViking);
|
|
|
return RedirectToAction("Index");
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
}
|
|
|
- return View(param);
|
|
|
|
|
|
|
+ return View(typeViking);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // GET: PARAMs/Delete/5
|
|
|
|
|
- public ActionResult Delete(string id)
|
|
|
|
|
|
|
+ // GET: TYPE_VIKING/Delete/5
|
|
|
|
|
+ public ActionResult Delete(int? id)
|
|
|
{
|
|
{
|
|
|
if (id == null)
|
|
if (id == null)
|
|
|
{
|
|
{
|
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
|
|
}
|
|
}
|
|
|
- PARAMFactory paramFactory = new PARAMFactory(db);
|
|
|
|
|
- PARAM param = paramFactory.getById(id);
|
|
|
|
|
- if (param == null)
|
|
|
|
|
|
|
+ TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
|
|
|
|
|
+ EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id.Value);
|
|
|
|
|
+ if (typeViking == null)
|
|
|
{
|
|
{
|
|
|
return HttpNotFound();
|
|
return HttpNotFound();
|
|
|
}
|
|
}
|
|
|
- return View(param);
|
|
|
|
|
|
|
+ return View(typeViking);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // POST: PARAMs/Delete/5
|
|
|
|
|
|
|
+ // POST: TYPE_VIKING/Delete/5
|
|
|
[HttpPost, ActionName("Delete")]
|
|
[HttpPost, ActionName("Delete")]
|
|
|
[ValidateAntiForgeryToken]
|
|
[ValidateAntiForgeryToken]
|
|
|
- public ActionResult DeleteConfirmed(string id)
|
|
|
|
|
|
|
+ public ActionResult DeleteConfirmed(int id)
|
|
|
{
|
|
{
|
|
|
- PARAMFactory paramFactory = new PARAMFactory(db);
|
|
|
|
|
- PARAM param = paramFactory.getById(id);
|
|
|
|
|
- paramFactory.delete(ref param);
|
|
|
|
|
|
|
+ TYPE_VIKINGFactory typeVikingFactory = new TYPE_VIKINGFactory(db);
|
|
|
|
|
+ EXEMPLE_TYPE_VIKING typeViking = typeVikingFactory.getById(id);
|
|
|
|
|
+ typeVikingFactory.delete(ref typeViking);
|
|
|
return RedirectToAction("Index");
|
|
return RedirectToAction("Index");
|
|
|
}
|
|
}
|
|
|
|
|
|