예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_colour tbl_colour = db.tbl_colour.Find(id);

            db.tbl_colour.Remove(tbl_colour);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "colID,colour")] tbl_colour tbl_colour)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_colour).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_colour));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "colID,colour")] tbl_colour tbl_colour)
        {
            if (ModelState.IsValid)
            {
                db.tbl_colour.Add(tbl_colour);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbl_colour));
        }
예제 #4
0
        // GET: colour/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_colour tbl_colour = db.tbl_colour.Find(id);

            if (tbl_colour == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_colour));
        }