コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            emp_apu emp_apu = db.emp_apu.Find(id);

            db.emp_apu.Remove(emp_apu);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "EmployeeID,LastName,FirstName,Title,TitleOfCourtesy,BirthDate,HireDate,Address,City,Region,PostalCode,Country,HomePhone,Extension,Photo,Notes,ReportsTo,PhotoPath")] emp_apu emp_apu)
 {
     if (ModelState.IsValid)
     {
         db.Entry(emp_apu).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(emp_apu));
 }
コード例 #3
0
        // GET: Empaapu/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            emp_apu emp_apu = db.emp_apu.Find(id);

            if (emp_apu == null)
            {
                return(HttpNotFound());
            }
            return(View(emp_apu));
        }
コード例 #4
0
        // GET: Empaapu/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //***********************************here the id had to be rewritten coz employee id wasnt set as primary key***********************//
            emp_apu Empaapu = db.emp_apu.SingleOrDefault(m => m.EmployeeID == id);

            if (Empaapu == null)
            {
                return(HttpNotFound());
            }
            return(View(Empaapu));
        }