Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Data == null)
     {
         Data = new List <Comment>();
     }
     CommentsRepeater.DataSource = Data;
     if (Data.Count == 0)
     {
         CommentsList.Visible = false;
     }
     CommentsRepeater.DataBind();
 }
Beispiel #2
0
        private void LoadProject(Project project)
        {
            // load comments
            CommentsRepeater.DataSource = project != null?DatabaseContext.ProjectHistories.Where(p => p.ProjectId == project.Id).OrderByDescending(p => p.ChangeDate).ToArray() : null;

            CommentsRepeater.DataBind();

            // load project update form
            LoadProjectForm(project);

            // load reviewer form
            if (IsProfessor)
            {
                LoadReviewerForm(project);
            }
            if (IsStudent)
            {
                LoadStudentForm(project);
            }
        }
        public void DisplayComments()
        {
            var dataSource = GetDataSourceItem();

            if (dataSource == null)
            {
                return;
            }

            var commentsFolder = dataSource.Axes.GetDescendants().FirstOrDefault(x => x.TemplateName == "Comments Folder");

            if (commentsFolder == null)
            {
                return;
            }
            var comments =
                commentsFolder.Axes.GetDescendants()
                .Where(x => x.TemplateName == "Comment")
                .OrderBy(x => x.Created);

            CommentsRepeater.DataSource = comments;
            CommentsRepeater.DataBind();
        }