public async Task <ActionResult> DeleteConfirmed(int id) { A1C a1C = await db.A1C.FindAsync(id); db.A1C.Remove(a1C); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "A1cID,UserID,SugarConcentration,Date")] A1C a1C) { if (ModelState.IsValid) { db.Entry(a1C).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.UserID = new SelectList(db.Users, "Id", "LastName", a1C.UserID); return(View(a1C)); }
// GET: A1C/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } A1C a1C = await db.A1C.FindAsync(id); if (a1C == null) { return(HttpNotFound()); } return(View(a1C)); }
// GET: A1C/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } A1C a1C = await db.A1C.FindAsync(id); if (a1C == null) { return(HttpNotFound()); } ViewBag.UserID = new SelectList(db.Users, "Id", "LastName", a1C.UserID); return(View(a1C)); }