public ActionResult DeleteConfirmed(int id) { Empleyee empleyee = db.Empleyees.Find(id); db.Empleyees.Remove(empleyee); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "EmpleyeeID,Name,LastName,SellID,Gender,Salary")] Empleyee empleyee) { if (ModelState.IsValid) { db.Entry(empleyee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmpleyeeID = new SelectList(db.Customers, "CustomerID", "FirstName", empleyee.EmpleyeeID); ViewBag.EmpleyeeID = new SelectList(db.Orders, "OrderID", "Title", empleyee.EmpleyeeID); ViewBag.EmpleyeeID = new SelectList(db.Products, "ProductID", "Title", empleyee.EmpleyeeID); ViewBag.EmpleyeeID = new SelectList(db.Sells, "SellID", "SellID", empleyee.EmpleyeeID); return(View(empleyee)); }
// GET: Empleyees/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Empleyee empleyee = db.Empleyees.Find(id); if (empleyee == null) { return(HttpNotFound()); } return(View(empleyee)); }
// GET: Empleyees/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Empleyee empleyee = db.Empleyees.Find(id); if (empleyee == null) { return(HttpNotFound()); } ViewBag.EmpleyeeID = new SelectList(db.Customers, "CustomerID", "FirstName", empleyee.EmpleyeeID); ViewBag.EmpleyeeID = new SelectList(db.Orders, "OrderID", "Title", empleyee.EmpleyeeID); ViewBag.EmpleyeeID = new SelectList(db.Products, "ProductID", "Title", empleyee.EmpleyeeID); ViewBag.EmpleyeeID = new SelectList(db.Sells, "SellID", "SellID", empleyee.EmpleyeeID); return(View(empleyee)); }