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

            db.DSTRCTs.Remove(dSTRCT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "districtid,adaid,districtname")] DSTRCT dSTRCT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dSTRCT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.adaid = new SelectList(db.ADAs, "adaid", "adaname", dSTRCT.adaid);
     return(View(dSTRCT));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "districtid,adaid,districtname")] DSTRCT dSTRCT)
        {
            if (ModelState.IsValid)
            {
                db.DSTRCTs.Add(dSTRCT);
                db.SaveChanges();
                return(RedirectToAction("Create"));
            }

            ViewBag.adaid = new SelectList(db.ADAs, "adaid", "adaname", dSTRCT.adaid);
            return(View(dSTRCT));
        }
コード例 #4
0
        // GET: DSTRCTs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DSTRCT dSTRCT = db.DSTRCTs.Find(id);

            if (dSTRCT == null)
            {
                return(HttpNotFound());
            }
            return(View(dSTRCT));
        }
コード例 #5
0
        // GET: DSTRCTs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DSTRCT dSTRCT = db.DSTRCTs.Find(id);

            if (dSTRCT == null)
            {
                return(HttpNotFound());
            }
            ViewBag.adaid = new SelectList(db.ADAs, "adaid", "adaname", dSTRCT.adaid);
            return(View(dSTRCT));
        }