예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Employee_Employee employee_Employee = db.Employes.Find(id);

            db.Employes.Remove(employee_Employee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "EmployeeID,FirstName,MiddleName,LastName,Gender,EmailAddress,Titre,Departement,ModifiedDate,EntrepriseID")] Employee_Employee employee_Employee)
 {
     if (ModelState.IsValid)
     {
         employee_Employee.ModifiedDate    = DateTime.Now;
         db.Entry(employee_Employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EntrepriseID = new SelectList(db.Entreprises, "EntrepriseID", "EntrepriseName", employee_Employee.EntrepriseID);
     return(View(employee_Employee));
 }
예제 #3
0
        // GET: Employee_Employee/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Employee_Employee employee_Employee = db.Employes.Find(id);

            if (employee_Employee == null)
            {
                return(HttpNotFound());
            }
            return(View(employee_Employee));
        }
예제 #4
0
        // GET: Employee_Employee/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Employee_Employee employee_Employee = db.Employes.Find(id);

            if (employee_Employee == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EntrepriseID = new SelectList(db.Entreprises, "EntrepriseID", "EntrepriseName", employee_Employee.EntrepriseID);
            return(View(employee_Employee));
        }