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