/// <summary>
        /// 编辑初始化
        /// </summary>
        /// <returns></returns>
        public ActionResult UpdateInit(int lecturerid)
        {
            JsonResultData <LectureUIModel> resultdata = new JsonResultData <LectureUIModel>();

            try
            {
                LectureUIModel lecture = lectureservice.GetLectureById(lecturerid);


                if (lecture == null)
                {
                    resultdata.Code = 0;
                    resultdata.Data = lecture;
                }
                else
                {
                    resultdata.Code = 1;
                    resultdata.Data = lecture;
                }
            }
            catch (Exception ex)
            {
                resultdata.Msg = ex.Message;
            }

            return(Json(resultdata, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public IHttpActionResult GetLecture(int id)
        {
            var lecture = LectureService.GetLectureById(id);

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

            return(Ok(lecture));
        }