Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SpeakingLevel speakingLevel = db.SpeakingLevels.Find(id);

            db.SpeakingLevels.Remove(speakingLevel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Description")] SpeakingLevel speakingLevel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(speakingLevel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(speakingLevel));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Description")] SpeakingLevel speakingLevel)
        {
            if (ModelState.IsValid)
            {
                db.SpeakingLevels.Add(speakingLevel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(speakingLevel));
        }
Exemplo n.º 4
0
        // GET: SpeakingLevels/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SpeakingLevel speakingLevel = db.SpeakingLevels.Find(id);

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