private void butDelete_Click(object sender, EventArgs e) { if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete Segment?")) { return; } for (int f = 0; f < HL7DefSegCur.hl7DefFields.Count; f++) { HL7DefFields.Delete(HL7DefSegCur.hl7DefFields[f].HL7DefFieldNum); } HL7DefSegments.Delete(HL7DefSegCur.HL7DefSegmentNum); DialogResult = DialogResult.OK; }
private void butDelete_Click(object sender, EventArgs e) { //This button is only enabled if this is a custom def. if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete entire HL7Def?")) { return; } for (int m = 0; m < HL7DefCur.hl7DefMessages.Count; m++) { for (int s = 0; s < HL7DefCur.hl7DefMessages[m].hl7DefSegments.Count; s++) { for (int f = 0; f < HL7DefCur.hl7DefMessages[m].hl7DefSegments[s].hl7DefFields.Count; f++) { HL7DefFields.Delete(HL7DefCur.hl7DefMessages[m].hl7DefSegments[s].hl7DefFields[f].HL7DefFieldNum); } HL7DefSegments.Delete(HL7DefCur.hl7DefMessages[m].hl7DefSegments[s].HL7DefSegmentNum); } HL7DefMessages.Delete(HL7DefCur.hl7DefMessages[m].HL7DefMessageNum); } HL7Defs.Delete(HL7DefCur.HL7DefNum); DataValid.SetInvalid(InvalidType.HL7Defs); DialogResult = DialogResult.OK; }