예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PrisonerProperty prisonerproperty = db.PrisonerProperties.Find(id);

            db.PrisonerProperties.Remove(prisonerproperty);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        //
        // GET: /PrisonerProperty/Delete/5

        public ActionResult Delete(int id = 0)
        {
            PrisonerProperty prisonerproperty = db.PrisonerProperties.Find(id);

            if (prisonerproperty == null)
            {
                return(HttpNotFound());
            }
            return(View(prisonerproperty));
        }
예제 #3
0
        public ActionResult Edit(PrisonerProperty prisonerproperty)
        {
            if (ModelState.IsValid)
            {
                db.Entry(prisonerproperty).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ValidationError();
            return(View(prisonerproperty));
        }
예제 #4
0
        public ActionResult Create(PrisonerProperty prisonerproperty)
        {
            if (ModelState.IsValid)
            {
                db.PrisonerProperties.Add(prisonerproperty);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ValidationError();
            return(View(prisonerproperty));
        }