Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PhoneExt phoneext = db.PhoneExts.Find(id);

            db.PhoneExts.Remove(phoneext);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        //
        // GET: /Extension/Details/5

        public ActionResult Details(int id = 0)
        {
            PhoneExt phoneext = db.PhoneExts.Find(id);

            if (phoneext == null)
            {
                return(HttpNotFound());
            }
            return(View(phoneext));
        }
Beispiel #3
0
 public ActionResult Edit(PhoneExt phoneext)
 {
     if (ModelState.IsValid)
     {
         db.Entry(phoneext).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Department = new SelectList(db.Deparments, "Id", "Name", phoneext.Department);
     return(View(phoneext));
 }
Beispiel #4
0
        //
        // GET: /Extension/Edit/5

        public ActionResult Edit(int id = 0)
        {
            PhoneExt phoneext = db.PhoneExts.Find(id);

            if (phoneext == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Department = new SelectList(db.Deparments, "Id", "Name", phoneext.Department);
            return(View(phoneext));
        }
Beispiel #5
0
        public ActionResult Create(PhoneExt phoneext)
        {
            if (ModelState.IsValid)
            {
                db.PhoneExts.Add(phoneext);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Department = new SelectList(db.Deparments, "Id", "Name", phoneext.Department);
            return(View(phoneext));
        }