public ActionResult DeleteConfirmed(int id)
        {
            BandCD bandCD = db.BandCDs.Find(id);

            db.BandCDs.Remove(bandCD);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "BandCDId,BandName,AlbumName")] BandCD bandCD)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bandCD).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bandCD));
 }
        public ActionResult Create([Bind(Include = "BandCDId,BandName,AlbumName")] BandCD bandCD)
        {
            if (ModelState.IsValid)
            {
                db.BandCDs.Add(bandCD);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(bandCD));
        }
        /// <summary>
        /// Display details for band CD
        /// </summary>
        /// <returns>
        ///bandCD view
        /// </returns>
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BandCD bandCD = db.BandCDs.Find(id);

            if (bandCD == null)
            {
                return(HttpNotFound());
            }
            return(View(bandCD));
        }
示例#5
0
 public void Edit(BandCD bandCD)
 {
     Assert.Fail();
 }