public ActionResult DeleteConfirmed(int id) { OurModel ourModel = db.OurModels.Find(id); db.OurModels.Remove(ourModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Title,Details,Profession,Photo,HoverPhoto,Facebook,Twitter,Instagram,Youtube,TopModel,ModelCategoryId")] OurModel ourModel) { if (ModelState.IsValid) { db.Entry(ourModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ModelCategoryId = new SelectList(db.ModelCategories, "Id", "Name", ourModel.ModelCategoryId); return(View(ourModel)); }
// GET: Admin/OurModel/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OurModel ourModel = db.OurModels.Find(id); if (ourModel == null) { return(HttpNotFound()); } return(View(ourModel)); }
// GET: Admin/OurModel/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OurModel ourModel = db.OurModels.Find(id); if (ourModel == null) { return(HttpNotFound()); } ViewBag.ModelCategoryId = new SelectList(db.ModelCategories, "Id", "Name", ourModel.ModelCategoryId); return(View(ourModel)); }