//修改母线 private void button7_Click(object sender, EventArgs e) { if (GeneratrixView.SelectedRows.Count > 0 && ValidateData.CellIsNullOrZero(GeneratrixView.SelectedRows[0].Cells["GeneratrixID"])) { Generatrix theGeneratrix = new Generatrix(); theGeneratrix.GeneratrixName = GeneratrixView.SelectedRows[0].Cells["GeneratrixName"].Value.ToString(); theGeneratrix.GeneratrixNumber = GeneratrixView.SelectedRows[0].Cells["GeneratrixNumber"].Value.ToString(); theGeneratrix.GeneratrixID = GeneratrixView.SelectedRows[0].Cells["GeneratrixID"].Value.ToString(); theGeneratrix.GeneratrixToID = GeneratrixView.SelectedRows[0].Cells["GeneratrixToID"].Value.ToString(); MsgGeneratrix theGeneratrixHandel = new MsgGeneratrix(theGeneratrix); theGeneratrixHandel.Text = "修改变母线"; theGeneratrixHandel.isAddOrUpdate = 1; theGeneratrixHandel.ShowDialog(); } else { HandelControls.Msg("请选择要修改的数据", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//修改线路 private void button10_Click(object sender, EventArgs e) { if (CircuitView.SelectedRows.Count > 0 && ValidateData.CellIsNullOrZero(CircuitView.SelectedRows[0].Cells["CircuitID"])) { Circuit theCircuit = new Circuit(); theCircuit.CircuitName = CircuitView.SelectedRows[0].Cells["CircuitName"].Value.ToString(); theCircuit.CircuitID = CircuitView.SelectedRows[0].Cells["CircuitID"].Value.ToString(); theCircuit.CircuitNumber = CircuitView.SelectedRows[0].Cells["CircuitNumber"].Value.ToString(); theCircuit.CircuitToID = CircuitView.SelectedRows[0].Cells["CircuitToID"].Value.ToString(); MsgCircuit theMsgCircuit = new MsgCircuit(theCircuit); theMsgCircuit.Text = "修改线路"; theMsgCircuit.isAddOrUpdate = 1; theMsgCircuit.ShowDialog(); } else { HandelControls.Msg("请选择要修改的数据", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//修改变电站 private void button4_Click(object sender, EventArgs e) { if (ConvertingStationView.SelectedRows.Count > 0 && ValidateData.CellIsNullOrZero(ConvertingStationView.SelectedRows[0].Cells["stationID"])) { ConvertingStation content = new ConvertingStation() { stationName = ConvertingStationView.SelectedRows[0].Cells["stationName"].Value.ToString(), stationID = ConvertingStationView.SelectedRows[0].Cells["stationID"].Value.ToString(), stationRemarks = ConvertingStationView.SelectedRows[0].Cells["stationRemarks"].Value.ToString() }; MsgConvertingStation theConvertingStationHandel = new MsgConvertingStation(content); theConvertingStationHandel.Text = "修改变电站"; theConvertingStationHandel.isAddOrUpdate = 1; theConvertingStationHandel.ShowDialog(); } else { HandelControls.Msg("请选择要修改的数据", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//修改设备 private void button15_Click(object sender, EventArgs e) { if (DeviceDataView.SelectedRows.Count > 0 && ValidateData.CellIsNullOrZero(DeviceDataView.SelectedRows[0].Cells["DeviceDataID"])) { DeviceDataSetting theDeviceDataSetting = new DeviceDataSetting(); theDeviceDataSetting.DeviceDataName = DeviceDataView.SelectedRows[0].Cells["DeviceDataName"].Value.ToString(); theDeviceDataSetting.DeviceDataID = DeviceDataView.SelectedRows[0].Cells["DeviceDataID"].Value.ToString(); theDeviceDataSetting.RemoteAToID = DeviceDataView.SelectedRows[0].Cells["RemoteAToID"].Value.ToString(); theDeviceDataSetting.RemoteBToID = DeviceDataView.SelectedRows[0].Cells["RemoteBToID"].Value.ToString(); theDeviceDataSetting.RemoteCToID = DeviceDataView.SelectedRows[0].Cells["RemoteCToID"].Value.ToString(); theDeviceDataSetting.DeviceDataToID = DeviceDataView.SelectedRows[0].Cells["DeviceDataToID"].Value.ToString(); MsgDeviceSetting theMsgDeviceSetting = new MsgDeviceSetting(theDeviceDataSetting); theMsgDeviceSetting.Text = "修改设备"; theMsgDeviceSetting.isAddOrUpdate = 1; theMsgDeviceSetting.ShowDialog(); } else { HandelControls.Msg("请选择要修改的数据", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//修改检测点 private void button13_Click(object sender, EventArgs e) { if (DetectionView.SelectedRows.Count > 0 && ValidateData.CellIsNullOrZero(DetectionView.SelectedRows[0].Cells["DetectionID"])) { Detection theDetection = new Detection(); theDetection.DetectionID = DetectionView.SelectedRows[0].Cells["DetectionID"].Value.ToString(); theDetection.DetectionName = DetectionView.SelectedRows[0].Cells["DetectionName"].Value.ToString(); theDetection.DetectionNumber = DetectionView.SelectedRows[0].Cells["DetectionNumber"].Value.ToString(); theDetection.DetectionToSecondID = DetectionView.SelectedRows[0].Cells["DetectionToSecondID"].Value.ToString(); theDetection.RemoteA = DetectionView.SelectedRows[0].Cells["RemoteA"].Value.ToString(); theDetection.RemoteB = DetectionView.SelectedRows[0].Cells["RemoteB"].Value.ToString(); theDetection.RemoteC = DetectionView.SelectedRows[0].Cells["RemoteC"].Value.ToString(); theDetection.DetectionToID = DetectionView.SelectedRows[0].Cells["DetectionToID"].Value.ToString(); theDetection.DetectionToName = DetectionView.SelectedRows[0].Cells["DetectionToName"].Value.ToString(); MsgDetection theMsgDetection = new MsgDetection(theDetection); theMsgDetection.Text = "修改检测点"; theMsgDetection.isAddOrUpdate = 1; theMsgDetection.ShowDialog(); } else { HandelControls.Msg("请选择要修改的数据", MessageBoxButtons.OK, MessageBoxIcon.Error); } }