public ActionResult DeleteConfirmed(int id) { AboutDescription aboutDescription = db.AboutDescriptions.Find(id); db.AboutDescriptions.Remove(aboutDescription); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Admin/AboutDescriptions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AboutDescription aboutDescription = db.AboutDescriptions.Find(id); if (aboutDescription == null) { return(HttpNotFound()); } return(View(aboutDescription)); }
public ActionResult Create([Bind(Include = "AboutID,Image,Title,Description")] AboutDescription aboutDescription, HttpPostedFileBase imgUp) { if (ModelState.IsValid) { if (imgUp != null) { aboutDescription.Image = Guid.NewGuid().ToString() + Path.GetExtension(imgUp.FileName); imgUp.SaveAs(Server.MapPath("/Images/AboutImages/" + aboutDescription.Image)); } teamAboutRepository.InsertAbout(aboutDescription); teamAboutRepository.Save(); return(RedirectToAction("Index")); } return(View(aboutDescription)); }