Пример #1
0
        protected override void ExecuteMethod()
        {
            using (var fdb = new FolderBrowserDialog())
            {
                var result = fdb.ShowDialog();
                if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fdb.SelectedPath))
                {
                    var taskPath = fdb.SelectedPath;
                    foreach (var requrement in ViewModel.TechnicalRequrementsTaskWrapper.Requrements.Where(x => x.IsActual.HasValue && x.IsActual.Value))
                    {
                        var reqDirName = $"{requrement.Model.Id} {requrement.SalesUnit.Product.Designation.ReplaceUncorrectSimbols().LimitLengh()} ({requrement.Amount} רע.)";
                        var dirPath    = Path.Combine(taskPath, reqDirName);
                        _fileManagerService.CreateDirectoryPathIfNotExists(dirPath);

                        foreach (var file in requrement.Files.Where(technicalRequrementsFileWrapper => technicalRequrementsFileWrapper.IsActual))
                        {
                            var    storageDirectory = GlobalAppProperties.Actual.TechnicalRequrementsFilesPath;
                            string addToFileName    = $"{file.Name.ReplaceUncorrectSimbols().LimitLengh()}";
                            FilesStorageService.CopyFileFromStorage(file.Id, storageDirectory, dirPath, addToFileName, false);
                        }
                    }

                    Process.Start(taskPath);
                }
            }
        }
        protected override void ExecuteMethod()
        {
            var    storageDirectory = GlobalAppProperties.Actual.TechnicalRequrementsFilesAnswersPath;
            string addToFileName    = $"{ViewModel.SelectedAnswerFile.Name.ReplaceUncorrectSimbols().LimitLengh()}";

            FilesStorageService.CopyFileFromStorage(ViewModel.SelectedAnswerFile.Id, storageDirectory, addToFileName: addToFileName);
        }
        protected override void ExecuteMethod()
        {
            using (var fdb = new FolderBrowserDialog())
            {
                var result = fdb.ShowDialog();
                if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fdb.SelectedPath))
                {
                    var targetDirectoryPath = fdb.SelectedPath;

                    foreach (var answerFile in ViewModel.TechnicalRequrementsTaskWrapper.AnswerFiles)
                    {
                        var    storageDirectory = GlobalAppProperties.Actual.TechnicalRequrementsFilesAnswersPath;
                        string addToFileName    = $"{answerFile.Name.ReplaceUncorrectSimbols().LimitLengh()}";
                        FilesStorageService.CopyFileFromStorage(answerFile.Id, storageDirectory, targetDirectoryPath, addToFileName, false);
                    }

                    Process.Start("explorer.exe", targetDirectoryPath);
                }
            }
        }
        protected override void ExecuteMethod()
        {
            var storageDirectory = GlobalAppProperties.Actual.ShippingCostFilesPath;

            FilesStorageService.CopyFileFromStorage(ViewModel.SelectedShippingCalculationFile.Id, storageDirectory);
        }