public ActionResult DeleteConfirmed(string id, int?phone) { Employees_Phone employees_Phone = db.Employees_Phone.Find(id, phone); db.Employees_Phone.Remove(employees_Phone); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ssn,Phone")] Employees_Phone employees_Phone) { if (ModelState.IsValid) { db.Entry(employees_Phone).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ssn = new SelectList(db.Employees, "ssn", "firstname", employees_Phone.ssn); return(View(employees_Phone)); }
// GET: Employees_Phone/Details/5 public ActionResult Details(string id, int?phone) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (phone == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Employees_Phone employees_Phone = db.Employees_Phone.Find(id, phone); if (employees_Phone == null) { return(HttpNotFound()); } return(View(employees_Phone)); }
// GET: Employees_Phone/Edit/5 public ActionResult Edit(string id, int?Phone) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (Phone == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Employees_Phone employees_Phone = db.Employees_Phone.Find(id, Phone); if (employees_Phone == null) { return(HttpNotFound()); } ViewBag.ssn = new SelectList(db.Employees, "ssn", "firstname", employees_Phone.ssn); return(View(employees_Phone)); }