Exemplo n.º 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);
        }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }