/// <summary> /// 加载信息 /// </summary> protected void LoadInfo() { ddl_Class.DataSource = NewsAction.NewsClass.Where(p => p.IsLeafClass && p.ModelID == 3); ddl_Class.DataTextField = "ClassName"; ddl_Class.DataValueField = "ID"; ddl_Class.DataBind(); ddl_Class.SelectedValue = cls.ToS(); ddl_Author.DataSource = UserView.GetModelList(); ddl_Author.DataTextField = "UserName"; ddl_Author.DataValueField = "ID"; ddl_Author.DataBind(); Question qu = QuestionView.GetModelByID(id.ToS()); if (id > 0) { ddl_Class.SelectedValue = qu.ClassID.ToS(); txt_Title.Text = qu.Title; //ddl_Author.Text = qu.UserID.ToS(); ddl_Author.SelectedValue = qu.UserID.ToS(); txt_ClickCount.Text = qu.ClickCount.ToS(); txt_Content.Text = qu.Content; rp_list.DataSource = AnswerView.GetModelList(string.Format("QuestionID={0} order by id", qu.ID)); rp_list.DataBind(); } }
protected void DeleteAnswer(int id) { AnswerView.DelByID(id); Class cls = ClassView.GetModelByID(WS.RequestString("class")); Question qu = QuestionView.GetModelByID(WS.RequestString("id")); if (cls.ID > 0 && qu.ID > 0) { CreatePage.CreateContentPage(qu, cls); } rp_list.DataSource = AnswerView.GetModelList(string.Format("QuestionID={0} order by id", WS.RequestString("id"))); rp_list.DataBind(); }