public ActionResult DeleteConfirmed(int id) { WeightMs weightMs = db.Weights.Find(id); db.Weights.Remove(weightMs); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Units,Date,Amount")] WeightMs weightMs) { if (ModelState.IsValid) { db.Entry(weightMs).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(weightMs)); }
public ActionResult Create([Bind(Include = "ID,Units,Date,Amount")] WeightMs weightMs) { if (ModelState.IsValid) { db.Weights.Add(weightMs); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(weightMs)); }
// GET: Weight/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WeightMs weightMs = db.Weights.Find(id); if (weightMs == null) { return(HttpNotFound()); } return(View(weightMs)); }