示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblRanking tblRanking = db.tblRanking.Find(id);

            db.tblRanking.Remove(tblRanking);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "RankingID,SongID,RankingPosition,RankingYear")] tblRanking tblRanking)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblRanking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SongID = new SelectList(db.tblSongs, "SongID", "SongName", tblRanking.SongID);
     return(View(tblRanking));
 }
示例#3
0
        // GET: Rankings/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblRanking tblRanking = db.tblRanking.Find(id);

            if (tblRanking == null)
            {
                return(HttpNotFound());
            }
            return(View(tblRanking));
        }
示例#4
0
        // GET: Rankings/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblRanking tblRanking = db.tblRanking.Find(id);

            if (tblRanking == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SongID = new SelectList(db.tblSongs, "SongID", "SongName", tblRanking.SongID);
            return(View(tblRanking));
        }