Beispiel #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);
            }
        }
Beispiel #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);
            }
        }