Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Wayang wayang = db.Wayangs.Find(id);

            db.Wayangs.Remove(wayang);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "WayangId,JenengWayang,GambarURL,KategoriId")] Wayang wayang)
 {
     if (ModelState.IsValid)
     {
         db.Entry(wayang).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.KategoriId = new SelectList(db.Kategoris, "KategoriId", "Jenis", wayang.KategoriId);
     return(View(wayang));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "WayangId,JenengWayang,GambarURL,KategoriId")] Wayang wayang)
        {
            if (ModelState.IsValid)
            {
                db.Wayangs.Add(wayang);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.KategoriId = new SelectList(db.Kategoris, "KategoriId", "Jenis", wayang.KategoriId);
            return(View(wayang));
        }
Exemple #4
0
        // GET: /Wayang/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Wayang wayang = db.Wayangs.Find(id);

            if (wayang == null)
            {
                return(HttpNotFound());
            }
            return(View(wayang));
        }
Exemple #5
0
        // GET: /Wayang/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Wayang wayang = db.Wayangs.Find(id);

            if (wayang == null)
            {
                return(HttpNotFound());
            }
            ViewBag.KategoriId = new SelectList(db.Kategoris, "KategoriId", "Jenis", wayang.KategoriId);
            return(View(wayang));
        }