public ActionResult DeleteConfirmed(int id) { AgricultureSpecialist agricultureSpecialist = db.AgricultureSpecialists.Find(id); db.AgricultureSpecialists.Remove(agricultureSpecialist); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Organization,Rates,Name,Email,MobileNumber,CityId,CreatedDate")] AgricultureSpecialist agricultureSpecialist) { if (ModelState.IsValid) { db.Entry(agricultureSpecialist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CityId = new SelectList(db.Cities, "Id", "Name", agricultureSpecialist.CityId); return(View(agricultureSpecialist)); }
// GET: AgricultureSpecialists/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AgricultureSpecialist agricultureSpecialist = db.AgricultureSpecialists.Find(id); if (agricultureSpecialist == null) { return(HttpNotFound()); } return(View(agricultureSpecialist)); }
// GET: AgricultureSpecialists/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AgricultureSpecialist agricultureSpecialist = db.AgricultureSpecialists.Find(id); if (agricultureSpecialist == null) { return(HttpNotFound()); } ViewBag.CityId = new SelectList(db.Cities, "Id", "Name", agricultureSpecialist.CityId); return(View(agricultureSpecialist)); }