public async Task <ActionResult> DeleteConfirmed(int id) { tmake tmake = await db.tmakes.FindAsync(id); db.tmakes.Remove(tmake); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "id,make_na")] tmake tmake) { if (ModelState.IsValid) { db.Entry(tmake).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(tmake)); }
public async Task <ActionResult> Create([Bind(Include = "id,make_na")] tmake tmake) { if (ModelState.IsValid) { db.tmakes.Add(tmake); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(tmake)); }
// GET: tmakes/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tmake tmake = await db.tmakes.FindAsync(id); if (tmake == null) { return(HttpNotFound()); } return(View(tmake)); }