Walaa wrote:
1- if you just want it for saving in the database, you may have it in the validation code, or handle the OnSaveEntity() event.
OnSaveEntity is to late as I want to do it on field change.
As far as I can see the Validate code only allows/disallows a change i.e. I can't actually modify and allow a change e.g this has no effect:
public virtual bool Validate(int fieldIndex, object value)
{
switch ((SystemUserFieldIndex)fieldIndex)
{
case SystemUserFieldIndex.UserName:
value = ((string)value).ToUpper();
break;
Walaa wrote:
2- if you want it for good, then I would suggest adding your custom property to the Entity class, which sets the original property as you want. Use this custom property through out your UI.
Add something maybe called UpperCasedUserName? Seems like a sledgehammer to crack a nut.
Is there anyway to prevent the UI guys using the original field?
What would be ideal is the ability to override the getters and setters but seeing I can't maybe I could use this Event Handler.
/// <summary> Event which is thrown when UserName changes value. Databinding related.</summary>
public event EventHandler UserNameChanged;