private void EditDeviceForm_Load(object sender, EventArgs e) { LoadLanguage(""); this.txb_addr_part1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress); this.txb_addr_part2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress); this.txb_addr_part3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress); this.txb_addr_part4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(new Smart.ToolUtil.StringControlUtil().NumTextKeyPress); DAL.DAL_Device devicedal = new DAL.DAL_Device(); DAL.DAO.DeviceDao devicedao = devicedal.selectDeviceInfoWithID(deviceid); if (devicedao == null) { MessageBox.Show("获取设备信息失败!"); this.Close(); } else { this.txb_DeviceName.Text = devicedao.Devicename; this.txb_DeviceCode.Text = devicedao.Code; string[] address = devicedao.Netaddress.Split('.'); this.txb_addr_part1.Text = address[0]; this.txb_addr_part2.Text = address[1]; this.txb_addr_part3.Text = address[2]; this.txb_addr_part4.Text = address[3]; this.cmb_DevicePosition.Text = devicedao.Deviceposition; } DAL.DAL_Position positiondal = new DAL.DAL_Position(); //DataTable _dt = devicedal.GetDeviceTypeList(); //if (_dt != null) //{ // cmb_DeviceType.Items.Clear(); // foreach (DataRow _row in _dt.Rows) // { // cmb_DeviceType.Items.Add(_row[0]); // } //} DataTable _dt = positiondal.selectPositionListInfo(""); if (_dt != null) { cmb_DevicePosition.Items.Clear(); foreach (DataRow _row in _dt.Rows) { cmb_DevicePosition.Items.Add(_row[1]); } } }
private void DeviceAuthorize_Load(object sender, EventArgs e) { DAL.DAL_Device devicedal = new DAL.DAL_Device(); DAL.DAO.DeviceDao devicedao = devicedal.selectDeviceInfoWithID(deviceid); this.lab_DeviceName.Text = devicedao.Devicename; this.lab_DevceType.Text = devicedao.Devicetype; this.lab_Position.Text = devicedao.Deviceposition; GetDeviceAuthrizeList(""); }
private void DeviceAuthorize_Load(object sender, EventArgs e) { LoadLanguage(""); DAL.DAL_Device devicedal = new DAL.DAL_Device(); DAL.DAO.DeviceDao devicedao = devicedal.selectDeviceInfoWithID(deviceid); this.lab_DeviceName.Text = devicedao.Devicename; this.lab_DevceType.Text = devicedao.Devicetype; this.lab_Position.Text = devicedao.Deviceposition; DAL.DAL_Group groupdal = new DAL.DAL_Group(); DataTable _dt = groupdal.selectGroupListInfo(); GetDeviceAuthorizeList(""); }