// GET: /<controller>/
        public IActionResult Index()
        {
            var pvm = new ProcessViewModel();

            pvm.ExcelFiles = dropBox.ListFolder(excelIn, false, true, ".xls");
            pvm.DXFFiles   = dropBox.ListFolder(excelIn, false, true, ".dxf");

            return(View("~/Views/Home/Process.cshtml", pvm));
        }
Exemple #2
0
        public static string[] GatherFromFiles(Pizdificator pizdificator, DropBoxBase dropBoxClient, string ai, string ap, string f)
        {
            var result = new List <string>();

            result.Add($"{f}/{pizdificator.NrCadGeneral}.pdf");



            pizdificator.IndecsiProprietari?.ForEach(x =>
            {
                if (dropBoxClient.FolderExists($"{ai}/{x}"))
                {
                    var files = dropBoxClient.ListFolder($"{ai}/{x}/", false, true).OrderBy(y => y);

                    files.ToList().ForEach(y => result.Add($"{ai}/{x}/{y}"));
                }
            });


            pizdificator.IndecsiActe?.ForEach(x =>
            {
                if (dropBoxClient.FolderExists($"{ap}/{x}"))
                {
                    var files = dropBoxClient.ListFolder($"{ap}/{x}/", false, true).OrderBy(y => y);

                    files.ToList().ForEach(y => result.Add($"{ap}/{x}/{y}"));
                }

                if (dropBoxClient.FileExists($"{ap}/{x}.pdf"))
                {
                    result.Add($"{ap}/{x}.pdf");
                }
            });

            return(result.ToArray());
        }
Exemple #3
0
        public static void Export(CadSysContext context, DropBoxBase dropBoxClient, string ai, string ap, string f, string o)
        {
            dropBoxClient.Delete(o);
            dropBoxClient.CreateFolder(o);
            CreateOutputDir();

            var fise = dropBoxClient.ListFolder(f, false, true, ".pdf");

            //Parallel.ForEach(fise, new ParallelOptions { MaxDegreeOfParallelism = 4 }, x =>
            fise.ToList().ForEach(x =>
            {
                Pizdificator pizd;
                pizd = GatherFromContext(context, Path.GetFileNameWithoutExtension(x));

                var files = GatherFromFiles(pizd, dropBoxClient, ai, ap, f);

                AggregateAndExport(dropBoxClient, $"{outputLocalDir}/{Path.GetFileName(x)}", o, files);
            });
        }