private void CheckExistMessage() { _mappingAlreadyExist = false; GWEventType gwET = _gwEventCtrl.Value; HL7EventType hlET = _hl7EventCtrl.Value; foreach (XIMMessage msg in _messageList) { if (!_isCopyItem) { if (_message.GWEventType.Code == gwET.Code && _message.HL7EventType.Name == hlET.Name && _message.HL7EventType.Qualifier == hlET.Qualifier) { continue; } } if (_isInbound) { if (msg.GWEventType.Code == gwET.Code && msg.HL7EventType.Name == hlET.Name && msg.HL7EventType.Qualifier == hlET.Qualifier) { _mappingAlreadyExist = true; string str = "from [" + hlET.ToString() + "] to [" + gwET.ToString() + "]"; MessageBox.Show(this, "Message mapping " + str + " is already exist.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } } else { if (msg.GWEventType.Code == gwET.Code) { _mappingAlreadyExist = true; string str = "from [" + gwET.ToString() + "]"; MessageBox.Show(this, "Message mapping " + str + " is already exist.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } } } RefreshButtons(); }