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