public async Task <ActionResult> DeleteConfirmed(int id) { HRPersonnel hRPersonnel = await db.HRPersonnel.FindAsync(id); db.HRPersonnel.Remove(hRPersonnel); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,JobTitle,shortDes,Department,Position,RequiredSkills,ApplyTill,LongDes")] HRPersonnel hRPersonnel) { if (ModelState.IsValid) { db.Entry(hRPersonnel).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(hRPersonnel)); }
// GET: HRPersonnels/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HRPersonnel hRPersonnel = await db.HRPersonnel.FindAsync(id); if (hRPersonnel == null) { return(HttpNotFound()); } return(View(hRPersonnel)); }