Exemplo n.º 1
0
 public XElement Serialize()
 {
     return(new XElement(UblNames.Cac + nameof(TenderingCriterionProperty),
                         ID?.Serialize(nameof(ID)),
                         Name.Serialize(nameof(Name)),
                         Description.Serialize(nameof(Description)),
                         TypeCode?.Serialize(nameof(TypeCode)),
                         ValueDataTypeCode?.Serialize(nameof(ValueDataTypeCode)),
                         ValueUnitCode?.Serialize(nameof(ValueUnitCode)),
                         ValueCurrencyCode?.Serialize(nameof(ValueCurrencyCode)),
                         ExpectedAmount?.Serialize(nameof(ExpectedAmount)),
                         ExpectedID?.Serialize(nameof(ExpectedID)),
                         ExpectedCode?.Serialize(nameof(ExpectedCode)),
                         ExpectedValueNumeric.Serialize(nameof(ExpectedValueNumeric)),
                         ExpectedDescription.Serialize(nameof(ExpectedDescription)),
                         MaximumAmount?.Serialize(nameof(MaximumAmount)),
                         MinimumAmount?.Serialize(nameof(MinimumAmount)),
                         MaximumValueNumeric.Serialize(nameof(MaximumValueNumeric)),
                         MinimumValueNumeric.Serialize(nameof(MinimumValueNumeric)),
                         TranslationTypeCode?.Serialize(nameof(TranslationTypeCode)),
                         CertificationLevelDescription?.Serialize(nameof(CertificationLevelDescription)),
                         CopyQualityTypeCode?.Serialize(nameof(CopyQualityTypeCode)),
                         ApplicablePeriod?.Serialize(nameof(ApplicablePeriod)),
                         TemplateEvidence?.Select(e => e.Serialize(nameof(TemplateEvidence)))
                         ));
 }
Exemplo n.º 2
0
        private void OnHandlerUnfocused(object sender, FocusEventArgs e)
        {
            decimal value = 0;

            if (decimal.TryParse(Text, out value))
            {
                if (MaximumAmount.IsNotNull() && value > MaximumAmount)
                {
                    Amount = MaximumAmount;
                    Text   = NumberType == EnumNumberType.Amount ? FormatterHelper.Format(Amount.Value) : FormatterHelper.FormatPercentage(Amount.Value);
                }
                else if (MinimumAmount.IsNotNull() && value < MinimumAmount)
                {
                    Amount = MinimumAmount;
                    Text   = NumberType == EnumNumberType.Amount ? FormatterHelper.Format(Amount.Value) : FormatterHelper.FormatPercentage(Amount.Value);
                }
                else
                {
                    Amount = value;
                    Text   = NumberType == EnumNumberType.Amount ? FormatterHelper.Format(Amount.Value) : FormatterHelper.FormatPercentage(Amount.Value);
                }
            }
            else
            {
                Text   = string.Empty;
                Amount = 0;
            }
        }