Ejemplo n.º 1
0
 /// <summary>
 /// Для исключения дублей в колекции
 /// Путь для анализа папки на PDF Work
 /// </summary>
 /// <param name="path"></param>
 public async void CountPdfWork(string path)
 {
     if (Directory.Exists(path))
     {
         PdfFileWork.Clear();
         UpdateOn(PdfFileWork);
         await Task.Run(delegate
         {
             var filelogica = new FileLogica();
             lock (Lock)
             {
                 var file = FileLogica.FileinfoMass("*.pdf", path);
                 foreach (var fileInfo in file)
                 {
                     PdfFileWork.Add(new PdfModelPrint
                     {
                         Icon = filelogica.Extracticonfile(fileInfo.FullName),
                         Name = fileInfo.Name,
                         Path = fileInfo.FullName
                     });
                 }
                 UpdateOff(PdfFileWork);
             }
         });
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Метод переноса из Temp в Work
 /// </summary>
 /// <param name="pathwork">Путь к рабочей папке</param>
 public async void MoveWork(string pathwork)
 {
     UpdateOn(PdfFileWork);
     UpdateOn(PdfFileTemp);
     if (!Directory.Exists(pathwork))
     {
         Directory.CreateDirectory(pathwork);
     }
     if (IsValidationTemp())
     {
         await Task.Run(delegate
         {
             PdfFileWork.Clear();
             var filelogica = new FileLogica();
             var clonedList = PdfFileTemp.Select(objEntity => (PdfModelPrint)objEntity.Clone()).ToList();
             foreach (var list in clonedList)
             {
                 File.Copy(list.Path, Path.GetFullPath(pathwork) + list.Name, true);
                 PdfFileWork.Add(new PdfModelPrint
                 {
                     Icon = filelogica.Extracticonfile(list.Path),
                     Name = list.Name,
                     Path = list.Path
                 });
             }
             PdfFileTemp.Clear();
             UpdateOff(PdfFileWork);
             UpdateOff(PdfFileTemp);
         });
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Путь для анализа папки на PDF Temp
 /// </summary>
 /// <param name="path"></param>
 public async void CountPdfTemp(string path)
 {
     try
     {
         if (Directory.Exists(path))
         {
             PdfFileTemp.Clear();
             UpdateOn(PdfFileTemp);
             var filelogica = new FileLogica();
             await Task.Run(delegate
             {
                 lock (Lock)
                 {
                     var file = FileLogica.FileinfoMass("*.pdf", path);
                     foreach (var fileInfo in file)
                     {
                         PdfFileTemp.Add(new PdfModelPrint
                         {
                             Icon = filelogica.Extracticonfile(fileInfo.FullName),
                             Name = fileInfo.Name,
                             Path = fileInfo.FullName
                         });
                     }
                 }
                 UpdateOff(PdfFileTemp);
             });
         }
     }
     catch (Exception e)
     {
         Console.Write(e);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Свойства выбранного файла для создания списка
        /// </summary>
        /// <param name="file">Файл</param>
        public void NewFileXsls(FileInfo file)
        {
            var filelogica = new FileLogica();

            Icon = filelogica.Extracticonfile(file.FullName);
            Name = file.Name;
            Path = file.FullName;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Добавление Отчета Excel
 /// </summary>
 /// <param name="pathdirectoryreport">Полный путь ук файлу</param>
 public void UpdateColectFile(string pathdirectoryreport)
 {
     if (Directory.Exists(pathdirectoryreport))
     {
         var filelogica = new FileLogica();
         ReportXlsxel.Clear();
         foreach (var file in FileLogica.FileinfoMass(pathdirectoryreport))
         {
             ReportXlsxel.Add(new ReportXlsxProperty {
                 Icon = filelogica.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName
             });
         }
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Метод добавление в Модель Объектов!!!
 /// </summary>
 /// <param name="path">Путь к файлам</param>
 public void AddXmlFile(string path)
 {
     XmlFiles.Clear();
     lock (Lock)
     {
         var filelogica = new FileLogica();
         Directory.CreateDirectory(path);
         foreach (var file in FileLogica.FileinfoMass(path))
         {
             XmlFiles.Add(new ListViewModelXmlFileGenerateProperty {
                 Icon = filelogica.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName
             });
         }
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Метод добавляющий файлы!!!
 /// </summary>
 /// <param name="pathFileXml"></param>
 public void AddFileXml(string pathFileXml)
 {
     if (Directory.Exists(pathFileXml))
     {
         var fileLogic = new FileLogica();
         XmlFileZnach.Clear();
         foreach (var file in FileLogica.FileinfoMass(pathFileXml))
         {
             XmlFileZnach.Add(new ReportJournalProperty()
             {
                 Icon = fileLogic.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName
             });
         }
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Метод добавляющий журналы!!!
 /// </summary>
 /// <param name="pathJournalXml">Путь к Журналам с ошибками</param>
 public void AddJournal(string pathJournalXml)
 {
     if (Directory.Exists(pathJournalXml))
     {
         var fileLogic = new FileLogica();
         XmlReportJournal.Clear();
         foreach (var file in FileLogica.FileinfoMass(pathJournalXml))
         {
             XmlReportJournal.Add(new ReportJournalProperty()
             {
                 Icon = fileLogic.Extracticonfile(file.FullName), Name = file.Name, Path = file.FullName, InfoFile = ModelInfoFile.FirstOrDefault(x => x.ModelNameFileXml == file.Name)?.FileInfoFile
             });
         }
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Обновление файла команда
 /// </summary>
 /// <param name="path">Путь к файлу</param>
 public void UpdateFileXml(string path)
 {
     if (File.Exists(path))
     {
         var      filelogica = new FileLogica();
         var      xmllibary  = new LibaryXMLAuto.ReadOrWrite.LogicaXml.LogicaXml();
         FileInfo file       = new FileInfo(path);
         Name  = file.Name;
         Count = xmllibary.CountAtribute(LibaryXMLAuto.ReadOrWrite.LogicaXml.LogicaXml.Document(path));
         Icon  = filelogica.Extracticonfile(file.FullName);
     }
     else
     {
         MessageBox.Show("Нет Списков для обработки по пути: " + path);
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Метод добавление файлов
        /// </summary>
        /// <param name="arrayStringNameFile">Массив имен файлов</param>
        public void AddFiles(string[] arrayStringNameFile)
        {
            var fileLogic = new FileLogica();

            foreach (var nameFile in arrayStringNameFile)
            {
                FileInfo fileInfo = new FileInfo(nameFile);
                if (fileInfo.Exists && fileInfo.Extension == ".xlsx")
                {
                    var workBook = new XLWorkbook(nameFile);
                    SchemesXlsx.Add(new ModelXlsxGenerate()
                    {
                        Icon            = fileLogic.Extracticonfile(fileInfo.FullName),
                        NameFile        = fileInfo.Name,
                        FullPathFile    = nameFile,
                        CollectionSheet = workBook.Worksheets.ToArray().Select(x => x.Name).ToList(),
                        ErrorXml        = null
                    });
                    workBook.Dispose();
                }
            }
        }