Exemplo n.º 1
0
        void labelX1_MouseClick(object sender, MouseEventArgs e)
        {
            switch (Singleton.Instance.EditDeviceMode)
            {
            case DataMonitor.DQ.Infrastructure.EditDeviceMode.Update:

                var editDeviceForm = new EditDeviceForm(_deviceitem.Device);
                editDeviceForm.EditComplete += editDeviceForm_EditComplete;
                editDeviceForm.ShowDialog();

                break;

            case DataMonitor.DQ.Infrastructure.EditDeviceMode.Delete:
                if (MessageBox.Show("确定要删除删除当前监测点吗?", "删除确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    DeviceService.DeleteDevice(this._deviceitem.Device.Id);
                    if (RemodeComplete != null)
                    {
                        RemodeComplete(this);
                    }
                }
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> DeleteDevice(int id)
        {
            bool success = await _service.DeleteDevice(id);

            if (success)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }