Example #1
0
        /// <summary>
        /// 显示直播(Liv)详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult LivDetail(int id)
        {
            ViewBag.CurrentUser = CurrentUser;
            ViewBag.Comments    = TeachingLivMgr.GetTeachingComments(id, 1);
            var obj = TeachingLivMgr.GetTeachingLiv(id);

            return(View(obj));
        }
Example #2
0
        /// <summary>
        /// 显示教学直播、回放列表
        /// </summary>
        /// <param name="tab"></param>
        /// <returns></returns>
        public ActionResult TeachingList(int tab = 1)
        {
            var list = TeachingLivMgr.GetTeachingLivs();

            ViewBag.TeachingVods = TeachingVodMgr.GetTeachingVods();
            ViewBag.TabIndex     = tab;
            return(View(list));
        }
Example #3
0
        /// <summary>
        /// 显示视频回放(Vod)详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult VodDetail(int id)
        {
            ViewBag.CurrentUser = CurrentUser;
            ViewBag.Comments    = TeachingLivMgr.GetTeachingComments(id, 0);
            if (CurrentUser != null)
            {
                ViewBag.Collection = AccountMgr.GetUserCollection(CurrentUser.id, ContentType.回放, id);
            }

            var obj = TeachingVodMgr.GetTeachingVod(id);

            return(View(obj));
        }
Example #4
0
        public ActionResult SubmitSearch()
        {
            var title        = Request.Form["title"];
            var fromDT       = DateTime.Parse(Request.Form["fromDT"]);
            var toDT         = DateTime.Parse(Request.Form["toDT"]);
            var teacher_name = Request.Form["teacher_name"];
            var teacher_org  = Request.Form["teacher_org"];

            ViewBag.LivList = TeachingLivMgr.QueryTeachingLivs(title, fromDT, toDT, teacher_name, teacher_org);
            ViewBag.VodList = TeachingVodMgr.QueryTeachingVods(title, fromDT, toDT, teacher_name, teacher_org);

            return(View("SearchResult"));
        }
Example #5
0
        public ActionResult SubmitTeachingComments(int id, int isLiv, string content)
        {
            if (string.IsNullOrEmpty(content) == true)
            {
                return(Content("评论内容不可为空。"));
            }

            var obj = new teaching_comments()
            {
                teaching_id = id,
                is_liv      = isLiv,
                comments    = content,
                user_id     = CurrentUser.id,
                user_name   = CurrentUser.name,
                created_dt  = DateTime.Now
            };

            TeachingLivMgr.InsertTeachingComments(obj);

            return(Content("OK"));
        }
Example #6
0
        public ActionResult SubmitTeachingApply(int liv_id, int user_id)
        {
            // 获得直播课程的最大报名数 和 已报名数
            //var obj = TeachingLivMgr.GetTeachingLive(liv_id);
            //int a_count = obj.apply_count;
            //int a_max = obj.apply_max;
            // 已报名数 小于 最大报名数
            //if (a_count < a_max)
            // {
            var obj1 = new teaching_apply()
            {
                teaching_id = liv_id,
                user_id     = user_id,
                created_dt  = DateTime.Now
            };

            TeachingLivMgr.InsertTeachingApply(obj1);
            return(Content("OK"));

            // }
            // else return Content("KO");  // 已报名数 大于等于 最大报名数
        }
Example #7
0
 public ActionResult DeleteTeachingApply(int apply_id)
 {
     TeachingLivMgr.DeleteTeachingApply(apply_id);
     return(Content("OK"));
 }
Example #8
0
        /// <summary>
        /// 显示直播的已报名用户列表页面
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult LivApplyList(int id)
        {
            var list = TeachingLivMgr.GetTeachingLivApplyList(id);

            return(View(list));
        }
Example #9
0
 public ActionResult DeleteTeachingComments(int comments_id)
 {
     TeachingLivMgr.DeleteTeachingComments(comments_id);
     return(Content("OK"));
 }