public ActionResult Create([Bind(Include = "Id,DisplayMember")] ChlorineLevel chlorineLevel) { if (ModelState.IsValid) { _repository.Insert(chlorineLevel); //db.ChlorineLevelSet.Add(chlorineLevel); //db.SaveChanges(); return(RedirectToAction("Index")); } return(View(chlorineLevel)); }
public ActionResult Edit([Bind(Include = "Id,DisplayMember")] ChlorineLevel chlorineLevel) { if (ModelState.IsValid) { _repository.Update(chlorineLevel); //db.Entry(chlorineLevel).State = EntityState.Modified; //db.SaveChanges(); return(RedirectToAction("Index")); } return(View(chlorineLevel)); }
// GET: ChlorineLevels/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChlorineLevel chlorineLevel = _repository.FindById(id.Value); //ChlorineLevel chlorineLevel = db.ChlorineLevelSet.Find(id); if (chlorineLevel == null) { return(HttpNotFound()); } return(View(chlorineLevel)); }