Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            fibre fibre = db.fibres.Find(id);

            db.fibres.Remove(fibre);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "FiberId,Name,Category,Picture1,Description,Advantages,Disadvantages,Picture2")] fibre fibre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fibre).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fibre));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "FiberId,Name,Category,Picture1,Description,Advantages,Disadvantages,Picture2")] fibre fibre)
        {
            if (ModelState.IsValid)
            {
                db.fibres.Add(fibre);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fibre));
        }
Exemple #4
0
        // GET: Home/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            fibre fibre = db.fibres.Find(id);

            if (fibre == null)
            {
                return(HttpNotFound());
            }
            return(View(fibre));
        }