Pls check the PTracker example for more details.
In your business object
protected
override void AddBusinessRules(){
// Add your req validations - here as an example we want to verify "Name" column with a method called ValueRequired.ValidationRules.AddRule(CommonRules.ValueRequired, "Name");
}
In the ValueRequired method which will define in this way:
static
public bool ValueRequired(object target, Csla.Validation.RuleArgs e){
// Do checks here, if result is false then
if (!Result){
e.Description =
String.Format("Value Cannot be Blank", e.PropertyName); return false;}
}
This will set the error message for that column. I hope have understood your question properly.
Vinodonly:Pls check the PTracker example for more details.
In your business object
protected override void AddBusinessRules()
{
// Add your req validations - here as an example we want to verify "Name" column with a method called ValueRequired.
ValidationRules.AddRule(CommonRules.ValueRequired, "Name");
}
In the ValueRequired method which will define in this way:
static public bool ValueRequired(object target, Csla.Validation.RuleArgs e)
{
// Do checks here, if result is false then
if (!Result)
{
e.Description = String.Format("Value Cannot be Blank", e.PropertyName);
return false;
}
}
This will set the error message for that column. I hope have understood your question properly.
Copyright (c) Marimer LLC