private void BindData() { if (Request.QueryString["id"] != null) { NCPEP.Model.T_News model = new NCPEP.Model.T_News(); NCPEP.Bll.T_News bll = new NCPEP.Bll.T_News(); model = bll.GetModel(int.Parse(Request.QueryString["id"])); this.txtContent.Text = model.Content; this.txtKeyword.Text = model.Keyword; this.txtNewsSource.Text = model.NewsSource; this.txtNewsSubheading.Text = model.NewsSubheading; this.txtNewsTitle.Text = model.NewsTitle; this.txtNewsTypeId.Text = model.NewsTypeId.ToString();//新闻类型 this.ddlzt.SelectedValue = model.ztbz; this.txtsj.Text = model.CreateDate.ToString("yyyy-MM-dd"); this.content1.Value = model.NewsContent; this.HyperLink1.NavigateUrl = "../../newsimg/max/" + model.NewsImg; this.HyperLink1.Text = model.NewsImg; NCPEP.Bll.T_Fujian fjbll = new NCPEP.Bll.T_Fujian(); DataSet ds = fjbll.GetList("fid='" + model.Id + "'"); if (ds.Tables[0].Rows.Count > 0) { this.repsfz.Visible = true; this.repsfz.DataSource = ds; this.repsfz.DataBind(); } } }
private void Bindfj() { if (Request.QueryString["id"] != null) { NCPEP.Model.T_News model = new NCPEP.Model.T_News(); NCPEP.Bll.T_News bll = new NCPEP.Bll.T_News(); model = bll.GetModel(int.Parse(Request.QueryString["id"])); NCPEP.Bll.T_Fujian fjbll = new NCPEP.Bll.T_Fujian(); DataSet ds = fjbll.GetList("fid='" + model.Id + "'"); if (ds.Tables[0].Rows.Count > 0) { this.repsfz.Visible = true; this.repsfz.DataSource = ds; this.repsfz.DataBind(); } } }