Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Localization and BrokenRulesProvider
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00931053
Message ID:
00931321
Views:
17
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform