コード例 #1
0
ファイル: EparchyController.cs プロジェクト: cjeganr/MyCode
        public ActionResult DeleteConfirmed(int id)
        {
            Eparchy eparchy = db.Eparchies.Find(id);

            db.Eparchies.Remove(eparchy);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
ファイル: EparchyController.cs プロジェクト: cjeganr/MyCode
 public ActionResult Edit(Eparchy eparchy)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eparchy).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(eparchy));
 }
コード例 #3
0
ファイル: EparchyController.cs プロジェクト: cjeganr/MyCode
        //
        // GET: /Eparchy/Delete/5

        public ActionResult Delete(int id = 0)
        {
            ViewBag.ProvinceList = db.Provinces.ToList();
            Eparchy eparchy = db.Eparchies.Find(id);

            if (eparchy == null)
            {
                return(HttpNotFound());
            }
            return(View(eparchy));
        }
コード例 #4
0
ファイル: EparchyController.cs プロジェクト: cjeganr/MyCode
        public ActionResult Create(Eparchy eparchy)
        {
            if (ModelState.IsValid)
            {
                db.Eparchies.Add(eparchy);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(eparchy));
        }