protected void BindPic(Repeater rpt, int ModuleID, int MessageCount) { DataTable dt = NewsInfoService.Get_TopAnyPicNews(ModuleID, MessageCount); if (dt.Rows.Count > 0) { rpt.DataSource = dt; rpt.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //文件下载 rptDownLoad.DataSource = FileDownloadService.Get_TopFileDownloadView(1, 6); rptDownLoad.DataBind(); //政策法规 rptRuleList.DataSource = NewsInfoService.Get_TopNewsInfoViewList("政策法规", 6); rptRuleList.DataBind(); //工作动态 rptWorkexpress.DataSource = NewsInfoService.Get_TopNewsInfoViewList(1, 6); rptWorkexpress.DataBind(); //高速新闻 rptGsNews.DataSource = NewsInfoService.Get_TopNewsInfoViewList(2, 6); rptGsNews.DataBind(); //公告公示 rptSiteNotice.DataSource = NewsInfoService.Get_TopNewsInfoViewList(63, 5); rptSiteNotice.DataBind(); //头2-4条政务信息 rptTop2_4NewsList.DataSource = NewsInfoService.Get_Top2To5NewsInfoViewList(62); rptTop2_4NewsList.DataBind(); //头1条政务信息 rptTop1_NewsList.DataSource = NewsInfoService.Get_Top1NewsInfoView(62); rptTop1_NewsList.DataBind(); //高速风采 rptGsFengCai.DataSource = NewsInfoService.Get_TopAnyPicNews(4, 0); rptGsFengCai.DataBind(); //实时路况 DataTable dtCurrentRoadCondition = NewsInfoService.Get_TopNewsInfoViewList(80, 0); rptCurrentRoadConditon.DataSource = dtCurrentRoadCondition; rptCurrentRoadConditon.DataBind(); lblLJZHZX.Text = "您通行高速公路前可拨打高速交警路况查询电话:0371-68208110查询最新路况。<br><br>"; //路政单位信息列表 DataTable dtLZ = DBHelper.GetDataSet("select RD_ID,RD_Name from R_RoadDepart"); rptLZ.DataSource = dtLZ; rptLZ.DataBind(); } }
protected void BindWorkActiveWithImg() { DataTable dt = NewsInfoService.Get_TopAnyPicNews(89, 4); for (int i = 0; i < dt.Rows.Count; i++) { string path = "../newsimages/" + dt.Rows[i]["N_ImgView"].ToString(); string intro = Tool.SubString(dt.Rows[i]["N_Title"].ToString(), 18); string actionUrl = "Page.aspx?id=" + dt.Rows[i]["N_ID"].ToString(); if (i == dt.Rows.Count - 1) { Path += path; Intro += intro; ActionUrl += actionUrl; } else { Path += path + "|"; Intro += intro + "|"; ActionUrl += actionUrl + "|"; } } }