/// <summary> /// Сформировать строку с подписью изменений согласно идентификатору Microstation /// </summary> private static IResultAppValue <IStampChange> GetStampChangeById(ISignatureLibraryApp personSignature, StampIdentifier stampIdentifier, Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > insertSignatureFunc, IStampTextField numberChange, IStampTextField numberOfPlots, IStampTextField typeOfChange, IStampTextField documentChange, IStampTextField dateChange) => new ChangeSignatureMicrostation(personSignature, stampIdentifier, insertSignatureFunc, numberChange, numberOfPlots, typeOfChange, documentChange, dateChange). Map(stampChange => new ResultAppValue <IStampChange>(stampChange));
public ApprovalSignatureMicrostation(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > insertSignatureFunc, IStampTextField departmentApproval, IStampTextField responsiblePerson, IStampTextField dateSignature) : this(signatureLibrary, stampIdentifier, GetNotInitializedSignature(responsiblePerson.MaxLengthWord), insertSignatureFunc, departmentApproval, responsiblePerson, dateSignature) { }
public ApprovalChiefSignatureWord(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, IStampFieldWord signature, IStampTextField responsiblePerson, IStampTextField department) : base(signatureLibrary, stampIdentifier, signature) { ResponsiblePerson = responsiblePerson ?? throw new ArgumentNullException(nameof(responsiblePerson)); Department = department ?? throw new ArgumentNullException(nameof(department)); }
/// <summary> /// Получить строки с изменениями /// </summary> public override IResultAppCollection <IStampChange> GetStampChangeRows(ISignatureLibraryApp signatureLibrary) => new ResultAppValue <ISignatureLibraryApp>(signatureLibrary, new ErrorApplication(ErrorApplicationType.SignatureNotFound, "Не найден идентификатор основной подписи")). ResultValueOk(signature => GetStampSignatureRows(StampFieldType.ChangeSignature, changeNames => GetStampChangeRow(changeNames, signatureLibrary))). ResultValueOk(changeRows => changeRows.Where(ChangeSignatureValidation)). ToResultCollection(new ErrorApplication(ErrorApplicationType.SignatureNotFound, "Штамп подписей замены не найден"));
public ApprovalChangeSignatureWord(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, IStampFieldWord signature, IStampTextField actionType, IStampTextField responsiblePerson, IStampTextField dateSignature) : base(signatureLibrary, stampIdentifier, signature) { ResponsiblePerson = responsiblePerson ?? throw new ArgumentNullException(nameof(responsiblePerson)); ActionType = actionType; DateSignature = dateSignature; }
protected SignatureMicrostation(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, IResultAppValue <IStampFieldMicrostation> signature, Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > insertSignatureFunc) : base(signatureLibrary, stampIdentifier) { _signature = signature ?? throw new ArgumentNullException(nameof(signature)); InsertSignatureFunc = insertSignatureFunc ?? throw new ArgumentNullException(nameof(insertSignatureFunc)); }
public ChangeSignatureMicrostation(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > insertSignatureFunc, IStampTextField numberChange, IStampTextField numberOfPlots, IStampTextField typeOfChange, IStampTextField documentChange, IStampTextField dateChange) : this(signatureLibrary, stampIdentifier, GetNotInitializedSignature(signatureLibrary?.PersonInformation.Surname), insertSignatureFunc, numberChange, numberOfPlots, typeOfChange, documentChange, dateChange) { }
public ApprovalSignatureMicrostation(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, IResultAppValue <IStampFieldMicrostation> signature, Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > insertSignatureFunc, IStampTextField departmentApproval, IStampTextField responsiblePerson, IStampTextField dateSignature) : base(signatureLibrary, stampIdentifier, signature, insertSignatureFunc) { ResponsiblePerson = responsiblePerson ?? throw new ArgumentNullException(nameof(responsiblePerson)); Department = departmentApproval; DateSignature = dateSignature; }
/// <summary> /// Получить строки с изменениями Word /// </summary> public override IResultAppCollection <IStampChange> GetStampChangeRows(ISignatureLibraryApp signatureLibrary) => _stampFieldsWord.GetFieldsByType(StampFieldType.ChangeSignature). Select(field => _stampFieldsWord.GetTableRowByIndex(field.CellElementStamp.RowIndex, field.CellElementStamp.ColumnIndex, ChangeRowIndexes.NUMBER_CHANGE, ChangeSignatureWord.FIELDS_COUNT)). Where(row => row.CellsElement.Count >= ChangeSignatureWord.FIELDS_COUNT). Select(row => GetStampChangeFromRow(row, signatureLibrary, _stampIdentifier)). ToResultCollection(). ResultValueOk(changeRows => changeRows.Where(ChangeSignatureValidation)). ToResultCollection();
public ChangeSignatureWord(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, IStampFieldWord signature, IStampTextField numberChange, IStampTextField numberPlots, IStampTextField typeOfChange, IStampTextField documentChange, IStampTextField dateChange) : base(signatureLibrary, stampIdentifier, signature) { NumberChange = numberChange; NumberPlots = numberPlots; TypeOfChange = typeOfChange; DocumentChange = documentChange; DateChange = dateChange; }
public ChangeSignatureMicrostation(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, IResultAppValue <IStampFieldMicrostation> signature, Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > insertSignatureFunc, IStampTextField numberChange, IStampTextField numberOfPlots, IStampTextField typeOfChange, IStampTextField documentChange, IStampTextField dateChange) : base(signatureLibrary, stampIdentifier, signature, insertSignatureFunc) { NumberChange = numberChange; NumberPlots = numberOfPlots; TypeOfChange = typeOfChange; DocumentChange = documentChange; DateChange = dateChange; }
/// <summary> /// Получить класс с ответственным лицом и подписью на основании полей Word для строк согласования тех требований с директорами /// </summary> private static IStampApprovalChief GetStampApprovalChiefFromFields(IRowElementWord approvalChiefRow, ISignatureLibraryApp approvalChiefSignature, StampIdentifier stampIdentifier) => new ApprovalChiefSignatureWord(approvalChiefSignature, stampIdentifier, new StampFieldWord(approvalChiefRow.CellsElement[ApprovalChiefRowIndexes.SIGNATURE], StampFieldType.ApprovalChiefSignature), new StampTextFieldWord(approvalChiefRow.CellsElement[ApprovalChiefRowIndexes.RESPONSIBLE_PERSON], StampFieldType.ApprovalChiefSignature), new StampTextFieldWord(approvalChiefRow.CellsElement[ApprovalChiefRowIndexes.DEPARTMENT], StampFieldType.ApprovalChiefSignature));
/// <summary> /// Получить класс с изменениями и подписью по строке Word /// </summary> private static IResultAppValue <IStampChange> GetStampChangeFromRow(IRowElementWord changeRow, ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier) => new ResultAppValue <ISignatureLibraryApp>(signatureLibrary, new ErrorApplication(ErrorApplicationType.SignatureNotFound, "Не найден идентификатор основной подписи")). ResultValueOk(signature => GetStampChangeFromFields(changeRow, signature, stampIdentifier));
/// <summary> /// Получить строки с изменениями /// </summary> public abstract IResultAppCollection <IStampChange> GetStampChangeRows(ISignatureLibraryApp signatureLibrary);
/// <summary> /// Получить класс с ответственным лицом и подписью на основании полей Word для штампа согласования /// </summary> private static IStampApprovalChange GetStampApprovalChangeFromFields(IRowElementWord approvalChangeRow, ISignatureLibraryApp approvalChangeSignature, StampIdentifier stampIdentifier) => new ApprovalChangeSignatureWord(approvalChangeSignature, stampIdentifier, new StampFieldWord(approvalChangeRow.CellsElement[ApprovalChangeRowIndexes.SIGNATURE], StampFieldType.ApprovalChangeSignature), new StampTextFieldWord(approvalChangeRow.CellsElement[ApprovalChangeRowIndexes.ACTION_TYPE], StampFieldType.ApprovalChangeSignature), new StampTextFieldWord(approvalChangeRow.CellsElement[ApprovalChangeRowIndexes.RESPONSIBLE_PERSON], StampFieldType.ApprovalChangeSignature), new StampTextFieldWord(approvalChangeRow.CellsElement[ApprovalChangeRowIndexes.DATE], StampFieldType.ApprovalChangeSignature));
public StampShortWord(StampSettingsWord stampSettingsWord, SignaturesSearching signaturesSearching, ITableElementWord tableStamp, ISignatureLibraryApp personShortSignature) : base(stampSettingsWord, signaturesSearching, tableStamp) { _personShortSignature = personShortSignature ?? throw new ArgumentNullException(nameof(personShortSignature)); }
/// <summary> /// Получить класс с изменениями и подписью на основании полей Word /// </summary> private static IStampChange GetStampChangeFromFields(IRowElementWord changeRow, ISignatureLibraryApp personSignature, StampIdentifier stampIdentifier) => new ChangeSignatureWord(personSignature, stampIdentifier, new StampFieldWord(changeRow.CellsElement[ChangeRowIndexes.SIGNATURE], StampFieldType.ChangeSignature), new StampTextFieldWord(changeRow.CellsElement[ChangeRowIndexes.NUMBER_CHANGE], StampFieldType.ChangeSignature), new StampTextFieldWord(changeRow.CellsElement[ChangeRowIndexes.NUMBER_PLOTS], StampFieldType.ChangeSignature), new StampTextFieldWord(changeRow.CellsElement[ChangeRowIndexes.TYPE_OF_CHANGE], StampFieldType.ChangeSignature), new StampTextFieldWord(changeRow.CellsElement[ChangeRowIndexes.DOCUMENT_CHANGE], StampFieldType.ChangeSignature), new StampTextFieldWord(changeRow.CellsElement[ChangeRowIndexes.DATE_CHANGE], StampFieldType.ChangeSignature));
protected SignatureWord(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier, IStampFieldWord signature) : base(signatureLibrary, stampIdentifier) { _signature = new ResultAppValue <IStampFieldWord>(signature, new ErrorApplication(ErrorApplicationType.SignatureNotFound, "Подпись не инициализирована")); }
protected StampSignature(ISignatureLibraryApp signatureLibrary, StampIdentifier stampIdentifier) { SignatureLibrary = signatureLibrary ?? throw new ArgumentNullException(nameof(signatureLibrary)); StampIdentifier = stampIdentifier; }
/// <summary> /// Преобразовать элементы Microstation в строку подписей изменений Microstation /// </summary> private IResultAppValue <IStampChange> GetStampChangeRow(IEnumerable <string> changeNames, ISignatureLibraryApp personSignature) => _stampFields.FindElementsInStamp <ITextElementMicrostation>(changeNames, new ErrorApplication(ErrorApplicationType.SignatureNotFound, "Поля подписей изменений не найдены")). ResultValueOkBind(foundFields => GetStampChangeFromFields(foundFields, personSignature));
/// <summary> /// Получить строку с подписью изменений из полей штампа Microstation /// </summary> private IResultAppValue <IStampChange> GetStampChangeFromFields(IList <ITextElementMicrostation> foundFields, ISignatureLibraryApp personSignature) { var numberChange = _stampFields.GetFieldFromElements(foundFields, StampFieldChanges.GetFieldsNumberChange(), StampFieldType.ChangeSignature); var numberOfPlots = _stampFields.GetFieldFromElements(foundFields, StampFieldChanges.GetFieldsNumberOfPlots(), StampFieldType.ChangeSignature); var typeOfChange = _stampFields.GetFieldFromElements(foundFields, StampFieldChanges.GetFieldsTypeOfChange(), StampFieldType.ChangeSignature); var documentChange = _stampFields.GetFieldFromElements(foundFields, StampFieldChanges.GetFieldsDocumentChange(), StampFieldType.ChangeSignature); var dateChange = _stampFields.GetFieldFromElements(foundFields, StampFieldChanges.GetFieldsDateChange(), StampFieldType.ChangeSignature); var insertSignatureFunc = InsertSignatureFunc(documentChange.ElementStamp, dateChange.ElementStamp, StampFieldType.ChangeSignature); return(GetStampChangeById(personSignature, _stampIdentifier, insertSignatureFunc, numberChange, numberOfPlots, typeOfChange, documentChange, dateChange)); }
/// <summary> /// Получить класс с ответственным лицом и подписью на основании полей Word /// </summary> private static IStampPerson GetStampPersonFromFields(IRowElementWord personRow, ISignatureLibraryApp personSignature, StampIdentifier stampIdentifier) => new PersonSignatureWord(personSignature, stampIdentifier, new StampFieldWord(personRow.CellsElement[PersonRowIndexes.SIGNATURE], StampFieldType.PersonSignature), new StampTextFieldWord(personRow.CellsElement[PersonRowIndexes.ACTION_TYPE], StampFieldType.PersonSignature), new StampTextFieldWord(personRow.CellsElement[PersonRowIndexes.RESPONSIBLE_PERSON], StampFieldType.PersonSignature), new StampTextFieldWord(personRow.CellsElement[PersonRowIndexes.DATE], StampFieldType.PersonSignature));