Пример #1
0
 protected StampWord(StampSettingsWord stampSettingsWord, SignaturesSearching signaturesSearching,
                     ITableElementWord tableStamp)
     : base(stampSettingsWord, signaturesSearching)
 {
     TableStamp  = tableStamp;
     PaperSize   = stampSettingsWord.PaperSize;
     Orientation = stampSettingsWord.Orientation;
 }
Пример #2
0
 public StampFullWord(StampSettingsWord stampSettingsWord, SignaturesSearching signaturesSearching,
                      ITableElementWord tableStamp, IResultAppValue <ITableElementWord> tableApprovalPerformers,
                      IResultAppValue <ITableElementWord> tableApprovalChief)
     : base(stampSettingsWord, signaturesSearching, tableStamp)
 {
     TableApprovalPerformers = tableApprovalPerformers ?? throw new ArgumentNullException(nameof(tableApprovalPerformers));
     TableApprovalChief      = tableApprovalChief ?? throw new ArgumentNullException(nameof(tableApprovalChief));
 }
 public SignatureCreatingWord(ITableElementWord tableStamp, StampIdentifier stampIdentifier, IResultAppValue <ITableElementWord> tableApprovalPerformers,
                              IResultAppValue <ITableElementWord> tableApprovalChief,
                              IStampFieldsWord stampFieldsWord, StampDocumentType stampDocumentType,
                              SignaturesSearching signaturesSearching, string personId, bool useDefaultSignature)
     : base(signaturesSearching, personId, useDefaultSignature)
 {
     _tableStamp              = tableStamp ?? throw new ArgumentNullException(nameof(tableStamp));
     _stampIdentifier         = stampIdentifier;
     _tableApprovalPerformers = tableApprovalPerformers ?? throw new ArgumentNullException(nameof(tableApprovalPerformers));
     _tableApprovalChief      = tableApprovalChief ?? throw new ArgumentNullException(nameof(tableApprovalChief));
     _stampFieldsWord         = stampFieldsWord ?? throw new ArgumentNullException(nameof(stampFieldsWord));
     _stampDocumentType       = stampDocumentType;
 }
        /// <summary>
        /// Проверить является ли таблица штампом и вернуть его тип
        /// </summary>
        public static StampType GetStampType(ITableElementWord tableWord)
        {
            var hasFullCode      = false;
            var hasShortMarker   = false;
            var hasMainMarkers   = false;
            var hasChangeMarkers = false;

            foreach (var cell in tableWord.CellsElementWord)
            {
                if (CheckFieldType.IsFieldFullCode(cell, tableWord))
                {
                    hasFullCode = true;
                }
                if (MarkersAdditionalStamp.MarkerContain(cell.TextNoSpaces))
                {
                    hasShortMarker = true;
                }
                if (MarkersFullStamp.MarkerContain(cell.TextNoSpaces))
                {
                    hasMainMarkers = true;
                }
                if (MarkersChangeNoticeStamp.MarkerContain(cell.TextNoSpaces))
                {
                    hasChangeMarkers = true;
                }

                if (hasFullCode && (hasMainMarkers || hasChangeMarkers))
                {
                    break;
                }
            }

            return(hasFullCode switch
            {
                true when hasMainMarkers => StampType.Full,
                true when hasShortMarker => StampType.Shortened,
                _ when hasChangeMarkers => StampType.ChangeNotice,
                false => StampType.Unknown,
                _ => StampType.Unknown,
            });
Пример #5
0
 public StampChangeWord(StampSettingsWord stampSettingsWord, SignaturesSearching signaturesSearching, ITableElementWord tableStamp,
                        IResultAppValue <IStampTextField> fullCode)
     : base(stampSettingsWord, signaturesSearching, tableStamp)
 {
     _fullcode = fullCode ?? throw new ArgumentNullException(nameof(fullCode));
 }
Пример #6
0
 public TableStampType(StampType stampType, ITableElementWord tableWord)
 {
     StampType = stampType;
     TableWord = tableWord ?? throw new ArgumentNullException(nameof(tableWord));
 }
Пример #7
0
 /// <summary>
 /// Выбрать главный штамп
 /// </summary>
 public static IStamp GetMainStamp(StampType stampType, ITableElementWord tableWord, StampSettingsWord stampSettings,
                                   SignaturesSearching signaturesSearching, IReadOnlyList <ITableElementWord> tables) =>
 stampType switch
 {
Пример #8
0
 /// <summary>
 /// Получить таблицу и тип соответствующего штампа
 /// </summary>
 private static TableStampType GetTableStamp(ITableElementWord tableWord) =>
 new TableStampType(StampMarkersWord.GetStampType(tableWord), tableWord);
Пример #9
0
 /// <summary>
 /// Определить тип поля штампа
 /// </summary>
 public static StampFieldType GetStampFieldType(ICellElementWord cellElement, ITableElementWord stampTable) =>
 cellElement switch
 {
Пример #10
0
 public StampShortWord(StampSettingsWord stampSettingsWord, SignaturesSearching signaturesSearching,
                       ITableElementWord tableStamp, ISignatureLibraryApp personShortSignature)
     : base(stampSettingsWord, signaturesSearching, tableStamp)
 {
     _personShortSignature = personShortSignature ?? throw new ArgumentNullException(nameof(personShortSignature));
 }