private void EditBtn_Click(object sender, EventArgs e) { try { GXObisCode item = (GXObisCode)OBISCodesList.SelectedItems[0].Tag; OBISCodeForm dlg = new OBISCodeForm(((GXManufacturer)ManufacturersList.SelectedItems[0].Tag).ObisCodes, item); if (dlg.ShowDialog(this) == DialogResult.OK) { OBISCodesList.SelectedItems[0].Text = item.LogicalName + " " + item.Description; } } catch (Exception Ex) { GXDLMS.Common.Error.ShowError(this, Ex); } }
private void NewBtn_Click(object sender, EventArgs e) { try { GXObisCode item = new GXObisCode(); OBISCodeForm dlg = new OBISCodeForm(((GXManufacturer)ManufacturersList.SelectedItems[0].Tag).ObisCodes, item); if (dlg.ShowDialog(this) == DialogResult.OK) { AddItem(item); ((GXManufacturer)ManufacturersList.SelectedItems[0].Tag).ObisCodes.Add(item); } } catch (Exception Ex) { GXDLMS.Common.Error.ShowError(this, Ex); } }