コード例 #1
0
ファイル: empDBsController.cs プロジェクト: omkarj/C-
        public ActionResult DeleteConfirmed(int id)
        {
            empDB empDB = db.empDBs.Find(id);

            db.empDBs.Remove(empDB);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
ファイル: empDBsController.cs プロジェクト: omkarj/C-
 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
ファイル: empDBsController.cs プロジェクト: omkarj/C-
        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
ファイル: empDBsController.cs プロジェクト: omkarj/C-
        // 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));
        }