private void BindData() { VDCameraBLL bll = null; DataPage dp = new DataPage(); VDCamera condition = new VDCamera(); string postionID = Request.QueryString["postionID"]; try { bll = BLLFactory.CreateBLL <VDCameraBLL>(); this.hiPostionID.Value = postionID; condition.PostionID = postionID; condition.CameraCode = this.CameraCode.Text; condition.CameraName = this.CameraName.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <VDCamera> list = dp.Result as List <VDCamera>; this.GvList.DataSource = list; this.GvList.DataBind(); for (int i = 0; i < this.GvList.Rows.Count; i++) { string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["ID"].ToString()); (this.GvList.Rows[i].Cells[5].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
private void BindData() { VDPositionBLL bll = null; VDCameraBLL cbll = null; VDPosition condition = new VDPosition(); List <VDPosition> list = null; List <VDCamera> cameraList = null; try { //获取位置列表 bll = BLLFactory.CreateBLL <VDPositionBLL>(); list = bll.GetList(); //获取摄像头列表 cbll = BLLFactory.CreateBLL <VDCameraBLL>(); cameraList = cbll.GetList(); //绑定摄像头 foreach (VDPosition postion in list) { postion.CameraList = cameraList.Where(p => p.PostionID == postion.ID).ToList <VDCamera>(); } //输出位置信息 foreach (VDPosition position in list) { this.PositionList.Text += "<div class=\"easyui-panel\" title=\"" + position.PositionName + "\" style=\"width:500px;padding:10px;\">"; foreach (VDCamera camera in position.CameraList) { this.PositionList.Text += string.Format("<a href=\"#\" onclick=\"openRTMonitor('{0}','{1}')\">{1}<a> " , camera.ID, camera.CameraName); } this.PositionList.Text += "</div>"; } } catch (Exception ex) { throw ex; } }