public void answerRemindShow()//回复提醒 { this.answerRemindPanel.Controls.Clear(); SqlDataReader answerremind; string commenter; int i = 1; string time = System.DateTime.Now.ToString(); try { answerremind = LibraryBLL.user.answerremind(time); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } while (answerremind.Read()) { int k = (int)answerremind["qusetionId"]; LibraryModel.anser_Remind answerComment = new anser_Remind(); answerComment.answername = answerremind["answerName"].ToString().Trim(); answerComment.answerdate = answerremind["answertime"].ToString(); answerComment.questionname = questName(k); LibrarySET.anserRemindShow UIcomment = new LibrarySET.anserRemindShow(answerComment); UIcomment.Click += new EventHandler(this.answerContent_Click); this.answerRemindPanel.Controls.Add(UIcomment); } }
private void answerContent_Click(object sender, EventArgs e)//跳转详细 { string titlename; main.SelectedIndex = 2; LibrarySET.anserRemindShow myquestion = (LibrarySET.anserRemindShow)sender; titlename = myquestion.Name; contentMainShow(titlename); }