Пример #1
0
        private static LocalFile GetBOFile(BOFileType type, DateTime?fileDate = null, string filePath = null)
        {
            List <string> filesPath = BOFilesHelper.GetFilePathByType(type, filePath);

            if (filesPath != null && filesPath.Count > 0)
            {
                LocalFile lf = new LocalFile();

                BOFile result = new BOFile();

                result.RetailerId   = ConfigurationHelper.RetailerId;
                result.RetailerName = ConfigurationHelper.RetailerName;
                result.FileType     = type;
                result.FileDate     = fileDate ?? DateTime.Now;
                lf.BOFile           = result;

                lf.FileContent    = BOFilesHelper.Compress(filesPath);
                result.FileLength = lf.FileContent.Length;

                return(lf);
            }
            else
            {
                Logger.LogInfo(string.Format("Couldn't find today's {0} file(s).", type), System.Diagnostics.EventLogEntryType.Warning);
                return(null);
            }
        }