private void LoadDvsInfo(string id) { SelectDvs sd = new SelectDvs(); Dvs dvs = sd.GetDvs(id); if (dvs != null) { mPortNum = DataGlobal.ConvertToInt(dvs.Portnum); txtAssertNo.Text = dvs.Assertno; txtBroadbandAccessNo.Text = dvs.Broadbandaccessno; txtCustomerAddress.Text = dvs.Customeraddress; txtCustomerManager.Text = dvs.Customermanager; txtCustomerManagerPhone.Text = dvs.Customermanager_phone; txtCustomerName.Text = dvs.Customername; txtDialupAccount.Text = dvs.Dialupaccount; txtDialupPassword.Text = dvs.Dialuppassword; txtDvsNo.Text = dvs.Dvsno; txtGateway.Text = dvs.Gateway; txtInstalldate.Text = dvs.Installdate.ToShortDateString(); txtInstallPlace.Text = dvs.Installplace; txtIP.Text = dvs.Ip; txtJunctionBoxNo.Text = dvs.Junctionboxno; txtLanNo.Text = dvs.Lanno; txtLinkman.Text = dvs.Linkman; txtLinkmanPhone.Text = dvs.Linkman_phone; txtPortNum.Text = dvs.Portnum; txtServiceDesc.Text = dvs.Servicedesc; txtStorageTime.Text = dvs.Storagetime; txtSubnetMask.Text = dvs.Subnetmask; txtSurfaceMan.Text = dvs.Surfaceman; txtSurfaceManPhone.Text = dvs.Surfaceman_phone; ddlCustomerType.SelectedValue = dvs.Customertype; ddlDeviceLevel.SelectedValue = dvs.Devicelevel; ddlDeviceManu.SelectedValue = dvs.Devicemanu; ddlDevicePropertyRight.SelectedValue = dvs.Devicepropertyright; ddlDeviceState.SelectedValue = dvs.Devicestate; ddlDvsKind.SelectedValue = dvs.Dvskind; ddlDvsType.SelectedValue = dvs.Dvstype; ddlPaymentType.SelectedValue = dvs.Paymenttype; ddlPowerType.SelectedValue = dvs.Powertype; ddlPowerVoltage.SelectedValue = dvs.Powervoltage; ddlServiceType.SelectedValue = dvs.Servicetype; ddlStorageType.SelectedValue = dvs.Storagetype; ddlSwitchinMode.SelectedValue = dvs.Switchinmode; ddlSwitchinPlace.SelectedValue = dvs.Switchinplace; //经纬度 SelectDeviceXy sdxy = new SelectDeviceXy(); Device_Info_xy xy = sdxy.SelectByID(dvs.Id); if (xy != null) { txtLongitude.Text = xy.LONGITUDE.ToString(); txtLatitude.Text = xy.LATITUDE.ToString(); } hdfSuburb.Value = dvs.Suburb; hdfDvsID.Value = dvs.Id.ToString(); } }
protected void btnModify_Click(object sender, EventArgs e) { Cameras c = new Cameras(); c.Assertno = txtAssertNo.Text; c.Caremano = txtCameraNo.Text; c.Customeraddress = txtCustomerAddress.Text; c.Customername = txtCustomerName.Text; c.Handleno = txtHandleNo.Text; c.Info = txtInfo.Text; c.Installdate = txtInstalldate.Text.Trim() == "" ? DateTime.Now : Convert.ToDateTime(txtInstalldate.Text.Trim()); c.Installplace = txtInstallPlace.Text; c.Junctionboxno = txtJunctionBoxNo.Text; c.Latitude = txtLatitude.Text.Trim() == "" ? 0 : Convert.ToDouble(txtLatitude.Text.Trim()); c.Linkman = txtLinkman.Text; c.Linkman_phone = txtLinkmanPhone.Text; c.Longitude = txtLongitude.Text.Trim() == "" ? 0 : Convert.ToDouble(txtLongitude.Text.Trim()); c.Singleplace = txtSinglePlace.Text; c.Storagetime = txtStorageTime.Text; c.Baudrate = ddlBaudrate.SelectedValue; c.Caremakind = ddlCameraKind.SelectedValue; c.Carematype = ddlCameraType.SelectedValue; c.Codeaddr = ddlCodeAddr.SelectedValue; c.Codestream = ddlCodeStream.SelectedValue; c.Controlprotocol = ddlControlProtocol.SelectedValue; c.Customertype = ddlCustomerType.SelectedValue; c.Devicelevel = ddlDeviceLevel.SelectedValue; c.Devicemanu = ddlDeviceManu.SelectedValue; c.Devicepropertyright = ddlDevicePropertyRight.SelectedValue; c.Devicestate = ddlDeviceState.SelectedValue; c.Dvsport = ddlDvsPort.SelectedValue; c.Installmode = ddlInstallMode.SelectedValue; c.Paymenttype = ddlPaymentType.SelectedValue; c.Powertype = ddlPowerType.SelectedValue; c.Powervoltage = ddlPowerVoltage.SelectedValue; c.Storagetype = ddlStorageType.SelectedValue; c.Switchinmode = ddlSwitchinMode.SelectedValue; c.Switchinplace = ddlSwitchinPlace.SelectedValue; c.Dvsid = hdfDvsID.Value; c.Suburb = hdfSuburbID.Value; if (hdfCameraID.Value == "0" || hdfCameraID.Value == "") //新增 { CameraManager cm = new CameraManager(); cm.NewCamera(c, Session["userid"].ToString()); hdfCameraID.Value = c.Id.ToString(); btnModify.Text = "确定修改"; } else { c.Id = DataGlobal.ConvertToInt(hdfCameraID.Value); CameraManager cm = new CameraManager(); cm.ModifyCamera(c, Session["userid"].ToString()); } }
public static string GetDvsJSON(DataSet ds) { StringBuilder sb = new StringBuilder(); sb.Append("["); int i = 0; foreach (DataRow dataRow in ds.Tables[0].Rows) { if (i != 0) { sb.Append(","); } sb.Append("[1," + Convert.ToString(dataRow["id"]) + "," + DataGlobal.ConvertToDouble(Convert.ToString(dataRow["Latitude"])) + "," + DataGlobal.ConvertToDouble(Convert.ToString(dataRow["Longitude"])) + "," + "\"" + Convert.ToString(dataRow["Dvsno"]) + "\"," + "\"" + Convert.ToString(dataRow["area1"]) + " > " + Convert.ToString(dataRow["area2"]) + " > " + Convert.ToString(dataRow["Suburb"]) + "\"," + "\"" + Convert.ToString(dataRow["Dvskind"]) + "\"," + "\"" + Convert.ToString(dataRow["Customertype"]) + "\"," + "\"" + Convert.ToString(dataRow["Customername"]) + "\"," + "\"" + Convert.ToString(dataRow["Customeraddress"]) + "\"," + "\"" + Convert.ToString(dataRow["Devicestate"]) + "\","); int contentcode = DataGlobal.ConvertToInt(Convert.ToString(dataRow["contentcode"])); sb.Append(contentcode.ToString() + ","); //告警记录 if (contentcode > 0) { sb.Append(GetAlarmJSON(Convert.ToString(dataRow["id"]))); } else { sb.Append("[]"); } sb.Append("]"); i++; } sb.Append("]"); return(sb.ToString()); }
private void LoadDvsInfo(string dvsID, string port) { hlkNew.NavigateUrl = "ResCamera.aspx?dvsid=" + dvsID; hlkBack.NavigateUrl = "ResEncoder.aspx?id=" + dvsID; SelectDvs sd = new SelectDvs(); Dvs dvs = sd.GetDvs(dvsID); if (dvs != null) { txtDvsID.Text = dvs.Dvsno; txtBroadbandAccessNo.Text = dvs.Broadbandaccessno; txtCustomerManager.Text = dvs.Customermanager; txtCustomerManagerPhone.Text = dvs.Customermanager_phone; txtLanNo.Text = dvs.Lanno; txtIP.Text = dvs.Ip; txtGateway.Text = dvs.Gateway; txtSubnetMask.Text = dvs.Subnetmask; txtDialupAccount.Text = dvs.Dialupaccount; txtDialupPassword.Text = dvs.Dialuppassword; hdfSuburbID.Value = dvs.Suburb; SelectAreas sa = new SelectAreas(); Areas area = sa.GetArea(dvs.Suburb); //分局 if (area == null) { return; } txtSuburb.Text = area.Area_Name; area = sa.GetParentAreas(area.ID.ToString()); //郊县 if (area == null) { return; } txtTown.Text = area.Area_Name; //剩余的端口 SelectCameras sc = new SelectCameras(); IList <Cameras> list = sc.GetCameras(Session["userid"].ToString(), Session["cityid"].ToString(), dvsID); int portNum = DataGlobal.ConvertToInt(dvs.Portnum); for (int i = 1; i <= portNum; i++) { bool flag = false; for (int j = 0; j < list.Count; j++) { if (list[j].Dvsport == i.ToString()) { flag = true; } } if (i.ToString() == port) { flag = false; } if (!flag) { ListItem ddlone = new ListItem(i.ToString(), i.ToString()); ddlDvsPort.Items.Add(ddlone); } } if (Request["dvsport"] != null && Request["dvsport"] != "") { ddlDvsPort.SelectedValue = Request["dvsport"].ToString(); } btnModify.Enabled = true; hdfDvsID.Value = dvs.Id.ToString(); } }