コード例 #1
0
        private void AttorneyFieldsDontHaveErrors(VipAttorneyRecognizedTrustScreenModel trust)
        {
            var fields = trust.Fields.Where(x => x.Parent == trust.RecognizedAttorney);

            #region Assertions
            Check.That(fields.Any());
            #endregion

            fields.ForEach(f => Assert.That(f.ErrorLevel, Is.EqualTo(ErrorLevel.Valid)));
        }
コード例 #2
0
        private bool DocumentNumbersDontMatch(VipAttorneyRecognizedTrustScreenModel model)
        {
            var physAttorney    = model.RecognizedAttorney as PhysicalPerson;
            var physBoxAttorney = model.VipAttorney.Value.Attorney.PersonInfo as PhysicalPersonInfo;

            if (physAttorney != null && physBoxAttorney != null)
            {
                return(physAttorney.DocumentNumber.Value != physBoxAttorney.DocumentNumber);
            }
            return(false);
        }
コード例 #3
0
        private void AttorneyFieldsHaveErrorWithText(VipAttorneyRecognizedTrustScreenModel trust, string expectedErrorTextForAttorneyFields)
        {
            var fields = trust.Fields.Where(x => x.Parent == trust.RecognizedAttorney);

            #region Assertions
            Check.That(fields.Any());
            #endregion

            fields.ForEach(f => Assert.That(f.ErrorLevel, Is.EqualTo(ErrorLevel.Error)));
            fields.ForEach(f => Assert.That(f.ErrorText, Is.EqualTo(expectedErrorTextForAttorneyFields)));
        }
コード例 #4
0
 private void ValidateAttorney(VipAttorneyRecognizedTrustScreenModel model)
 {
     if (model.VipAttorney.Value == null ||
         (!model.VipAttorneyWasManuallySet &&
          (model.RecognizedAttorney.ResultName != model.VipAttorney.Value.Attorney.PersonInfo.Name ||
           DocumentNumbersDontMatch(model))
         ))
     {
         model.RecognizedAttorney.Fields.ForEach(f =>
         {
             f.ErrorLevel = ErrorLevel.Error;
             f.ErrorText  = "Распознанный представитель не совпадает с ожидаемым"
                            + (model.VipAttorney != null ? " (" + model.VipAttorney.Value.Attorney.PersonInfo.Name + ")" : "");
         });
     }
 }
コード例 #5
0
 protected void Validate(VipAttorneyRecognizedTrustScreenModel trust)
 {
     _trustValidator.ValidateEditorModel(trust);
 }
コード例 #6
0
        private static void ValidateDateAndSignatureFields(VipAttorneyRecognizedTrustScreenModel trust)
        {
            ValidateDateFields(trust);

            SignatureFieldsMustBePresent(trust);
        }
コード例 #7
0
 private void ValidateEditorModel1(VipAttorneyRecognizedTrustScreenModel model)
 {
     ResetFields(model);
     ValidateDateAndSignatureFields(model);
     ValidateAttorney(model);
 }
コード例 #8
0
 private static void SignatureFieldsMustBePresent(VipAttorneyRecognizedTrustScreenModel trust)
 {
     ValidateMandatoryBoolField(trust.TrusterSignature, "Отсутвствует подпись доверителя.");
     ValidateMandatoryBoolField(trust.CertifierSignature, "Отсутвствует подпись удостоверителя.");
     ValidateMandatoryBoolField(trust.CertifierStamp, "Отсутвствует печать удостоверителя.");
 }
コード例 #9
0
 public void ValidateMainTrustFields(VipAttorneyRecognizedTrustScreenModel trust)
 {
     ResetFields(trust);
     ValidateDateAndSignatureFields(trust);
 }