public ActionResult DeleteConfirmed(int id) { EmployeeAssign employeeAssign = db.EmployeeAssigns.Find(id); db.EmployeeAssigns.Remove(employeeAssign); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "EmployeeAssignID,EmployeeID,Leader,StartDate,EndDate")] EmployeeAssign employeeAssign) { if (ModelState.IsValid) { db.Entry(employeeAssign).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.Employees, "EmployeeID", "EmployeeID", employeeAssign.EmployeeID); return(View(employeeAssign)); }
// GET: EmployeeAssigns/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EmployeeAssign employeeAssign = db.EmployeeAssigns.Find(id); if (employeeAssign == null) { return(HttpNotFound()); } return(View(employeeAssign)); }
// GET: EmployeeAssigns/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EmployeeAssign employeeAssign = db.EmployeeAssigns.Find(id); if (employeeAssign == null) { return(HttpNotFound()); } ViewBag.EmployeeID = new SelectList(db.Employees, "EmployeeID", "EmployeeID", employeeAssign.EmployeeID); return(View(employeeAssign)); }
public ActionResult Create([Bind(Include = "EmployeeID,EmployeeName,Leader,StartDate,EndDate")] EmployeeAssign employeeAssign) { if (ModelState.IsValid) { db.EmployeeAssigns.Add(employeeAssign); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.Employees, "EmployeeID", "EmployeeID", employeeAssign.EmployeeID); ViewBag.Leader = new SelectList(db.Employees, "EmployeeID", "EmployeeID", employeeAssign.Leader); return(View(employeeAssign)); }