Ejemplo n.º 1
0
        private async void button_Get_Click(object sender, EventArgs e)
        {
            PowerControl vPowerControl = new PowerControl();
            bool         vResult       = await vPowerControl.GetControlInfo(DianYuanID);

            if (vResult)
            {
                SwitchTable = WatchHouse.GetSwitchTable(DianYuanID);
                DataView vDataView = SwitchTable.AsDataView();
                vDataView.Sort = "LuHao";
                dataGridView_Switch.AutoGenerateColumns = false;
                dataGridView_Switch.DataSource          = vDataView;
                MessageBox.Show("获取电源配置成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("获取电源配置失败", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }