-
Hi! Our Silverlight 5 application's BOL has a couple of business objects with pretty deep hierarchy. Such as ProductEdit => SectionList => SectionEdit => FieldList => StepList => StepEdit =>SecuritySettingsList=>etc. Some validation rules defined on child level but other like...
-
I know how to create custom validation attributes and I know how to make ASP.MVC client validation work with those attributes if I implement IClientValidatable interface, but then I would need to reference System.Web.MVC in the library containing my CSLA objects. Is it possible to create a custom validation...
-
Hi, I have a problem with new rule engine 4.5 of CSLA. While returning object (not value!) from asynchronus validation rule with using RuleContext.AddOutValue, property is not being set if value from rule and the one that is currently present on property are equal (Object.Equals). I was wondering do...
-
This is a featuire not a bug. In the simple case, the validity of the rule is determined by a single property. For example, a telephone number must have so many numeric digits; any other condition causes the rule to fail. But there are situations where several values must be inspected to establish the...
-
Hi, I was wondering if there is a way to suppress a specific validation rule when calling ICheckRules.CheckRules? I have a Name property on an object, and it has 2 rules registered to it: a Required rule, and an async NameUnique rule, which checks in the database if the name already exists. Since in...
-
Hi, I was hoping to create a common validation rule which would modify the data of a property. If the phone number provided is only 7 digits, automatically append a default area code. If i create the rule for each class that has a phone number, this is not an issue, as I can access LoadProperty to set...
-
Hi, We use CSLA 3.6.2 on windows 7 with vs2010. Our app can be run in multiple languages with English as our primary language. Our problem is that when the app's culture is set to something other than English (de-DE), the string returned from a StringRequired validation is an English property name...
-
Hello, We are using CSLA 4 and Prism 4 for a WPF application. Currently, we are using the CSLA.ViewModelBase for our view models. The first time I navigate to a view, the object is created and the validation errors show correctly. The issue comes the second time I load the view. It seems like the PropertyStatus...
-
We are using CSLA 3.8.x and want to build some validation rules that configure some default values whenever a property has changed. We are using validation rules as has been suggested on this forum, so to minimize the amount of code that goes into the setter methods in our properties. However, this causes...
-
Hello, I've a Custom Rules that checks if the user entered a valid numerical value (Double.TryParse) I override the AddBusinessRules Method and added the rule like this: BusinessRules.AddRule(new Business.CustomRules.Numerical(PreislistePos.PreisNormalProperty)); It works fine, as long as the user...
-
Generally in a case like this I would determine one property only as the primary, in this case I would nominate end-date and build the rule and then also add a start-date as a dependent property (using 3.8 rules engine). So that when the start date value was changed it will fire the end-date business...
-
So then again, here comes my question unchanged: How do the built-in validation rules (e.g. StringRequired) handle this issue in 3.8.4 vs. 4? P.S.: In any of my posts did I say that rules were called from a getter, but the rules themselves call the getter to do their work.
-
I finally found the issue. It is an old one that I often struggled with: The DataAnnotation rule accesses the object's properties just like any user would. So if CanReadProperty returns false, the rule just sees a default value (""|0|NULL). This somehow contradicts: [quote user="RockfordLhotka"...
-
I have a WPF Textbox with its Visibility bound to the CanRead property of a Csla.Wpf.PropertyStatus control. The Text is bound to a string property of my business object which is decorated with the Required attribute from the System.ComponentModel.DataAnnotations namespace. When CanRead evaluates to...
-
I have a site where members are able to select the country they are from. If they are from the US, I need to validate that they enter a zip code. If international, I need to validate that a region and city name are specified. I have two questions with validating several dependent properties... Question...
-
Hi All, Is there any way to call a validation rule only when saving the object and not whenever the property is set? If so should that validaiton be set on a particular property? Last option I see is to make the validation rule a method and call it before save. Please let me know if there are other ways...
-
Hello! I want to Validate 2 Fields MinValue and MaxValue, that MaxValue is more or equal to MinValue. My first Solution was to make one Validation Object, but this doesn't Work because the Data Portal throw an exception that there ist already a Element with the same name. My Code (try) with one Validation...
-
Hi We are using CSLA version 2.0 on .NET 2.0 VS2005. In my project, I'm using a datagridview, with child data. In the design, we add extra rows to the datagridview on the Fetch. We do this so that the user doesn't have to add additional rows; they are only allowed a certain number. Any ways that...
-
Thansk for the reply. 1. The rules does point to static methods. Here is an example: public static bool HasValidAccountingPeriod ( VoucherLine target, RuleArgs ruleArgs) { if (target. AccountingPeriod == null ) { ruleArgs. Description = GetIsRequiredDescription (ruleArgs); return false ; } if (target...
-
Hi, I have the following code: protected override void AddBusinessRules() { // Do not validate is marked deleted if (IsDeleted) return; AddValidationRule(AccountingClientProperty, VoucherLineValidator.HasValidAccountingClient); AddValidationRule(AccountingPeriodProperty, VoucherLineValidator.HasValidAccountingPeriod...