Пример #1
0
        public IHttpActionResult DeleteLecture(int id)
        {
            var result = LectureService.DeleteLecture(id);

            if (result == null)
            {
                return(NotFound());
            }

            return(Ok(result));
        }
        public ActionResult DeleteLecture(int id = 0)
        {
            var user = Session["User"] as User;

            if (user == null)
            {
                return(RedirectToAction("Login", "UserRegistration"));
            }
            else
            {
                if (id != 0)
                {
                    var lecture = lectureService.GetLecture(id);
                    if (lecture != null)
                    {
                        lectureService.DeleteLecture(lecture);
                    }
                    id = 0;
                }
                var lectures = lectureService.GetAllLecture();
                return(View(lectures));
            }
        }
Пример #3
0
 public ActionResult Delete(Lecture lecture)
 {
     lectureService.DeleteLecture(lecture);
     return(RedirectToAction("LectureList", "Lecture"));
 }