Пример #1
0
        public ActionResult DeleteConfirmed(short id)
        {
            Riviste riviste = db.Riviste.Find(id);

            db.Riviste.Remove(riviste);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult DeleteRiviste(int AnnoP, int CodP, string CodRiv)
        {
            Riviste riviste = db.Riviste.Find(AnnoP, CodP, CodRiv);

            db.Riviste.Remove(riviste);
            db.SaveChanges();
            UpdateDovuto(AnnoP, CodP);
            return(RedirectToAction("Edit", new { codp = riviste.CodP, annop = riviste.AnnoP }));
        }
Пример #3
0
 public ActionResult Edit([Bind(Include = "AnnoP,CodP,CodRiv,Ncopie")] Riviste riviste)
 {
     if (ModelState.IsValid)
     {
         db.Entry(riviste).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CodP  = new SelectList(db.Pag, "CodP", "Tiscr", riviste.CodP);
     ViewBag.AnnoP = new SelectList(db.TabRiv, "AnnoRiv", "NCodRiv", riviste.AnnoP);
     return(View(riviste));
 }
Пример #4
0
        // GET: Riviste/Details/5
        public ActionResult Details(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Riviste riviste = db.Riviste.Find(id);

            if (riviste == null)
            {
                return(HttpNotFound());
            }
            return(View(riviste));
        }
Пример #5
0
        public ActionResult CreateRiviste([Bind(Include = "AnnoP,CodP,CodRiv,Ncopie")] Riviste riviste)
        {
            if (ModelState.IsValid)
            {
                db.Riviste.Add(riviste);
                db.SaveChanges();
                UpdateDovuto(riviste.AnnoP, riviste.CodP);
                return(RedirectToAction("Edit", new { codp = riviste.CodP, annop = riviste.AnnoP }));
            }

            ViewBag.CodP  = new SelectList(db.Pag, "CodP", "Tiscr", riviste.CodP);
            ViewBag.AnnoP = new SelectList(db.TabRiv, "AnnoRiv", "NCodRiv", riviste.AnnoP);
            return(RedirectToAction("Edit", new { codp = riviste.CodP, annop = riviste.AnnoP }));
        }
Пример #6
0
        // GET: Riviste/Edit/5
        public ActionResult Edit(short?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Riviste riviste = db.Riviste.Find(id);

            if (riviste == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CodP  = new SelectList(db.Pag, "CodP", "Tiscr", riviste.CodP);
            ViewBag.AnnoP = new SelectList(db.TabRiv, "AnnoRiv", "NCodRiv", riviste.AnnoP);
            return(View(riviste));
        }