예제 #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            StatePower statePower = db.StatePowers.Find(id);

            db.StatePowers.Remove(statePower);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "StatePowerId,StatePowerName,DateEntered,DateModified,CreatedByUserId,ModifiedByUserId,AssignedToUserId")] StatePower statePower)
 {
     if (ModelState.IsValid)
     {
         db.Entry(statePower).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(statePower));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "StatePowerId,StatePowerName,DateEntered,DateModified,CreatedByUserId,ModifiedByUserId")] StatePower statePower)
        {
            if (ModelState.IsValid)
            {
                statePower.StatePowerId = Guid.NewGuid();
                db.StatePowers.Add(statePower);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

            if (statePower == null)
            {
                return(HttpNotFound());
            }
            return(View(statePower));
        }
예제 #5
0
        // GET: StatePowers/Details/5
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StatePower statePower = db.StatePowers.Find(id);

            if (statePower == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Institutions = db.Institutions.Where(i => i.StatePowerId == id).OrderBy(i => i.InstitutionName).ToList();

            return(View(statePower));
        }