Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            RecycleType recycleType = db.RecycleTypes.Find(id);

            db.RecycleTypes.Remove(recycleType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Points")] RecycleType recycleType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(recycleType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(recycleType));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Name,Points")] RecycleType recycleType)
        {
            if (ModelState.IsValid)
            {
                db.RecycleTypes.Add(recycleType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(recycleType));
        }
Exemplo n.º 4
0
        // GET: RecycleTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RecycleType recycleType = db.RecycleTypes.Find(id);

            if (recycleType == null)
            {
                return(HttpNotFound());
            }
            return(View(recycleType));
        }
Exemplo n.º 5
0
 public void Set(RecycleType type)
 {
     image.sprite = type.image;
 }