private DataSet DoQuery() { SelectCameras sd = new SelectCameras(); DataSet ds; if (hdfFlag.Value == "0") { ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtBasicCondition.Text); } else { ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtCameraNo.Text.Trim(), txtDvsNo.Text.Trim(), hdfSuburb.Value, ddlCameraType.SelectedValue, ddlCameraKind.SelectedValue, ddlDeviceManu.SelectedValue, ddlDevicePropertyRight.SelectedValue, ddlDeviceLevel.SelectedValue, ddlDeviceState.SelectedValue, ddlPowerType.SelectedValue, ddlCustomerType.SelectedValue, txtCustomerName.Text.Trim(), txtCustomerAddress.Text.Trim(), txtBegin.Text.Trim(), txtEnd.Text.Trim(), txtLanNo.Text.Trim(), txtIP.Text.Trim(), txtAssertNo.Text.Trim()); } return(ds); }
protected void Page_Load(object sender, EventArgs e) { string key = Request.QueryString["root"]; StringBuilder sb = new StringBuilder(); sb.Append("["); if (key != null && key != "" && key != "source") { //编码器 SelectDvs sd = new SelectDvs(); DataSet ds = sd.Query(Session["userid"].ToString(), Session["cityID"].ToString(), "0", "0", "0", "0", "0", key, "0", "0", "0", "0", "", "", "", "", "", "", ""); if (ds.Tables[0].Rows.Count > 0) { int i = 0; foreach (DataRow dataRow in ds.Tables[0].Rows) { if (i > 0) { sb.Append(","); } sb.Append("{\"text\": \"" + Convert.ToString(dataRow["Customername"]) + "<a target='right' href='ResEncoder.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\",\"hasChildren\": true}"); i++; } } else { SelectCameras sc = new SelectCameras(); DataSet ds1 = sc.Query(key); int i = 0; foreach (DataRow dataRow in ds1.Tables[0].Rows) { if (i > 0) { sb.Append(","); } sb.Append("{\"text\": \"" + Convert.ToString(dataRow["dvsno"]) + "(" + Convert.ToString(dataRow["dvsport"]) + ")" + "<a target='right' href='ResCamera.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\"}"); i++; } } } sb.Append("]"); Response.ContentType = "application/json"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.Write(sb.ToString()); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { string key = Request.QueryString["root"]; StringBuilder sb = new StringBuilder(); sb.Append("["); if (key != null && key != "" && key != "source") { //编码器 SelectDvs sd = new SelectDvs(); DataSet ds = sd.Query(Session["userid"].ToString(), Session["cityID"].ToString(), "0", "0", "0", "0", "0", key, "0", "0", "0", "0", "", "", "", "", "", "", ""); if (ds.Tables[0].Rows.Count > 0) { int i = 0; foreach (DataRow dataRow in ds.Tables[0].Rows) { if (i > 0) { sb.Append(","); } sb.Append("{\"text\": \"" + Convert.ToString(dataRow["Customername"]) + "<a target='right' href='ResEncoder.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\",\"hasChildren\": true}"); i++; } } else { SelectCameras sc = new SelectCameras(); DataSet ds1 = sc.Query(key); int i = 0; foreach (DataRow dataRow in ds1.Tables[0].Rows) { if (i > 0) { sb.Append(","); } sb.Append("{\"text\": \"" + Convert.ToString(dataRow["dvsno"]) + "(" + Convert.ToString(dataRow["dvsport"]) +")" + "<a target='right' href='ResCamera.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\"}"); i++; } } } sb.Append("]"); Response.ContentType = "application/json"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.Write(sb.ToString()); Response.End(); }
protected void TreeView1_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { if (e.Node.Depth > 0) { if (e.Node.Depth == 1) { e.Node.ChildNodes.Clear(); SelectDvs sd = new SelectDvs(); DataSet ds = sd.Query(e.Node.Value); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dataRow in ds.Tables[0].Rows) { TreeNode tv = new TreeNode(); tv.Value = Convert.ToString(dataRow["id"]); tv.Text = Convert.ToString(dataRow["Customername"]) + "<a target='right' href='ResEncoder.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>"; TreeNode node = new TreeNode(); node.Text = ""; tv.ChildNodes.Add(node); tv.Expanded = false; e.Node.ChildNodes.Add(tv); } } } else if (e.Node.Depth == 2) { e.Node.ChildNodes.Clear(); SelectCameras sc = new SelectCameras(); DataSet ds1 = sc.Query(e.Node.Value); foreach (DataRow dataRow in ds1.Tables[0].Rows) { TreeNode tv = new TreeNode(); tv.Text = Convert.ToString(dataRow["dvsno"]) + "(" + Convert.ToString(dataRow["dvsport"]) + ")" + "<a target='right' href='ResCamera.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>"; e.Node.ChildNodes.Add(tv); } } } }
protected void Page_Load(object sender, EventArgs e) { string key = Request.QueryString["key"]; string type = Request.QueryString["type"]; string result = "[]"; if (type == "1") //查询编码器 { SelectDvs sd = new SelectDvs(); DataSet ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), key); result = DeviceOutput.GetDvsJSON(ds); } else if (type == "2") //查询摄像头 { SelectCameras sc = new SelectCameras(); DataSet ds = sc.Query(Session["userid"].ToString(), Session["cityid"].ToString(), key); result = DeviceOutput.GetCameraJSON(ds); } else if (type == "3") // { SelectDvs sd = new SelectDvs(); DataSet ds = sd.QueryNormal(Session["userid"].ToString(), Session["cityid"].ToString()); result = DeviceOutput.GetDvsJSON(ds); } else if (type == "4") { SelectCameras sc = new SelectCameras(); DataSet ds = sc.QueryNormal(Session["userid"].ToString(), Session["cityid"].ToString()); result = DeviceOutput.GetCameraJSON(ds); } Response.ContentType = "application/json"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.Write("{\"a\":" + result + "}"); Response.End(); }
private DataSet DoQuery() { SelectCameras sd = new SelectCameras(); DataSet ds; if (hdfFlag.Value == "0") { ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtBasicCondition.Text); } else { ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtCameraNo.Text.Trim(), txtDvsNo.Text.Trim(), hdfSuburb.Value, ddlCameraType.SelectedValue, ddlCameraKind.SelectedValue, ddlDeviceManu.SelectedValue, ddlDevicePropertyRight.SelectedValue, ddlDeviceLevel.SelectedValue, ddlDeviceState.SelectedValue, ddlPowerType.SelectedValue, ddlCustomerType.SelectedValue, txtCustomerName.Text.Trim(), txtCustomerAddress.Text.Trim(), txtBegin.Text.Trim(), txtEnd.Text.Trim(), txtLanNo.Text.Trim(), txtIP.Text.Trim(), txtAssertNo.Text.Trim()); } return ds; }