public ActionResult DeleteConfirmed(int id)
        {
            MyWorksDiv myWorksDiv = db.MyWorksDiv.Find(id);

            db.MyWorksDiv.Remove(myWorksDiv);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,Photo,Title,CategoryID")] MyWorksDiv myWorksDiv)
 {
     if (ModelState.IsValid)
     {
         db.Entry(myWorksDiv).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.CategoryWork, "ID", "Name", myWorksDiv.CategoryID);
     return(View(myWorksDiv));
 }
        public ActionResult Create([Bind(Include = "ID,Photo,Title,CategoryID")] MyWorksDiv myWorksDiv)
        {
            if (ModelState.IsValid)
            {
                db.MyWorksDiv.Add(myWorksDiv);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CategoryID = new SelectList(db.CategoryWork, "ID", "Name", myWorksDiv.CategoryID);
            return(View(myWorksDiv));
        }
        // GET: Portfoliom/MyWorksDivs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyWorksDiv myWorksDiv = db.MyWorksDiv.Find(id);

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

            if (myWorksDiv == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CategoryID = new SelectList(db.CategoryWork, "ID", "Name", myWorksDiv.CategoryID);
            return(View(myWorksDiv));
        }