Пример #1
0
        //수정 버튼 클릭
        private void UpdateBtn_Click(object sender, EventArgs e)
        {
            if (this.WDeviceLV.SelectedItems.Count != 1)
            {
                MessageBox.Show("수정할 한 개의 측기를 선택하세요.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (this.addWDevice = new AddWDevice())
            {
                this.addWDevice.Mode = 1;
                WDevice wd = this.dataMng.GetWDevice(uint.Parse(this.WDeviceLV.SelectedItems[0].Name));
                this.addWDevice.WDivision = string.Format("{0}({1})",
                                                          this.dataMng.GetTypeDevice(wd.TypeDevice).Name,
                                                          this.dataMng.GetTypeDevice(wd.TypeDevice).Remark);
                this.addWDevice.WDIDTB        = wd.ID;
                this.addWDevice.WDNameTB      = wd.Name;
                this.addWDevice.WDTelTB       = wd.CellNumber;
                this.addWDevice.WDPKID        = this.WDeviceLV.SelectedItems[0].Name;
                this.addWDevice.WDSensor      = wd.HaveSensor;
                this.addWDevice.WDEthernetUse = wd.EthernetUse;
                this.addWDevice.WDeviceRemark = wd.Remark;
                this.addWDevice.ShowDialog();
            }
        }
Пример #2
0
 //등록 버튼 클릭
 private void AddBtn_Click(object sender, EventArgs e)
 {
     using (this.addWDevice = new AddWDevice())
     {
         this.addWDevice.Mode = 0;
         this.addWDevice.ShowDialog();
     }
 }