public ActionResult DeleteConfirmed(int id)
        {
            Table_Colors table_colors = db.Table_Colors.Find(id);

            db.Table_Colors.Remove(table_colors);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "c_name,c_id,category_id")] Table_Colors table_colors)
 {
     if (ModelState.IsValid)
     {
         db.Entry(table_colors).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.category_id = new SelectList(db.Table_Category, "category_id", "category_name", table_colors.category_id);
     return(View(table_colors));
 }
        // GET: /Colors/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Table_Colors table_colors = db.Table_Colors.Find(id);

            if (table_colors == null)
            {
                return(HttpNotFound());
            }
            return(View(table_colors));
        }
        // GET: /Colors/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Table_Colors table_colors = db.Table_Colors.Find(id);

            if (table_colors == null)
            {
                return(HttpNotFound());
            }
            ViewBag.category_id = new SelectList(db.Table_Category, "category_id", "category_name", table_colors.category_id);
            return(View(table_colors));
        }