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