示例#1
0
        private void Initialization()
        {
            channelSet = FileOutboundAdapterConfigMgt.FileOutAdapterConfig.OutboundChanels;
            LUTableSet = FileOutboundAdapterConfigMgt.FileOutAdapterConfig.LookupTables;

            #region ClientFileParameters

            FileOutGeneralParams gp = FileOutboundAdapterConfigMgt.FileOutAdapterConfig.OutGeneralParams;
            this.mtbTimerInterval.Text = gp.TimerInterval.ToString();
            this.tbFilePath.Text       = gp.FilePath;
            this.tbFilePrefix.Text     = gp.FilePrefix;
            this.tbFileSuffix.Text     = gp.FileSuffix;
            this.tbFileDTFormat.Text   = gp.FileDtFormat;
            #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 FileOutAdapterConfigMgt.FileOutAdapterConfig was be constuctured
                channelSet = new XCollection <FileOutChannel>();
            }
            #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 FileOutAdapterConfigMgt.FileOutAdapterConfig was be constuctured
                LUTableSet = new XCollection <LookupTable>();
            }
            #endregion

            string codePageName = FileOutboundAdapterConfigMgt.FileOutAdapterConfig.OutGeneralParams.CodePageName;
            ComboxLoader.SetEncoding(this.cbCodePage, codePageName);
        }
示例#2
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);
            }
        }