Ejemplo n.º 1
0
 public static void postSet_KickOffAm(Projekt obj, PropertyPostSetterEventArgs <DateTime> e)
 {
     if (obj.KickOffBis.HasValue)
     {
         obj.KickOffBis = e.NewValue.Date + obj.KickOffBis.Value.TimeOfDay;
     }
 }
Ejemplo n.º 2
0
 public static void postSet_FulfillmentDate(Receipt obj, PropertyPostSetterEventArgs <DateTime?> e)
 {
     if (e.NewValue.HasValue && obj.PaymentAmount == 0)
     {
         obj.PaymentAmount = obj.Total;
     }
 }
Ejemplo n.º 3
0
 public static void postSet_KickOffAm(Projekt obj, PropertyPostSetterEventArgs<DateTime> e)
 {
     if (obj.KickOffBis.HasValue)
     {
         obj.KickOffBis = e.NewValue.Date + obj.KickOffBis.Value.TimeOfDay;
     }
 }
Ejemplo n.º 4
0
 public static void postSet_Aufwand(Task obj, PropertyPostSetterEventArgs <double?> e)
 {
     if (obj.Projekt != null)
     {
         obj.Projekt.Recalculate("AufwandGes");
     }
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 7
0
 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);
     }
 }
Ejemplo n.º 9
0
 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);
     }
 }
Ejemplo n.º 10
0
 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;
     }
 }
Ejemplo n.º 11
0
 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;
     }
 }
Ejemplo n.º 12
0
 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");
     }
 }
Ejemplo n.º 16
0
 public static void postSet_Parent(SecurityTestChild obj, PropertyPostSetterEventArgs<SecurityTestParent> e)
 {
     obj.Recalculate("ParentName");
 }
Ejemplo n.º 17
0
 public static void postSet_Blob(File obj, PropertyPostSetterEventArgs<Zetbox.App.Base.Blob> e)
 {
     if (e.OldValue != e.NewValue)
     {
         obj.ExtractText();
     }
 }
Ejemplo n.º 18
0
 public static void postSet_Excerpt(File obj, PropertyPostSetterEventArgs<Excerpt> e)
 {
     if (e.OldValue != null)
     {
         obj.Context.Delete(e.OldValue);
     }
 }
Ejemplo n.º 19
0
 public static void postSet_BaseObjectClass(Zetbox.App.Base.ObjectClass obj, PropertyPostSetterEventArgs<Zetbox.App.Base.ObjectClass> e)
 {
 }
Ejemplo n.º 20
0
 public static void postSet_LeftOn(State obj, PropertyPostSetterEventArgs <DateTime?> e)
 {
     obj.Recalculate("IsActive");
     obj.Instance.Recalculate("IsActive");
 }
Ejemplo n.º 21
0
 public static void postSet_FullName(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs <System.String> e)
 {
     obj.UpdateToStringCache();
 }
Ejemplo n.º 22
0
 public static void postSet_Name(SecurityTestParent obj, PropertyPostSetterEventArgs<string> e)
 {
     obj.Children.ForEach(c => c.Recalculate("ParentName"));
 }
Ejemplo n.º 23
0
 public static void postSet_Name(SecurityTestParent obj, PropertyPostSetterEventArgs <string> e)
 {
     obj.Children.ForEach(c => c.Recalculate("ParentName"));
 }
Ejemplo n.º 24
0
 public static void postSet_ObjectClass(Property obj, PropertyPostSetterEventArgs <DataType> e)
 {
     obj.Recalculate("CodeTemplate");
 }
Ejemplo n.º 25
0
 public static void postSet_Name(Method obj, PropertyPostSetterEventArgs <string> e)
 {
     obj.Recalculate("CodeTemplate");
 }
Ejemplo n.º 26
0
 public static void postSet_BaseObjectClass(Zetbox.App.Base.ObjectClass obj, PropertyPostSetterEventArgs <Zetbox.App.Base.ObjectClass> e)
 {
 }
Ejemplo n.º 27
0
 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");
 }
Ejemplo n.º 28
0
 public static void postSet_Parent(SecurityTestChild obj, PropertyPostSetterEventArgs <SecurityTestParent> e)
 {
     obj.Recalculate("ParentName");
 }
Ejemplo n.º 29
0
 public static void postSet_ObjectClass(Property obj, PropertyPostSetterEventArgs<DataType> e)
 {
     obj.Recalculate("CodeTemplate");
 }
Ejemplo n.º 30
0
        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;
            }
        }
Ejemplo n.º 31
0
 public static void postSet_Name(Method obj, PropertyPostSetterEventArgs<string> e)
 {
     obj.Recalculate("CodeTemplate");
 }
Ejemplo n.º 32
0
 public static void postSet_Assembly(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs <Zetbox.App.Base.Assembly> e)
 {
     obj.UpdateToStringCache();
 }
Ejemplo n.º 33
0
 public static void postSet_Rights(AccessControl obj, PropertyPostSetterEventArgs<AccessRights?> e)
 {
     obj.Recalculate("Description");
 }
Ejemplo n.º 34
0
 public static void postSet_IsCalculated(ValueTypeProperty obj, PropertyPostSetterEventArgs<bool> e)
 {
     obj.Recalculate("CodeTemplate");
 }
Ejemplo n.º 35
0
 public static void postSet_PaymentAmount(Receipt obj, PropertyPostSetterEventArgs <decimal> e)
 {
     UpdateCalculatedProperties(obj);
 }
Ejemplo n.º 36
0
 public static void postSet_AmountNet(InvoiceItem obj, PropertyPostSetterEventArgs <decimal> e)
 {
     NotifyInvoiceChanged(obj);
 }
Ejemplo n.º 37
0
 public static void postSet_Assembly(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs<Zetbox.App.Base.Assembly> e)
 {
     obj.UpdateToStringCache();
 }
Ejemplo n.º 38
0
 public static void postSet_Aufwand(Task obj, PropertyPostSetterEventArgs<double?> e)
 {
     if (obj.Projekt != null) obj.Projekt.Recalculate("AufwandGes");
 }
Ejemplo n.º 39
0
 public static void postSet_FullName(Zetbox.App.Base.TypeRef obj, PropertyPostSetterEventArgs<System.String> e)
 {
     obj.UpdateToStringCache();
 }
Ejemplo n.º 40
0
 public static void postSet_Group(GroupMembership obj, PropertyPostSetterEventArgs<Group> e)
 {
     obj.Recalculate("Description");
 }
Ejemplo n.º 41
0
 public static void postSet_Amount(Transaction obj, PropertyPostSetterEventArgs <decimal> e)
 {
     UpdateCalculatedProperties(obj);
 }