예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            empDB empDB = db.empDBs.Find(id);

            db.empDBs.Remove(empDB);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] empDB empDB)
 {
     if (ModelState.IsValid)
     {
         db.Entry(empDB).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(empDB));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Name")] empDB empDB)
        {
            if (ModelState.IsValid)
            {
                db.empDBs.Add(empDB);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(empDB));
        }
예제 #4
0
        // GET: empDBs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            empDB empDB = db.empDBs.Find(id);

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