protected override IEnumerable <ValidationResult> ValidateOther()
 {
     if (Math.Abs(PaymentConditions.Sum(paymentCondition => paymentCondition.Part) - 1) > 0.00001)
     {
         yield return(new ValidationResult("Сумма всех условий не равна 100%", new[] { nameof(PaymentConditions) }));
     }
 }
Example #2
0
 private void DeletePaymentCondition()
 {
     if (SelectedPaymentCondition.PaymentConditionId != 0)
     {
         PaymentConditions.Delete(SelectedPaymentCondition.PaymentConditionId);
     }
     PaymentConditionList.Remove(SelectedPaymentCondition);
 }
Example #3
0
 private void SavePaymentCondition()
 {
     SelectedPaymentCondition.PayType = PayType;
     if (SelectedPaymentCondition.PaymentConditionId != 0)
     {
         PaymentConditions.Update(SelectedPaymentCondition);
     }
     else
     {
         PaymentConditions.Insert(SelectedPaymentCondition);
     }
 }
Example #4
0
 private void GetData()
 {
     InvoiceTypeList      = InvoiceTypes.GetAll().ToSvenTechCollection();
     PaymentConditionList = PaymentConditions.GetAll().ToSvenTechCollection();
     UserList             = Users.GetAll().ToSvenTechCollection();
 }
Example #5
0
 public PaymentConditionViewModel()
 {
     PaymentConditionList = PaymentConditions.GetAll().ToSvenTechCollection();
     SetCommands();
     ValueLabel = "Dauer (in Tagen)";
 }