コード例 #1
0
ファイル: DevicesManageFrm.cs プロジェクト: love2fuji/DabaiNA
        /// <summary>
        /// 删除设备
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDeleteDevice_Click(object sender, EventArgs e)
        {
            try
            {
                string deviceID = comboBoxDeleteDevice.GetItemText(comboBoxDeleteDevice.SelectedValue);

                if (deviceID.Length >= 36)
                {
                    string reslut = DevicesManageServer.DeleteDirectlyConnectedDevice(deviceID);
                    if (string.IsNullOrEmpty(reslut))
                    {
                        Runtime.ShowLog("删除设备成功:");
                    }

                    int deviceNumber = DeviceManageDAL.DeleteOneDevice(deviceID);
                    Runtime.ShowLog("删除" + deviceNumber + "设备");
                }
            }
            catch (Exception ex)
            {
                Runtime.ShowLog("!!!删除设备失败 !!! 详细:" + ex.Message);
            }
        }