public static void postSet_KickOffAm(Projekt obj, PropertyPostSetterEventArgs <DateTime> e) { if (obj.KickOffBis.HasValue) { obj.KickOffBis = e.NewValue.Date + obj.KickOffBis.Value.TimeOfDay; } }
public static void postSet_FulfillmentDate(Receipt obj, PropertyPostSetterEventArgs <DateTime?> e) { if (e.NewValue.HasValue && obj.PaymentAmount == 0) { obj.PaymentAmount = obj.Total; } }
public static void postSet_KickOffAm(Projekt obj, PropertyPostSetterEventArgs<DateTime> e) { if (obj.KickOffBis.HasValue) { obj.KickOffBis = e.NewValue.Date + obj.KickOffBis.Value.TimeOfDay; } }
public static void postSet_Aufwand(Task obj, PropertyPostSetterEventArgs <double?> e) { if (obj.Projekt != null) { obj.Projekt.Recalculate("AufwandGes"); } }
public static void postSet_UnitPrice(QuoteItem obj, PropertyPostSetterEventArgs <decimal?> e) { if (obj.UnitPrice.HasValue) { obj.AmountNet = obj.Quantity * obj.UnitPrice.Value; } }
public static void postSet_UnitPrice(InvoiceItemTemplate obj, PropertyPostSetterEventArgs <decimal?> e) { if (obj.UnitPrice.HasValue) { obj.AmountNet = Math.Round(obj.Quantity * obj.UnitPrice.Value, 2); } }
public static void postSet_PaymentAmount(Receipt obj, PropertyPostSetterEventArgs <decimal> e) { if (e.NewValue != 0 && obj.Status.In(ReceiptStatus.Open, ReceiptStatus.Partial, ReceiptStatus.Fulfilled)) { obj.Status = e.NewValue == obj.Total ? ReceiptStatus.Fulfilled : ReceiptStatus.Partial; } }
public static void postSet_VATType(InvoiceItemTemplate obj, PropertyPostSetterEventArgs <VATType> e) { if (obj.VATType != null) { var percent = (obj.VATType.Percentage ?? 0m) / 100m; obj.Amount = Math.Round(obj.AmountNet + (obj.AmountNet * percent) + (obj.VATType.Absolute ?? 0m), 2); } }
public static void postSet_VATType(QuoteItem obj, PropertyPostSetterEventArgs <VATType> e) { if (obj.VATType != null) { var percent = (obj.VATType.Percentage ?? 0m) / 100m; obj.Amount = obj.AmountNet + (obj.AmountNet * percent) + (obj.VATType.Absolute ?? 0m); } }
public static void postSet_CompoundObjectDefinition(CompoundObjectProperty obj, PropertyPostSetterEventArgs<CompoundObject> e) { var def = ViewModelDescriptors.Zetbox_Client_Presentables_ValueViewModels_CompoundObjectPropertyViewModel.Find(obj.Context); if (obj.ValueModelDescriptor == def && e.OldValue == null && e.NewValue != null && e.NewValue.DefaultPropertyViewModelDescriptor != null) { // Only once, during initialize obj.ValueModelDescriptor = e.NewValue.DefaultPropertyViewModelDescriptor; } }
public static void postSet_Total(ReceiptTemplate obj, PropertyPostSetterEventArgs <decimal> e) { if (obj is OtherIncomeReceiptTemplate || obj is OtherExpenseReceiptTemplate) { // There is no difference between total & total net // sync the props in common to ensure, they are always the same // TODO: Enable overriding property setter obj.TotalNet = obj.Total; } }
public static void postSet_Projekt(Task obj, PropertyPostSetterEventArgs <Projekt> e) { if (e.OldValue != null) { e.OldValue.Recalculate("AufwandGes"); } if (e.NewValue != null) { e.NewValue.Recalculate("AufwandGes"); } }
public static void postSet_Receipt(Receipt_Transaction obj, PropertyPostSetterEventArgs <Receipt> e) { if (e.OldValue != null) { e.OldValue.Recalculate("OpenAmount"); e.OldValue.PaymentAmount = e.OldValue.GetPaymentAmount(); } if (e.NewValue != null) { e.NewValue.Recalculate("OpenAmount"); e.NewValue.PaymentAmount = e.NewValue.GetPaymentAmount(); } }
public static void postSet_Transaction(Receipt_Transaction obj, PropertyPostSetterEventArgs <Transaction> e) { if (e.OldValue != null) { e.OldValue.Recalculate("ChargedAmount"); e.OldValue.Recalculate("OverPayment"); } if (e.NewValue != null) { e.NewValue.Recalculate("ChargedAmount"); e.NewValue.Recalculate("OverPayment"); e.NewValue.Recalculate("AmountNet"); e.NewValue.Recalculate("VAT"); } }
public static void postSet_Amount(Receipt_Transaction obj, PropertyPostSetterEventArgs <decimal> e) { if (obj.Receipt != null) { obj.Receipt.Recalculate("OpenAmount"); obj.Receipt.PaymentAmount = obj.Receipt.GetPaymentAmount(); } if (obj.Transaction != null) { obj.Transaction.Recalculate("ChargedAmount"); obj.Transaction.Recalculate("OverPayment"); obj.Transaction.Recalculate("AmountNet"); obj.Transaction.Recalculate("VAT"); } }
public static void postSet_Parent(SecurityTestChild obj, PropertyPostSetterEventArgs<SecurityTestParent> e) { obj.Recalculate("ParentName"); }
public static void postSet_Blob(File obj, PropertyPostSetterEventArgs<Zetbox.App.Base.Blob> e) { if (e.OldValue != e.NewValue) { obj.ExtractText(); } }
public static void postSet_Excerpt(File obj, PropertyPostSetterEventArgs<Excerpt> e) { if (e.OldValue != null) { obj.Context.Delete(e.OldValue); } }
public static void postSet_BaseObjectClass(Zetbox.App.Base.ObjectClass obj, PropertyPostSetterEventArgs<Zetbox.App.Base.ObjectClass> e) { }
public static void postSet_LeftOn(State obj, PropertyPostSetterEventArgs <DateTime?> e) { obj.Recalculate("IsActive"); obj.Instance.Recalculate("IsActive"); }
public static void postSet_FullName(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs <System.String> e) { obj.UpdateToStringCache(); }
public static void postSet_Name(SecurityTestParent obj, PropertyPostSetterEventArgs<string> e) { obj.Children.ForEach(c => c.Recalculate("ParentName")); }
public static void postSet_Name(SecurityTestParent obj, PropertyPostSetterEventArgs <string> e) { obj.Children.ForEach(c => c.Recalculate("ParentName")); }
public static void postSet_ObjectClass(Property obj, PropertyPostSetterEventArgs <DataType> e) { obj.Recalculate("CodeTemplate"); }
public static void postSet_Name(Method obj, PropertyPostSetterEventArgs <string> e) { obj.Recalculate("CodeTemplate"); }
public static void postSet_BaseObjectClass(Zetbox.App.Base.ObjectClass obj, PropertyPostSetterEventArgs <Zetbox.App.Base.ObjectClass> e) { }
public static void postSet_Projekt(Task obj, PropertyPostSetterEventArgs<Projekt> e) { if (e.OldValue != null) e.OldValue.Recalculate("AufwandGes"); if (e.NewValue != null) e.NewValue.Recalculate("AufwandGes"); }
public static void postSet_Parent(SecurityTestChild obj, PropertyPostSetterEventArgs <SecurityTestParent> e) { obj.Recalculate("ParentName"); }
public static void postSet_ObjectClass(Property obj, PropertyPostSetterEventArgs<DataType> e) { obj.Recalculate("CodeTemplate"); }
public static void postSet_CompoundObjectDefinition(CompoundObjectProperty obj, PropertyPostSetterEventArgs <CompoundObject> e) { var def = ViewModelDescriptors.Zetbox_Client_Presentables_ValueViewModels_CompoundObjectPropertyViewModel.Find(obj.Context); if (obj.ValueModelDescriptor == def && e.OldValue == null && e.NewValue != null && e.NewValue.DefaultPropertyViewModelDescriptor != null) { // Only once, during initialize obj.ValueModelDescriptor = e.NewValue.DefaultPropertyViewModelDescriptor; } }
public static void postSet_Name(Method obj, PropertyPostSetterEventArgs<string> e) { obj.Recalculate("CodeTemplate"); }
public static void postSet_Assembly(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs <Zetbox.App.Base.Assembly> e) { obj.UpdateToStringCache(); }
public static void postSet_Rights(AccessControl obj, PropertyPostSetterEventArgs<AccessRights?> e) { obj.Recalculate("Description"); }
public static void postSet_IsCalculated(ValueTypeProperty obj, PropertyPostSetterEventArgs<bool> e) { obj.Recalculate("CodeTemplate"); }
public static void postSet_PaymentAmount(Receipt obj, PropertyPostSetterEventArgs <decimal> e) { UpdateCalculatedProperties(obj); }
public static void postSet_AmountNet(InvoiceItem obj, PropertyPostSetterEventArgs <decimal> e) { NotifyInvoiceChanged(obj); }
public static void postSet_Assembly(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs<Zetbox.App.Base.Assembly> e) { obj.UpdateToStringCache(); }
public static void postSet_Aufwand(Task obj, PropertyPostSetterEventArgs<double?> e) { if (obj.Projekt != null) obj.Projekt.Recalculate("AufwandGes"); }
public static void postSet_FullName(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs<System.String> e) { obj.UpdateToStringCache(); }
public static void postSet_Group(GroupMembership obj, PropertyPostSetterEventArgs<Group> e) { obj.Recalculate("Description"); }
public static void postSet_Amount(Transaction obj, PropertyPostSetterEventArgs <decimal> e) { UpdateCalculatedProperties(obj); }