示例#1
0
        public void LoadAreaAndDeviceControls()
        {
            //Fill Combobox of Area.
            HouseAreaService.HouseAreaClient _has = new HouseAreaClient();
            DevicesService.DevicesClient     _dc  = new DevicesClient();

            string[] _houseAreaIDs = _has.GetAllHouseAreasID();

            for (int i = 0; i < _houseAreaIDs.Length; i++)
            {
                string[] _houseAreaData = _has.GetHouseAreaData(_houseAreaIDs[i]);
                comboBoxAreaName.Items.Add(_houseAreaData[1]);
                _dictionaryHouseAreaIDsAndNames.Add(_houseAreaData[1], _houseAreaData[0]);
            }

            //Fill Combo Box of Device.
            string[] _deviceIDs = _dc.GetAllDevicesID();

            for (int i = 0; i < _deviceIDs.Length; i++)
            {
                string[] _deviceData = _dc.GetDeviceData(_deviceIDs[i]);
                comboBoxDeviceName.Items.Add(_deviceData[1]);
                _dictionaryDeviceIDsAndNames.Add(_deviceData[1], _deviceData[0]);
            }
        }
示例#2
0
        public void ShowDevicesAssignedToAreaSeleted()
        {
            dataGridViewAreaDevicesAssign.Rows.Clear();
            DevicesService.DevicesClient _dc = new DevicesClient();
            string[] _deviceIDs = _dc.GetAllDevicesID();

            for (int i = 0; i < _deviceIDs.Length; i++)
            {
                string[] _deviceData = _dc.GetDeviceData(_deviceIDs[i]);

                //Fill The Grid
                if (_deviceData[2] == textBoxAreaID.Text.Trim())
                {
                    dataGridViewAreaDevicesAssign.Rows.Add("1", _deviceData[2], comboBoxAreaName.SelectedItem.ToString(),
                                                           _deviceData[0], _deviceData[1]);
                }
            }
        }
示例#3
0
        public void LoadDevicesAssignedToArea()
        {
            DevicesService.DevicesClient _dc = new DevicesClient();
            _dictionaryDeviceIDsAndNames.Clear();
            comboBoxDeviceName.Items.Clear();

            string[] _deviceIDs = _dc.GetAllDevicesID();

            for (int i = 0; i < _deviceIDs.Length; i++)
            {
                string[] _deviceData = _dc.GetDeviceData(_deviceIDs[i]);

                if (_deviceData[2] == textBoxAreaID.Text.Trim())
                {
                    comboBoxDeviceName.Items.Add(_deviceData[1]);
                    _dictionaryDeviceIDsAndNames.Add(_deviceData[1], _deviceData[0]);
                }
            }
        }