Beispiel #1
0
        public bool ValidateConfig()
        {
            Program.Context.ConfigMgr.Config.SocketConfig.Port         = (int)this.numericUpDownPort.Value;
            Program.Context.ConfigMgr.Config.SocketConfig.CodePageName = CodePageHelper.GetEncoding(this.comboBoxCodePage);

            if (this.checkBoxMultipleSession.CheckState != CheckState.Indeterminate &&
                this.checkBoxDisableMLLP.CheckState != CheckState.Indeterminate)
            {
                bool multiSession = this.checkBoxMultipleSession.Checked;
                bool noMLLP       = this.checkBoxDisableMLLP.Checked;
                if (multiSession)
                {
                    if (noMLLP)
                    {
                        Program.Context.ConfigMgr.Config.SocketConfig.SocketWorkerType = SocketWorkerWithLongConnectionNoMLLP.DEVICE_NAME;
                    }
                    else
                    {
                        Program.Context.ConfigMgr.Config.SocketConfig.SocketWorkerType = SocketWorkerWithLongConnection.DEVICE_NAME;
                    }
                }
                else
                if (noMLLP)
                {
                    Program.Context.ConfigMgr.Config.SocketConfig.SocketWorkerType = SocketWorkerNoMLLP.DEVICE_NAME;
                }
                else
                {
                    Program.Context.ConfigMgr.Config.SocketConfig.SocketWorkerType = SocketWorker.DEVICE_NAME;
                }
            }

            Program.Context.ConfigMgr.Config.MessageProcessingType = (MessageProcessType)this.comboBoxProcessingType.SelectedIndex;
            return(true);
        }
Beispiel #2
0
        public FormConfig()
        {
            InitializeComponent();

            CodePageHelper.LoadEncoding(this.comboBoxCodePage);

            LoadConfig();
        }
Beispiel #3
0
 public bool ValidateConfig()
 {
     Program.Context.ConfigMgr.Config.OutputFileFolder      = this.textBoxOutputFolder.Text.Trim();
     Program.Context.ConfigMgr.Config.FileExtension         = this.textBoxExtension.Text.Trim();
     Program.Context.ConfigMgr.Config.CodePageName          = CodePageHelper.GetEncoding(this.comboBoxCodePage);
     Program.Context.ConfigMgr.Config.OrganizationMode      = (FileOrganizationMode)this.comboBoxOrganizeMode.SelectedIndex;
     Program.Context.ConfigMgr.Config.MessageProcessingType = (MessageProcessType)this.comboBoxProcessingType.SelectedIndex;
     return(true);
 }
Beispiel #4
0
        public bool LoadConfig()
        {
            this.textBoxOutputFolder.Text = Program.Context.ConfigMgr.Config.OutputFileFolder;
            this.textBoxExtension.Text    = Program.Context.ConfigMgr.Config.FileExtension;
            CodePageHelper.SetEncoding(this.comboBoxCodePage, Program.Context.ConfigMgr.Config.CodePageName);
            this.comboBoxOrganizeMode.SelectedIndex   = (int)Program.Context.ConfigMgr.Config.OrganizationMode;
            this.comboBoxProcessingType.SelectedIndex = (int)Program.Context.ConfigMgr.Config.MessageProcessingType;

            return(true);
        }
        public void SerializableAddressToMailAddress()
        {
            var serializableAddress = new SerializableAddress(address, displayName, displayNameEncoding);
            //implicit conversion
            MailAddress mailAddress = serializableAddress;
            var         codePage    = CodePageHelper.GetCodePage(mailAddress);

            Assert.IsTrue(codePage.HasValue);
            Assert.AreEqual(codePage.Value, displayNameEncoding.CodePage);
            Assert.AreEqual(mailAddress.Address, serializableAddress.Address);
            Assert.AreEqual(mailAddress.DisplayName, serializableAddress.DisplayName);
        }
