Esempio n. 1
0
        public JsonResult ForumTopicComments(long TopicID)
        {
            ResultInfo <ForumDetails> CommentList = new ResultInfo <ForumDetails>()
            {
                Status      = false,
                Description = "Failed|Login"
            };
            List <SubjectForumTopicComment> AllCommentList = new List <SubjectForumTopicComment>();
            ForumDetails DetailsInfo = new ForumDetails();
            // List<ForumTopicComment> CommentDetails = new List<ForumTopicComment>();
            List <SubjectForumTopics> TopicDetails = new List <SubjectForumTopics>();

            SchoolStudent PageObj = new SchoolStudent();

            AllCommentList       = PageObj.AllCommentsOfTopic(TopicID);
            DetailsInfo.comments = AllCommentList;
            //  DetailsInfo.ComID=AllCommentLi
            // DetailsInfo.singleComment=
            TopicDetails = PageObj.getDetailsOfComment(TopicID);
            if (TopicDetails != null && TopicDetails.Count > 0)
            {
                DetailsInfo.Topic = TopicDetails.FirstOrDefault().TopicName;
                DetailsInfo.TopicCreatedByName = TopicDetails.FirstOrDefault().CreatedByName;
                DetailsInfo.TopicCreatedDate   = TopicDetails.FirstOrDefault().TopicCreatedDate;
                //DetailsInfo.Topic_CreatedDate = TopicDetails.FirstOrDefault().Topic_CreatedDate;
                DetailsInfo.TopicID   = TopicDetails.FirstOrDefault().TopicID;
                DetailsInfo.IsStudent = TopicDetails.FirstOrDefault().IsStudent;
                DetailsInfo.IsTeacher = TopicDetails.FirstOrDefault().IsTeacher;
            }
            CommentList.Info        = DetailsInfo;
            CommentList.Description = "Success| Get all comment by TopicId";
            CommentList.Status      = true;
            return(Json(CommentList, JsonRequestBehavior.AllowGet));
        }