Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            VikingFactory vikingsFactory = new VikingFactory(db);
            Viking        viking         = vikingsFactory.GetById(id);

            vikingsFactory.Delete(ref viking);

            // Ajout d'un message flash
            this.Success("Viking supprimé avec succès.");

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        // GET: Viking/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            VikingFactory vikingsFactory = new VikingFactory(db);
            Viking        viking         = vikingsFactory.GetById(id.Value);

            if (viking == null)
            {
                return(HttpNotFound());
            }
            return(View(viking));
        }
Exemplo n.º 3
0
        // GET: Viking/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ViewBag.ListeTypesViking = getListeTypesViking(string.Empty);

            VikingFactory vikingsFactory = new VikingFactory(db);
            Viking        viking         = vikingsFactory.GetById(id.Value);

            if (viking == null)
            {
                return(HttpNotFound());
            }
            FillSelect(viking);
            return(View(viking));
        }