示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Empleyee empleyee = db.Empleyees.Find(id);

            db.Empleyees.Remove(empleyee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 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));
 }
示例#3
0
        // 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));
        }
示例#4
0
        // 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));
        }