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