Esempio n. 1
0
        public ActionResult Create(Costume costume)
        {
            //Check if model is valid, then add Costume to table and save changes to Database
            if (ModelState.IsValid)
            {
                db.Costumes.Add(costume);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(costume);
        }
Esempio n. 2
0
 public ActionResult Edit(Costume costume)
 {
     //Check if model is valid, then edit the data in the table and save changes to Database
     if (ModelState.IsValid)
     {
         db.Entry(costume).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(costume);
 }