Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            StatePower statePower = db.StatePowers.Find(id);

            db.StatePowers.Remove(statePower);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 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));
 }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }