public ActionResult Delete(int id, string confirmButton) { int count = 0; List <WeightRecord> r = weightRecords.GetWeights(null, id, null, null, "", out count); // Retrieve existing weight record if (r.Count > 0) { weightRecords.Delete(r[0].WeightRecordID); return(View("Deleted")); } else { return(View("NotFound")); } }