public async Task <ActionResult> DeleteConfirmed(int id) { NTCWorkers nTCWorkers = await db.NTCWorkers.FindAsync(id); db.NTCWorkers.Remove(nTCWorkers); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "id_NTCworker,name_NTCworker,phone_number_NTCworker," + "email_NTCworker,skype_NTCworker,experience,salary")] NTCWorkers nTCWorkers) { if (ModelState.IsValid) { db.Entry(nTCWorkers).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(nTCWorkers)); }
//Action-и для видалення public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NTCWorkers nTCWorkers = await db.NTCWorkers.FindAsync(id); if (nTCWorkers == null) { return(HttpNotFound()); } return(View(nTCWorkers)); }