コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TypeVikingFactory typeVikingFactory = new TypeVikingFactory(db);
            TypeViking        typeViking        = typeVikingFactory.GetById(id);

            typeVikingFactory.Delete(ref typeViking);

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

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Edit([Bind(Include = "Id,Libelle")] TypeViking typeViking)
        {
            if (ModelState.IsValid)
            {
                TypeVikingFactory typeVikingFactory = new TypeVikingFactory(db);
                typeVikingFactory.Update(ref typeViking);

                // Ajout d'un message flash
                this.Success("Type de viking edité avec succès.");

                return(RedirectToAction("Index"));
            }
            return(View(typeViking));
        }
コード例 #3
0
        // GET: TypeViking/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TypeVikingFactory typeVikingFactory = new TypeVikingFactory(db);
            TypeViking        typeViking        = typeVikingFactory.GetById(id.Value);

            if (typeViking == null)
            {
                return(HttpNotFound());
            }
            return(View(typeViking));
        }
コード例 #4
0
        // GET: TypeViking/Create
        public ActionResult Create()
        {
            TypeViking typeViking = new TypeViking();

            return(View(typeViking));
        }