Exemplo n.º 1
0
 public static bool Load(string fileName)
 {
     try
     {
         using (StreamReader sr = File.OpenText(fileName))
         {
             string strXml = sr.ReadToEnd();
             _FileInAdapterConfig = XObjectManager.CreateObject(strXml, typeof(FileInboundAdapterConfig)) as FileInboundAdapterConfig;
             return(_FileInAdapterConfig != null);
         }
     }
     catch (Exception err)
     {
         _lastError = err;
         return(false);
     }
 }
Exemplo n.º 2
0
        public static bool LoadDefault()
        {
            _FileInAdapterConfig = new FileInboundAdapterConfig();

            //General
            _FileInAdapterConfig.InGeneralParams.FilePath               = "C:\\FILEIN";
            _FileInAdapterConfig.InGeneralParams.FilePrefix             = "";
            _FileInAdapterConfig.InGeneralParams.FileSuffix             = ".ini";
            _FileInAdapterConfig.InGeneralParams.FileTreatTypeAfterRead = FileInGeneralParams.InFileTreatTypeAfterRead.Move;
            _FileInAdapterConfig.InGeneralParams.InFileMovePath         = "C:\\FILEIN\\MOVE";
            _FileInAdapterConfig.InGeneralParams.TimerEnable            = true;
            _FileInAdapterConfig.InGeneralParams.TimerInterval          = 30000;

            //inbound channel
            _FileInAdapterConfig.InboundChanels.Add(BuildPatientChannel());
            _FileInAdapterConfig.InboundChanels.Add(BuildOrderChannel());
            _FileInAdapterConfig.InboundChanels.Add(BuildReportChannel());

            return(true);
        }