Page 1 of 1

Decimal properity value cannot post from .net to jade

Posted: Fri Aug 07, 2009 1:29 pm
by ConvertFromOldNGs
by Didier >> Wed, 29 Jul 2009 1:46:34 GMT

hi:
We develope a system , customer can create an order on web.
My Web is .net(C#) and DB is Jade.

we define class Order which has the following properties:
.qty : Integer
.unitPrice : Decimal[12,2]

the following code fragement:
=================================================================================== process.BeginTransaction(JomTransactionType.Persistent);
Order order = new Order(ClassPersistence.Persistent);
...
order.SetQty( 1 );
order.SetUnitPrice( 100.00 );
...
process.CommitTransaction(JomTransactionType.Persistent);
===================================================================================

we found that in Jade for this order qty=1, but unitPrice=0;

By my testing, we can set Integer , String and reference properties value correctly,
but Decimal properties value can not be set.

What's wrong? How to walk around ?

Attached is Exposured Order class file.

Appreciate for any help.

Didier
2009.7.29

Re: Decimal properity value cannot post from .net to jade

Posted: Fri Aug 07, 2009 1:29 pm
by ConvertFromOldNGs
by Dean Cooper >> Fri, 31 Jul 2009 1:29:24 GMT

We can confirm that the behaviour is a bug with decimals which occurs when
running under Unicode. We have opened a PAR to address this.

Dean.

Re: Decimal properity value cannot post from .net to jade

Posted: Fri Aug 07, 2009 1:29 pm
by ConvertFromOldNGs
by Dean Cooper >> Fri, 31 Jul 2009 9:59:31 GMT

The problem has been fixed in 6.3.5, due for release at the end of November.
As possible workaround until then is as follows.

As we understand it, you currently have a set method in JADE that takes a
decimal parameter which sets the property to that value.

A workaround would be to implement another set method which takes either a
Real or a String etc; and do the conversion from the parameter type to a
Decimal inside JADE. So something like:

setUnitPriceFromReal(real : Real) updating;begin

self.unitPrice := real.Decimal;
end;

You will then need to expose this new method to .NET and invoke it via your
...NET app passing the new type.

Dean.

Re: Decimal properity value cannot post from .net to jade

Posted: Fri Aug 07, 2009 1:29 pm
by ConvertFromOldNGs
by Didier >> Sat, 1 Aug 2009 0:42:11 GMT

Thanks.

Didier
2009.8.1