This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi,
With a couple of mod's I've had a lot of success with this Money DataType and wanted to implement it in LightSpeed: http://www.codeproject.com/KB/vb/moneyDatatype.aspx
5 minutes later following Ivan's article: http://www.mindscape.co.nz/blog/index.php/2010/08/22/ninja-data-type-mappings-in-lightspeed/
public class MoneyConverter : IFieldConverter { public object ConvertFromDatabase(object databaseValue) { return new Money((decimal)databaseValue, System.Globalization.CultureInfo.CurrentCulture); }
public object ConvertToDatabase(object value) { //Pass in the Money.Value property as the value parameter return (decimal)value; } }
Pic of the User Defined Type properties and below see the Money DataType is available in the drop down list:
|
|
|
Awesome! Thanks for posting this Jeremy - it's a great example of extending LightSpeed :-) I'm going to post this on the blog to help ensure more LightSpeed users see this. Cheers, John-Daniel |
|