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

            db.my_lesson.Remove(my_lesson);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "user_id,user_name,inst_id,lesson_days,lesson_time")] my_lesson my_lesson)
 {
     if (ModelState.IsValid)
     {
         db.Entry(my_lesson).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(my_lesson));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "user_id,user_name,inst_id,lesson_days,lesson_time")] my_lesson my_lesson)
        {
            if (ModelState.IsValid)
            {
                db.my_lesson.Add(my_lesson);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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