public async Task <ActionResult> DeleteConfirmed(decimal id) { MS_TBL mS_TBL = await db.MS_TBLs.FindAsync(id); db.MS_TBLs.Remove(mS_TBL); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,機体番号,機体名,登場作品")] MS_TBL mS_TBL) { if (ModelState.IsValid) { db.Entry(mS_TBL).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(mS_TBL)); }
public async Task <ActionResult> Create([Bind(Include = "ID,機体番号,機体名,登場作品")] MS_TBL mS_TBL) { if (ModelState.IsValid) { db.MS_TBLs.Add(mS_TBL); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(mS_TBL)); }
// GET: MS_TBL/Delete/5 public async Task <ActionResult> Delete(decimal?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MS_TBL mS_TBL = await db.MS_TBLs.FindAsync(id); if (mS_TBL == null) { return(HttpNotFound()); } return(View(mS_TBL)); }