Beispiel #6
0
        public bool ValidateConfig()
        {
            string ipAddress = this.textBoxIP.Text.Trim();

            if (ipAddress.Length > 0)
            {
                Program.Context.ConfigMgr.Config.SocketConfig.IPAddress = ipAddress;
            }
            else
            {
                MessageBox.Show(this,
                                "Please input the HL7 receiver IP address.",
                                this.Text,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return(false);
            }

            Program.Context.ConfigMgr.Config.SocketConfig.Port         = (int)this.numericUpDownPort.Value;
            Program.Context.ConfigMgr.Config.SocketConfig.CodePageName = CodePageHelper.GetEncoding(this.comboBoxCodePage);
            //Program.Context.ConfigMgr.Config.SocketConfig.SocketClientType = this.checkBoxMultipleSession.Checked ? SocketClientWithLongConnection.DEVICE_NAME : SocketClient.DEVICE_NAME;
            Program.Context.ConfigMgr.Config.MessageProcessingType = (MessageProcessType)this.comboBoxProcessingType.SelectedIndex;

            if (this.checkBoxMultipleSession.CheckState != CheckState.Indeterminate &&
                this.checkBoxDisableMLLP.CheckState != CheckState.Indeterminate)
            {
                bool multiSession = this.checkBoxMultipleSession.Checked;
                bool noMLLP       = this.checkBoxDisableMLLP.Checked;
                if (multiSession)
                {
                    if (noMLLP)
                    {
                        Program.Context.ConfigMgr.Config.SocketConfig.SocketClientType = SocketClientWithLongConnectionNoMLLP.DEVICE_NAME;
                    }
                    else
                    {
                        Program.Context.ConfigMgr.Config.SocketConfig.SocketClientType = SocketClientWithLongConnection.DEVICE_NAME;
                    }
                }
                else
                if (noMLLP)
                {
                    Program.Context.ConfigMgr.Config.SocketConfig.SocketClientType = SocketClientNoMLLP.DEVICE_NAME;
                }
                else
                {
                    Program.Context.ConfigMgr.Config.SocketConfig.SocketClientType = SocketClient.DEVICE_NAME;
                }
            }

            return(true);
        }
Beispiel #7
0
        public bool LoadConfig()
        {
            this.textBoxINFolder.Text                 = Program.Context.ConfigMgr.Config.FileInboundFolder;
            this.textBoxTimeInterval.Value            = (Decimal)Program.Context.ConfigMgr.Config.TimerInterval;
            this.comboBoxProcessingType.SelectedIndex = (int)Program.Context.ConfigMgr.Config.MessageProcessingType;
            this.textBoxFileExtension.Text            = Program.Context.ConfigMgr.Config.FileExtension;
            CodePageHelper.SetEncoding(this.comboBoxCodePage, Program.Context.ConfigMgr.Config.EncodeName);

            this.comboBoxDispose.Text      = Enum.GetName(typeof(FileDisposeType), Program.Context.ConfigMgr.Config.SourceFileDisposeType);
            this.textBoxDisposeFolder.Text = Program.Context.ConfigMgr.Config.FileOutboundFolder;

            return(true);
        }
Beispiel #8
0
        public bool ValidateConfig()
        {
            if (this.textBoxINFolder.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Please input file folder.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.textBoxINFolder.Focus();
                return(false);
            }

            if (!Directory.Exists(this.textBoxINFolder.Text))
            {
                MessageBox.Show("File folder don't exists.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.textBoxINFolder.Focus();
                return(false);
            }

            if (this.textBoxFileExtension.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Please input file extension.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.textBoxFileExtension.Focus();
                return(false);
            }

            if (this.textBoxDisposeFolder.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Please input result output folder.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.textBoxDisposeFolder.Focus();
                return(false);
            }

            if (!Directory.Exists(this.textBoxDisposeFolder.Text))
            {
                MessageBox.Show("Output folder don't exists.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.textBoxDisposeFolder.Focus();
                return(false);
            }

            Program.Context.ConfigMgr.Config.FileInboundFolder     = this.textBoxINFolder.Text.Trim();
            Program.Context.ConfigMgr.Config.TimerInterval         = (double)this.textBoxTimeInterval.Value;
            Program.Context.ConfigMgr.Config.MessageProcessingType = (MessageProcessType)this.comboBoxProcessingType.SelectedIndex;
            Program.Context.ConfigMgr.Config.FileExtension         = this.textBoxFileExtension.Text.Trim();
            Program.Context.ConfigMgr.Config.EncodeName            = CodePageHelper.GetEncoding(this.comboBoxCodePage);

            Program.Context.ConfigMgr.Config.SourceFileDisposeType = (FileDisposeType)Enum.Parse(typeof(FileDisposeType), this.comboBoxDispose.Text);
            Program.Context.ConfigMgr.Config.FileOutboundFolder    = this.textBoxDisposeFolder.Text.Trim();

            return(true);
        }
Beispiel #9
0
        public bool LoadConfig()
        {
            this.textBoxIP.Text          = Program.Context.ConfigMgr.Config.SocketConfig.IPAddress;
            this.numericUpDownPort.Value = Program.Context.ConfigMgr.Config.SocketConfig.Port;
            CodePageHelper.SetEncoding(this.comboBoxCodePage, Program.Context.ConfigMgr.Config.SocketConfig.CodePageName);
            this.comboBoxCodePage.Enabled = Program.Context.ConfigMgr.Config.SocketConfig.CodePageCode < 0;

            //this.checkBoxMultipleSession.Checked = Program.Context.ConfigMgr.Config.SocketConfig.SocketClientType == SocketClientWithLongConnection.DEVICE_NAME;
            this.comboBoxProcessingType.SelectedIndex = (int)Program.Context.ConfigMgr.Config.MessageProcessingType;

            switch (Program.Context.ConfigMgr.Config.SocketConfig.SocketClientType)
            {
            case SocketClient.DEVICE_NAME:
                this.checkBoxDisableMLLP.Checked     = false;
                this.checkBoxMultipleSession.Checked = false;
                break;

            case SocketClientWithLongConnection.DEVICE_NAME:
                this.checkBoxDisableMLLP.Checked     = false;
                this.checkBoxMultipleSession.Checked = true;
                break;

            case SocketClientNoMLLP.DEVICE_NAME:
                this.checkBoxDisableMLLP.Checked     = true;
                this.checkBoxMultipleSession.Checked = false;
                break;

            case SocketClientWithLongConnectionNoMLLP.DEVICE_NAME:
                this.checkBoxDisableMLLP.Checked     = true;
                this.checkBoxMultipleSession.Checked = true;
                break;

            default:
                this.checkBoxMultipleSession.CheckState = CheckState.Indeterminate;
                this.checkBoxDisableMLLP.CheckState     = CheckState.Indeterminate;
                break;
            }

            return(true);
        }
Beispiel #10
0
        private void InitializePage()
        {
            this.comboBoxDispose.DataSource = Enum.GetNames(typeof(FileDisposeType));

            CodePageHelper.LoadEncoding(this.comboBoxCodePage);
        }