Ejemplo n.º 1
0
 /// <summary>
 /// Сформировать строку с основной подписью согласно идентификатору Microstation
 /// </summary>
 private IResultAppValue <IStampPerson> GetStampPersonById(IStampTextFieldMicrostation responsiblePerson,
                                                           Func <ISignatureLibraryApp, IResultAppValue <IStampFieldMicrostation> > insertSignatureFunc,
                                                           IStampTextField actionType, IStampTextField dateSignature) =>
 SignaturesActionType.GetPersonIdByActionType(responsiblePerson.ElementStamp.AttributePersonId, UseDefaultSignature,
                                              PersonId, actionType.Text).
 Map(personIdByActionType => SignaturesSearching.FindByIdOrFullNameOrRandom(personIdByActionType, responsiblePerson.MaxLengthWord,
                                                                            PersonId)).
 ResultValueOk(personSignature => new PersonSignatureMicrostation(personSignature, _stampIdentifier, insertSignatureFunc,
                                                                  actionType, responsiblePerson, dateSignature));
 /// <summary>
 /// Получить информацию об ответственном лице по имени
 /// </summary>
 private IResultAppValue <ISignatureLibraryApp> GetSignatureInformation(string personName, string personId,
                                                                        PersonDepartmentType personDepartmentType, string actionType) =>
 new ResultAppValue <ISignatureLibraryApp>(SignaturesSearching.FindById(personId),
                                           new ErrorApplication(ErrorApplicationType.SignatureNotFound, $"Подпись {personName} не найдена")).
 ResultValueOk(signature => signature.PersonInformation.DepartmentType).
 ResultValueOk(departmentType => SignaturesSearching.CheckDepartmentAccordingToType(departmentType, personDepartmentType)).
 ResultValueOkBind(departmentChecked => SignaturesSearching.FindByFullNameOrRandom(personName, departmentChecked)).
 ResultValueOk(personAttributeId => SignaturesActionType.GetPersonIdByActionType(personAttributeId.PersonId,
                                                                                 UseDefaultSignature, PersonId, actionType)).
 ResultValueOk(personCheckedId => SignaturesSearching.FindById(personCheckedId));