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 void Update() { if (messages.Count != 0) { lock (messages) { while (messages.Count > 0) { lastData = messages.Dequeue(); OnUpdate(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //校验 ValidatorFactory.CreateRequiredValidator(rfvDvsNo, txtDvsNo, "请输入DVS编号"); ValidatorFactory.CreateRequiredValidator(rfvJunctionBoxNo, txtJunctionBoxNo, "请输入分线盒编号"); ValidatorFactory.CreateRequiredValidator(rfvCustomerAddress, txtCustomerAddress, "请输入用户地址"); ValidatorFactory.CreateRequiredValidator(rfvCustomerName, txtCustomerName, "请输入用户名称"); ValidatorFactory.CreateRequiredValidator(rfvPortNum, txtPortNum, "请输入端口数"); ValidatorFactory.CreateDoubleRangeValidator(RangeValidator1, txtLongitude, 180, -180); ValidatorFactory.CreateDoubleRangeValidator(RangeValidator2, txtLatitude, 90, -90); ValidatorFactory.CreateIntegerValidator(revPortNum, txtPortNum); ValidatorFactory.CreateDoubleRangeValidator(rvdPortNum, txtPortNum, 16, 1); //字典 DataGlobal.LoadDictType(ddlCustomerType, DicType.CustomerType); DataGlobal.LoadDeviceLevel(ddlDeviceLevel); DataGlobal.LoadDictType(ddlDeviceManu, DicType.DeviceManu); DataGlobal.LoadDictType(ddlDevicePropertyRight, DicType.DevicePropertyRight); DataGlobal.LoadDictType(ddlDeviceState, DicType.DeviceState); DataGlobal.LoadDictType(ddlDvsKind, DicType.DvsKind); DataGlobal.LoadDictType(ddlDvsType, DicType.DvsType); DataGlobal.LoadDictType(ddlPaymentType, DicType.PaymentType); DataGlobal.LoadDictType(ddlPowerType, DicType.PowerType); DataGlobal.LoadDictType(ddlPowerVoltage, DicType.PowerVoltage); DataGlobal.LoadDictType(ddlServiceType, DicType.ServiceType); DataGlobal.LoadDictType(ddlStorageType, DicType.StorageType); DataGlobal.LoadDictType(ddlSwitchinMode, DicType.SWITCHINMODE); DataGlobal.LoadDictType(ddlSwitchinPlace, DicType.SWITCHINPLACE); //行政区 DataGlobal.LoadTown(ddlTown, Session["userid"].ToString()); hdfDvsID.Value = "0"; if (Request["id"] != null && Request["id"] != "") { LoadDvsInfo(Request["id"].ToString()); } LoadCameras(); } if (hdfDvsID.Value == "0") { btnModify.Text = "确定新增"; } else { btnModify.Text = "确定修改"; } LoadArea(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //字典 DataGlobal.LoadDictType(ddlDvsKind, DicType.DvsKind); DataGlobal.LoadDictType(ddlDvsType, DicType.DvsType); DataGlobal.LoadDictType(ddlDeviceManu, DicType.DeviceManu); DataGlobal.LoadDictType(ddlDevicePropertyRight, DicType.DevicePropertyRight); DataGlobal.LoadDeviceLevel(ddlDeviceLevel); DataGlobal.LoadDictType(ddlDeviceState, DicType.DeviceState); DataGlobal.LoadDictType(ddlPowerType, DicType.PowerType); DataGlobal.LoadDictType(ddlCustomerType, DicType.CustomerType); DataGlobal.LoadTown(ddlTown, Session["userid"].ToString()); DataGlobal.SetGridStyle(gvwDvs, "con_list"); } LoadArea(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ValidatorFactory.CreateRequiredValidator(rfvCameraNo, txtCameraNo, "请输入摄像头编号"); ValidatorFactory.CreateRequiredValidator(rfvCustomerAddress, txtCustomerAddress, "请输入用户地址"); ValidatorFactory.CreateRequiredValidator(rfvCustomerName, txtCustomerName, "请输入用户名称"); ValidatorFactory.CreateDoubleRangeValidator(RangeValidator1, txtLongitude, 180, -180); ValidatorFactory.CreateDoubleRangeValidator(RangeValidator2, txtLatitude, 90, -90); //字典 DataGlobal.LoadDictType(ddlBaudrate, DicType.BaudRate); DataGlobal.LoadDictType(ddlCameraKind, DicType.CaremaKind); DataGlobal.LoadDictType(ddlCameraType, DicType.CaremaType); DataGlobal.LoadDictType(ddlCodeAddr, DicType.CodeAddr); DataGlobal.LoadDictType(ddlCodeStream, DicType.CodeStream); DataGlobal.LoadDictType(ddlControlProtocol, DicType.ControlProtocol); DataGlobal.LoadDictType(ddlCustomerType, DicType.CustomerType); DataGlobal.LoadDeviceLevel(ddlDeviceLevel); DataGlobal.LoadDictType(ddlDeviceManu, DicType.DeviceManu); DataGlobal.LoadDictType(ddlDevicePropertyRight, DicType.DevicePropertyRight); DataGlobal.LoadDictType(ddlDeviceState, DicType.DeviceState); DataGlobal.LoadDictType(ddlInstallMode, DicType.InstallMode); DataGlobal.LoadDictType(ddlPaymentType, DicType.PaymentType); DataGlobal.LoadDictType(ddlPowerType, DicType.PowerType); DataGlobal.LoadDictType(ddlPowerVoltage, DicType.PowerVoltage); DataGlobal.LoadDictType(ddlStorageType, DicType.StorageType); DataGlobal.LoadDictType(ddlSwitchinMode, DicType.SWITCHINMODE); DataGlobal.LoadDictType(ddlSwitchinPlace, DicType.SWITCHINPLACE); hdfCameraID.Value = "0"; btnModify.Enabled = false; if (Request["id"] != null && Request["id"] != "") { LoadCameraInfo(Request["id"].ToString()); btnModify.Text = "确定修改"; } else if (Request["dvsid"] != null && Request["dvsid"] != "") { LoadDvsInfo(Request["dvsid"].ToString(), "0"); btnModify.Text = "确定新增"; } } }
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(); } }