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

            db.GENREs.Remove(gENREs);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "ID,NAME")] GENREs gENREs)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gENREs).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(gENREs));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "ID,NAME")] GENREs gENREs)
        {
            if (ModelState.IsValid)
            {
                db.GENREs.Add(gENREs);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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