Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            EmployeeAssign employeeAssign = db.EmployeeAssigns.Find(id);

            db.EmployeeAssigns.Remove(employeeAssign);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        // 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));
        }
Exemplo n.º 4
0
        // 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));
        }
Exemplo n.º 5
0
        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));
        }