public void GenerateSubmissionViewForUser(int userID) { SubmissionManagementBO bo = new SubmissionManagementBO(); List<SubmissionVO> subList = bo.GetListOfSubmissionsByUser(5, userID); foreach (SubmissionVO sub in subList) { Submission submission = (Submission)Page.LoadControl("~/Controls/Submission.ascx"); submission.ID = "submission" + sub.SubmissionID; submission.submissionID = sub.SubmissionID; subPanel.Controls.Add(submission); } }
private void GenerateRecentContent(string type) { if (type == "submissions") { //We need to add a table for submissions, since they are just trs and tds Literal lit1 = new Literal(); lit1.Text = "<table width=\"100%\">"; recentContentPanel.Controls.Add(lit1); SubmissionManagementBO bo = new SubmissionManagementBO(); List<SubmissionVO> subList = bo.GetListOfSubmissionsByUser(5, UserID); foreach (SubmissionVO sub in subList) { Submission submission = (Submission)Page.LoadControl("~/Controls/Submission.ascx"); submission.ID = "submission" + sub.SubmissionID; submission.submissionID = sub.SubmissionID; recentContentPanel.Controls.Add(submission); } //We need to close the table tag we added Literal lit2 = new Literal(); lit2.Text = "</table>"; recentContentPanel.Controls.Add(lit2); } else if(type == "comments") { CommentManagementBO bo = new CommentManagementBO(); List<CommentVO> comList = bo.GetListOfCommentsByUserID(5, UserID); foreach (CommentVO comment in comList) { Comment com = (Comment)Page.LoadControl("~/Controls/Comment.ascx"); com.ID = "comment" + comment.CommentID; com.commentDepth = 0; com.commentID = comment.CommentID; recentContentPanel.Controls.Add(com); } } }