예제 #1
0
        private void cboxBiuldInfo2_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboxFirstLoad2)
            {
                comboxFirstLoad2 = false;
                return;
            }
            string buildName2 = cboxBiuldInfo2.GetItemText(cboxBiuldInfo2.Items[cboxBiuldInfo2.SelectedIndex]);
            string buildID2   = cboxBiuldInfo2.GetItemText(cboxBiuldInfo2.SelectedValue);

            //获取设备列表,并显示
            DataTable DeviceInfo = new DataTable();

            DeviceInfo = DeviceManageDAL.GetDeviceInfo(buildID2);
            cboxDeviceID2.DataSource    = DeviceInfo;
            cboxDeviceID2.DisplayMember = DeviceInfo.Columns[1].ColumnName;
            cboxDeviceID2.ValueMember   = DeviceInfo.Columns[0].ColumnName;
            //获取修改设备的模板信息
            DataTable DeviceModify = new DataTable();

            DeviceModify = DeviceManageDAL.GetDeviceModifyInfo(buildID2);

            if (DeviceModify == null || DeviceModify.Rows.Count == 0)
            {
                btnModifyDevice.Enabled = false;
                MessageBox.Show("所选择区域没有绑定服务器,暂时无法使用,请选择正确的区域", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                textBoxManufacturerId.Text   = DeviceModify.Rows[0]["F_ManufacturerId"].ToString();
                textBoxManufacturerName.Text = DeviceModify.Rows[0]["F_ManufacturerName"].ToString();
                textBoxDeviceType.Text       = DeviceModify.Rows[0]["F_DeviceType"].ToString();
                textBoxModel.Text            = DeviceModify.Rows[0]["F_Model"].ToString();
                textBoxProtocolType.Text     = DeviceModify.Rows[0]["F_ProtocolType"].ToString();
                Runtime.ShowLog("选择修改设备 所所区域为:" + buildName2 + "  区域代码:" + buildID2);
                btnModifyDevice.Enabled = true;
            }
        }