Exemple #1
0
        private ExportFileData CreateVmiData(string[] elements)
        {
            ExportFileData data = CreateMainData(elements);

            data.VorgangsID = elements[(int)ExportDataPattern.ExportDataIndex.VorgansID];
            if (elements.Length == 6)
            {
                data.VermittlerID = elements[(int)ExportDataPattern.ExportDataIndex.VermittlerID];
            }

            return(data);
        }
Exemple #2
0
        /// <summary>
        /// builds an ExportFileData object from the name of a file
        /// </summary>
        /// <param name="exportFileName">name of a file</param>
        /// <returns></returns>
        public ExportFileData BuildDataFromFileName(string exportFileName)
        {
            ExportFileData exportFileData = null;

            string[] elements = exportFileName.RemoveFileExtension().Split('_');

            IExportDataPattern pattern = new EmlExportDataPattern();

            if (pattern.IsValid(elements))
            {
                exportFileData = CreateMainData(elements);
            }

            pattern = new VmiExportDataPattern();
            if (pattern.IsValid(elements))
            {
                exportFileData = CreateVmiData(elements);
            }

            return(exportFileData);
        }
        /// <summary>
        /// extracts data from the filename and
        /// </summary>
        public void BuilData()
        {
            ExportFileDataBuilder dataBuilder = new ExportFileDataBuilder();

            Data = dataBuilder.BuildDataFromFileName(File.Name);
        }