Esempio n. 1
0
 public ActionResult DeleteConfirmed(int id)
 {
     PFTApp.Models.Attribute attribute = db.Attributes.Find(id);
     db.Attributes.Remove(attribute);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Esempio n. 2
0
        //
        // GET: /Attribute/Delete/5

        public ActionResult Delete(int id = 0)
        {
            PFTApp.Models.Attribute attribute = db.Attributes.Find(id);
            if (attribute == null)
            {
                return(HttpNotFound());
            }
            return(View(attribute));
        }
Esempio n. 3
0
 public ActionResult Edit(PFTApp.Models.Attribute attribute)
 {
     if (ModelState.IsValid)
     {
         db.Entry(attribute).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(attribute));
 }
Esempio n. 4
0
        public ActionResult Create(PFTApp.Models.Attribute attribute)
        {
            if (ModelState.IsValid)
            {
                db.Attributes.Add(attribute);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(attribute));
        }