コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            p_publication p_publication = db.p_publication.Find(id);

            db.p_publication.Remove(p_publication);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "publication_id,volume_number,published_date,magazine_id")] p_publication p_publication)
 {
     if (ModelState.IsValid)
     {
         db.Entry(p_publication).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.magazine_id = new SelectList(db.p_magazine, "magazine_id", "magazine_name", p_publication.magazine_id);
     return(View(p_publication));
 }
コード例 #3
0
        // GET: p_publication/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            p_publication p_publication = db.p_publication.Find(id);

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

            if (p_publication == null)
            {
                return(HttpNotFound());
            }
            ViewBag.magazine_id = new SelectList(db.p_magazine, "magazine_id", "magazine_name", p_publication.magazine_id);
            return(View(p_publication));
        }