Пример #1
0
        /// <summary>
        /// 수정 버튼 클릭
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UpdateBtn_Click(object sender, EventArgs e)
        {
            if (this.DeviceLV.SelectedItems.Count == 0)
            {
                MessageBox.Show("수정할 장비를 선택하세요.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else if (this.DeviceLV.SelectedItems.Count > 1)
            {
                MessageBox.Show("한개의 장비를 선택하세요.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else if (this.DeviceLV.SelectedItems.Count == 1)
            {
                DeviceBase tmpDeviceBase = this.deviceMng.GetDevice(this.DeviceLV.SelectedItems[0].Name);

                if (tmpDeviceBase != null)
                {
                    using (DeviceAddForm deviceAdd = new DeviceAddForm(this.deviceMng, tmpDeviceBase))
                    {
                        deviceAdd.OnDeviceUpdateSuccessEvt += new EventHandler <DeviceUpdateSuccessEventArgs>(deviceAdd_OnDeviceUpdateSuccessEvt);
                        deviceAdd.ShowDialog();
                        deviceAdd.OnDeviceUpdateSuccessEvt -= new EventHandler <DeviceUpdateSuccessEventArgs>(deviceAdd_OnDeviceUpdateSuccessEvt);
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// 등록 버튼 클릭
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AddBtn_Click(object sender, EventArgs e)
 {
     using (DeviceAddForm deviceAdd = new DeviceAddForm(this.deviceMng))
     {
         deviceAdd.OnDeviceAddSuccessEvt += new EventHandler <DeviceAddSuccessEventArgs>(deviceAdd_OnDeviceAddSuccessEvt);
         deviceAdd.ShowDialog();
         deviceAdd.OnDeviceAddSuccessEvt -= new EventHandler <DeviceAddSuccessEventArgs>(deviceAdd_OnDeviceAddSuccessEvt);
     }
 }