예제 #1
0
        private void Save()
        {
            #region Check input
            if (this.cbFTTAR.Text.ToString() == FileInGeneralParams.InFileTreatTypeAfterRead.Move.ToString())
            {
                if (this.tbFilePathForMove.Text == this.tbFilePath.Text)
                {
                    throw new Exception("File Path is not allow identical to file path for move!");
                }
            }
            #endregion
            #region Server File parameter
            FileInGeneralParams gp = FileInboundAdapterConfigMgt.FileInAdapterConfig.InGeneralParams;
            gp.TimerInterval          = Convert.ToInt32(this.mtbTimerInterval.Text);
            gp.FilePath               = this.tbFilePath.Text;
            gp.FilePrefix             = this.tbFilePrefix.Text;
            gp.FileSuffix             = this.tbFileSuffix.Text;
            gp.InFileMovePath         = this.tbFilePathForMove.Text;
            gp.FileTreatTypeAfterRead = (FileInGeneralParams.InFileTreatTypeAfterRead)System.Enum.Parse(typeof(FileInGeneralParams.InFileTreatTypeAfterRead), this.cbFTTAR.Text);
            #endregion

            string codePageName = ComboxLoader.GetEncoding(this.cbCodePage);
            FileInboundAdapterConfigMgt.FileInAdapterConfig.InGeneralParams.CodePageName = codePageName;

            string FileName = Application.StartupPath + "\\" + FileInboundAdapterConfigMgt.FileName;
            if (!FileInboundAdapterConfigMgt.Save(FileName))
            {
                if (FileInboundAdapterConfigMgt.LastException != null)
                {
                    Program.log.Write(LogType.Error, "Cannot Save information to Configuration file: " + FileName);
                }
                MessageBox.Show(FileInboundAdapterConfigMgt.LastException.Message);
            }
        }
예제 #2
0
        public FFileOutConfig()
        {
            InitializeComponent();
            ComboxLoader.LoadEncoding(this.cbCodePage);
            Initialization();

            this.btLoadDefault.Visible = Program.bRunSingle;
        }
예제 #3
0
        private void Initialization()
        {
            channelSet = FileInboundAdapterConfigMgt.FileInAdapterConfig.InboundChanels;
            LUTableSet = FileInboundAdapterConfigMgt.FileInAdapterConfig.LookupTables;

            FillCombox();

            #region ServerFileParameters
            FileInGeneralParams gp = FileInboundAdapterConfigMgt.FileInAdapterConfig.InGeneralParams;
            this.mtbTimerInterval.Text  = gp.TimerInterval.ToString();
            this.tbFilePath.Text        = gp.FilePath;
            this.tbFilePrefix.Text      = gp.FilePrefix;
            this.tbFileSuffix.Text      = gp.FileSuffix;
            this.tbFilePathForMove.Text = gp.InFileMovePath;
            this.cbFTTAR.Text           = gp.FileTreatTypeAfterRead.ToString();
            #endregion
            #region Channel
            if (channelSet != null)
            {
                if (channelSet.Count != 0)
                {
                    ShowChannelSetInformation();
                }
                channelIndex = -1;     //It sign that there is no channel in the channelset
            }
            else
            {
                //Never occur as FileInAdapterConfigMgt.FileInAdapterConfig was be constuctured
                channelSet = new XCollection <FileInChannel>();
            }
            #endregion
            #region Look up tables
            if (LUTableSet != null)
            {
                if (LUTableSet.Count != 0)
                {
                    ShowLUTableSetInformation();
                }
                tableIndex = -1;     //It sign that there is no channel in the channelset
            }
            else
            {
                //Never occur as FileInAdapterConfigMgt.FileInAdapterConfig was be constuctured
                LUTableSet = new XCollection <LookupTable>();
            }
            #endregion

            string codePageName = FileInboundAdapterConfigMgt.FileInAdapterConfig.InGeneralParams.CodePageName;
            ComboxLoader.SetEncoding(this.cbCodePage, codePageName);
        }
예제 #4
0
        private void Save()
        {
            #region Server File parameter
            FileOutGeneralParams gp = FileOutboundAdapterConfigMgt.FileOutAdapterConfig.OutGeneralParams;
            gp.TimerInterval = Convert.ToInt32(this.mtbTimerInterval.Text);
            gp.FilePath      = this.tbFilePath.Text;
            gp.FilePrefix    = this.tbFilePrefix.Text;
            gp.FileSuffix    = this.tbFileSuffix.Text;
            gp.FileDtFormat  = this.tbFileDTFormat.Text;
            #endregion

            string codePageName = ComboxLoader.GetEncoding(this.cbCodePage);
            FileOutboundAdapterConfigMgt.FileOutAdapterConfig.OutGeneralParams.CodePageName = codePageName;

            string FileName = Application.StartupPath + "\\" + FileOutboundAdapterConfigMgt.FileName;
            if (!FileOutboundAdapterConfigMgt.Save(FileName))
            {
                if (FileOutboundAdapterConfigMgt.LastException != null)
                {
                    Program.log.Write(LogType.Error, "Cannot save information to configuration file: " + FileName);
                }
                MessageBox.Show(FileOutboundAdapterConfigMgt.LastException.Message);
            }
        }