public ActionResult DeleteConfirmed(int id) { tstEmployee tstEmployee = db.tstEmployees.Find(id); db.tstEmployees.Remove(tstEmployee); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name,Lname,Hiredate,UserID,StatusID,Jobtitle,Adress,Adress2,City,State,Zip,Email,Phone,DepID,ImmageURL,Notes,Dateofbirth,separationDate")] tstEmployee tstEmployee) { if (ModelState.IsValid) { db.Entry(tstEmployee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepID = new SelectList(db.tstDepartments, "ID", "Name", tstEmployee.DepID); ViewBag.StatusID = new SelectList(db.tstEmployeeStatus, "ID", "Name", tstEmployee.StatusID); return(View(tstEmployee)); }
// GET: tstEmployees/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tstEmployee tstEmployee = db.tstEmployees.Find(id); if (tstEmployee == null) { return(HttpNotFound()); } return(View(tstEmployee)); }
// GET: tstEmployees/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tstEmployee tstEmployee = db.tstEmployees.Find(id); if (tstEmployee == null) { return(HttpNotFound()); } ViewBag.DepID = new SelectList(db.tstDepartments, "ID", "Name", tstEmployee.DepID); ViewBag.StatusID = new SelectList(db.tstEmployeeStatus, "ID", "Name", tstEmployee.StatusID); return(View(tstEmployee)); }