public ActionResult DeleteConfirmed(int id) { TrashCollectorWorker trashCollectorWorker = db.employees.Find(id); db.employees.Remove(trashCollectorWorker); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "WorkerID,FirstName,LastName,UserName,Password,RouteZipCode,StartDay")] TrashCollectorWorker trashCollectorWorker) { if (ModelState.IsValid) { db.Entry(trashCollectorWorker).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trashCollectorWorker)); }
public ActionResult Create([Bind(Include = "WorkerID,FirstName,LastName,UserName,Password,RouteZipCode,StartDay")] TrashCollectorWorker trashCollectorWorker) { if (ModelState.IsValid) { db.employees.Add(trashCollectorWorker); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(trashCollectorWorker)); }
// GET: TrashCollectorWorkers/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TrashCollectorWorker trashCollectorWorker = db.employees.Find(id); if (trashCollectorWorker == null) { return(HttpNotFound()); } return(View(trashCollectorWorker)); }