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) { Dvs dvs = new Dvs(); dvs.Assertno = txtAssertNo.Text; dvs.Broadbandaccessno = txtBroadbandAccessNo.Text; dvs.Customeraddress = txtCustomerAddress.Text; dvs.Customermanager = txtCustomerManager.Text; dvs.Customermanager_phone = txtCustomerManagerPhone.Text; dvs.Customername = txtCustomerName.Text; dvs.Dialupaccount = txtDialupAccount.Text; dvs.Dialuppassword = txtDialupPassword.Text; dvs.Dvsno = txtDvsNo.Text; dvs.Gateway = txtGateway.Text; dvs.Installdate = txtInstalldate.Text.Trim() == "" ? DateTime.Now :Convert.ToDateTime(txtInstalldate.Text.Trim()); txtInstalldate.Text = DateTime.Now.ToShortDateString(); dvs.Installplace = txtInstallPlace.Text; dvs.Ip = txtIP.Text; dvs.Junctionboxno = txtJunctionBoxNo.Text; dvs.Lanno = txtLanNo.Text; dvs.Latitude = txtLatitude.Text.Trim() == "" ? 0 :Convert.ToDouble(txtLatitude.Text.Trim()); dvs.Linkman = txtLinkman.Text; dvs.Linkman_phone = txtLinkmanPhone.Text; dvs.Longitude = txtLongitude.Text.Trim() == "" ? 0 :Convert.ToDouble(txtLongitude.Text.Trim()); dvs.Portnum = txtPortNum.Text; dvs.Servicedesc = txtServiceDesc.Text; dvs.Storagetime = txtStorageTime.Text; dvs.Subnetmask = txtSubnetMask.Text; dvs.Surfaceman = txtSurfaceMan.Text; dvs.Surfaceman_phone = txtSurfaceManPhone.Text; dvs.Customertype = ddlCustomerType.SelectedValue; dvs.Devicelevel = ddlDeviceLevel.SelectedValue; dvs.Devicemanu = ddlDeviceManu.SelectedValue; dvs.Devicepropertyright = ddlDevicePropertyRight.SelectedValue; dvs.Devicestate = ddlDeviceState.SelectedValue; dvs.Dvskind = ddlDvsKind.SelectedValue; dvs.Dvstype = ddlDvsType.SelectedValue; dvs.Paymenttype = ddlPaymentType.SelectedValue; dvs.Powertype = ddlPowerType.SelectedValue; dvs.Powervoltage = ddlPowerVoltage.SelectedValue; dvs.Servicetype = ddlServiceType.SelectedValue; dvs.Storagetype = ddlStorageType.SelectedValue; dvs.Switchinmode = ddlSwitchinMode.SelectedValue; dvs.Switchinplace = ddlSwitchinPlace.SelectedValue; dvs.Suburb = hdfSuburb.Value; if (hdfDvsID.Value == "0" || hdfDvsID.Value == "") //新增 { DvsManager dm = new DvsManager(); dm.NewDvs(dvs, Session["userid"].ToString()); hdfDvsID.Value = dvs.Id.ToString(); btnModify.Text = "确定修改"; mPortNum = Convert.ToInt32(txtPortNum.Text); LoadCameras(); } else { dvs.Id = Convert.ToInt32(hdfDvsID.Value); DvsManager dm = new DvsManager(); dm.ModifyDvs(dvs, Session["userid"].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(); } }
protected void btnModify_Click(object sender, EventArgs e) { Dvs dvs = new Dvs(); dvs.Assertno = txtAssertNo.Text; dvs.Broadbandaccessno = txtBroadbandAccessNo.Text; dvs.Customeraddress = txtCustomerAddress.Text; dvs.Customermanager = txtCustomerManager.Text ; dvs.Customermanager_phone = txtCustomerManagerPhone.Text ; dvs.Customername = txtCustomerName.Text ; dvs.Dialupaccount = txtDialupAccount.Text ; dvs.Dialuppassword = txtDialupPassword.Text ; dvs.Dvsno = txtDvsNo.Text ; dvs.Gateway = txtGateway.Text ; dvs.Installdate = txtInstalldate.Text.Trim() == "" ? DateTime.Now :Convert.ToDateTime(txtInstalldate.Text.Trim()) ; txtInstalldate.Text = DateTime.Now.ToShortDateString(); dvs.Installplace = txtInstallPlace.Text ; dvs.Ip = txtIP.Text ; dvs.Junctionboxno = txtJunctionBoxNo.Text ; dvs.Lanno = txtLanNo.Text ; dvs.Latitude = txtLatitude.Text.Trim() == "" ? 0 :Convert.ToDouble(txtLatitude.Text.Trim()) ; dvs.Linkman = txtLinkman.Text ; dvs.Linkman_phone = txtLinkmanPhone.Text ; dvs.Longitude = txtLongitude.Text.Trim() == "" ? 0 :Convert.ToDouble(txtLongitude.Text.Trim()) ; dvs.Portnum = txtPortNum.Text ; dvs.Servicedesc = txtServiceDesc.Text ; dvs.Storagetime = txtStorageTime.Text ; dvs.Subnetmask = txtSubnetMask.Text ; dvs.Surfaceman = txtSurfaceMan.Text ; dvs.Surfaceman_phone = txtSurfaceManPhone.Text ; dvs.Customertype = ddlCustomerType.SelectedValue ; dvs.Devicelevel = ddlDeviceLevel.SelectedValue ; dvs.Devicemanu = ddlDeviceManu.SelectedValue ; dvs.Devicepropertyright = ddlDevicePropertyRight.SelectedValue ; dvs.Devicestate = ddlDeviceState.SelectedValue ; dvs.Dvskind = ddlDvsKind.SelectedValue ; dvs.Dvstype = ddlDvsType.SelectedValue ; dvs.Paymenttype = ddlPaymentType.SelectedValue ; dvs.Powertype = ddlPowerType.SelectedValue ; dvs.Powervoltage = ddlPowerVoltage.SelectedValue ; dvs.Servicetype = ddlServiceType.SelectedValue ; dvs.Storagetype = ddlStorageType.SelectedValue ; dvs.Switchinmode = ddlSwitchinMode.SelectedValue ; dvs.Switchinplace = ddlSwitchinPlace.SelectedValue ; dvs.Suburb = hdfSuburb.Value; if (hdfDvsID.Value == "0" || hdfDvsID.Value == "") //新增 { DvsManager dm = new DvsManager(); dm.NewDvs(dvs, Session["userid"].ToString()); hdfDvsID.Value = dvs.Id.ToString(); btnModify.Text = "确定修改"; mPortNum = Convert.ToInt32(txtPortNum.Text); LoadCameras(); } else { dvs.Id = Convert.ToInt32(hdfDvsID.Value); DvsManager dm = new DvsManager(); dm.ModifyDvs(dvs, Session["userid"].ToString()); } }