Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CSAgency cSAgency = db.CSAgencies.Find(id);

            db.CSAgencies.Remove(cSAgency);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Agency,Name")] CSAgency cSAgency)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cSAgency).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cSAgency));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "Agency,Name")] CSAgency cSAgency)
        {
            if (ModelState.IsValid)
            {
                db.CSAgencies.Add(cSAgency);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cSAgency));
        }
Esempio n. 4
0
        // GET: CSAgencies/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CSAgency cSAgency = db.CSAgencies.Find(id);

            if (cSAgency == null)
            {
                return(HttpNotFound());
            }
            return(View(cSAgency));
        }