Shawn,
>I have added a broken rules object to by Business Object.
>In the code I added error messages via the AddErrorProviderBrokenRule
>This item receives two parameters, one being the column name and the other being the message.
>
>I do not want the message to have the column name displayed, I just want the message displayed, how can I turn this off.
I'm going to be changing this in an upcoming release of MM .NET so you'll just be able to inherit this functionality.
>Also how do I call the localization in code to get the message localized.
>How do I do it in the example below.
>
>
> Message = "The Company User ID already exists in the database please select another Company User ID";
> this.AddErrorProviderBrokenRule("CompanyUserID",Message);
>
You can easily localize business rule messages by using the MM .NET Message Manager. For example
In C#:
string message = "Must specify a ship name";
if (mmAppBase.Localize)
{
message = mmAppBase.MessageMgr.GetMessage(message);
}
this.AddErrorProviderBrokenRule("ShipName", message);
And in VB .NET:
Dim message As String = "Must specify a ship name"
If mmAppBase.Localize Then
message = mmAppBase.MessageMgr.GetMessage(message)
End If
Me.AddErrorProviderBrokenRule("ShipName", message);
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com