Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            arme arme = db.arme.Find(id);

            db.arme.Remove(arme);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "id_arme,label,poids,id_categorie_arme")] arme arme)
 {
     if (ModelState.IsValid)
     {
         db.Entry(arme).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_categorie_arme = new SelectList(db.categorie_arme, "id_categorie_arme", "categorie_arme1", arme.id_categorie_arme);
     return(View(arme));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "id_arme,label,poids,id_categorie_arme")] arme arme)
        {
            if (ModelState.IsValid)
            {
                db.arme.Add(arme);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.id_categorie_arme = new SelectList(db.categorie_arme, "id_categorie_arme", "categorie_arme1", arme.id_categorie_arme);
            return(View(arme));
        }
Example #4
0
        // GET: Arme/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            arme arme = db.arme.Find(id);

            if (arme == null)
            {
                return(HttpNotFound());
            }
            return(View(arme));
        }
Example #5
0
        // GET: Arme/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            arme arme = db.arme.Find(id);

            if (arme == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_categorie_arme = new SelectList(db.categorie_arme, "id_categorie_arme", "categorie_arme1", arme.id_categorie_arme);
            return(View(arme));
        }
Example #6
0
 /**
  * Fonction d'initialisation de la référence de l'arme
  * @param void
  * @return void
  */
 void Start()
 {
     armeRef = transform.GetChild(3).GetComponent <arme>();
 }