Exemplo n.º 1
0
 /// <summary>
 /// Произвести печать
 /// </summary>
 private IResultCollection <IFileDataSourceServer> StampContainerPrint(IStampContainer stampContainer, IDocumentLibrary documentLibrary,
                                                                       IFilePath filePath, IConvertingSettings convertingSettings,
                                                                       ConvertingModeType convertingModeType, ColorPrintType colorPrintType) =>
 stampContainer.GetStampsToPrint().ToResultCollectionFromApplication().
 ResultValueOkBind(signatures => StampContainerPrinting(stampContainer.GetStampsToPrint().ToResultCollectionFromApplication(),
                                                        documentLibrary, filePath, convertingSettings, convertingModeType,
                                                        colorPrintType)).
 ToResultCollection();
 public FileDataSourceServer(string filePathServer, string filePathClient, ConvertingModeType convertingModeType,
                             StampPaperSizeType paperSize, string printerName)
     : base(filePathServer, filePathClient)
 {
     PaperSize          = paperSize;
     PrinterName        = printerName;
     ConvertingModeType = convertingModeType;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Печать
 /// </summary>
 private IResultValue <IFileDataSourceServer> CreatePrintingService(IDocumentLibrary documentLibrary, IStamp stamp, IFilePath filePath,
                                                                    ConvertingModeType convertingModeType, ColorPrintType colorPrintType,
                                                                    IResultValue <IPrinterInformation> printerInformation) =>
 printerInformation.
 ResultVoidOk(printer => _messagingService.ShowMessage($"Установка принтера {printer.Name}")).
 ResultVoidOk(printer => SetDefaultPrinter(printer.Name)).
 ResultVoidOk(printer => _messagingService.ShowMessage($"Печать файла {filePath.FileNameClient}")).
 ResultValueOkBind(_ => PrintCommand(documentLibrary, stamp, filePath.FilePathServer, convertingModeType, colorPrintType,
                                     printerInformation.Value.PrefixSearchPaperSize)).
 ResultVoidOk(_ => _loggerService.LogByObject(LoggerLevel.Debug, LoggerAction.Operation, ReflectionInfo.GetMethodBase(this), filePath.FilePathServer)).
 ResultValueOk(_ => new FileDataSourceServer(filePath.FilePathServer, filePath.FilePathClient, convertingModeType,
                                             stamp.PaperSize, printerInformation.Value.Name));
Exemplo n.º 4
0
 /// <summary>
 /// Произвести печать PDF
 /// </summary>
 private IResultCollection <IFileDataSourceServer> StampContainerCreatePdf(IStampContainer stampContainer, IDocumentLibrary documentLibrary,
                                                                           IFilePath filePath, IConvertingSettings convertingSettings,
                                                                           ConvertingModeType convertingModeType, ColorPrintType colorPrintType) =>
 stampContainer.
 Void(_ => _messagingService.ShowMessage("Вставка подписей...")).
 Map(_ => stampContainer.InsertSignatures().ToResultCollectionFromApplication()).
 ResultVoidOk(signatures => _loggerService.LogByObjects(LoggerLevel.Debug, LoggerAction.Operation, ReflectionInfo.GetMethodBase(this),
                                                        signatures.Select(signature => signature.SignatureLibrary.PersonInformation.FullName))).
 ResultValueOkBind(signatures => StampContainerPrinting(stampContainer.GetStampsToPrint().ToResultCollectionFromApplication(),
                                                        documentLibrary, filePath, convertingSettings, convertingModeType, colorPrintType).
                   Void(_ => _messagingService.ShowMessage("Удаление подписей...")).
                   Void(_ => stampContainer.DeleteSignatures(signatures)).
                   Void(_ => _loggerService.LogByObject(LoggerLevel.Debug, LoggerAction.Operation,
                                                        ReflectionInfo.GetMethodBase(this), nameof(stampContainer.DeleteSignatures)))).
 ToResultCollection();
Exemplo n.º 5
0
 public ConvertingMode(ConvertingModeType convertingModeType, bool isUsed)
 {
     ConvertingModeType = convertingModeType;
     IsUsed             = isUsed;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Получить принтер по типу конвертации и формату
 /// </summary>
 public IResultValue <IPrinterInformation> GetPrinter(ConvertingModeType convertingModeType, ColorPrintType colorPrintType,
                                                      StampPaperSizeType paperSize) =>
 convertingModeType switch
 {
Exemplo n.º 7
0
 /// <summary>
 /// Преобразовать тип конвертации в наименование
 /// </summary>
 public static string ConvertingModeToString(ConvertingModeType convertingModeType)
 {
     ConvertingModeTypesString.TryGetValue(convertingModeType, out string convertingModeString);
     return(convertingModeString);
 }
Exemplo n.º 8
0
 private IResultError PrintCommand(IDocumentLibrary documentLibrary, IStamp stamp, string filePath,
                                   ConvertingModeType convertingModeType, ColorPrintType colorPrintType,
                                   string prefixSearchPaperSize) =>
 PrintCommandFunc(documentLibrary, stamp, colorPrintType, prefixSearchPaperSize).
 Map(printCommand => convertingModeType switch
Exemplo n.º 9
0
 private IResultCollection <IFileDataSourceServer> StampContainerPrinting(IResultCollection <IStamp> stampsToPrint, IDocumentLibrary documentLibrary,
                                                                          IFilePath filePath, IConvertingSettings convertingSettings,
                                                                          ConvertingModeType convertingModeType, ColorPrintType colorPrintType) =>
 stampsToPrint.
 ResultValueOkBind(stamps => StampFilePath.GetFileNamesByNamingType(stamps, filePath.FileNameWithoutExtensionClient, convertingSettings.PdfNamingType).
 public FileDataSourceServer(string filePathServer, string filePathClient,
                             ConvertingModeType convertingModeType, StampPaperSizeType paperSize)
     : this(filePathServer, filePathClient, convertingModeType, paperSize, "-")
 {
 }