-
I have a Silverlight 4 application and just recently added some validation to one of my root object's children. One of their fields value must be greater than 1, so I added a new business rule: BusinessRules.AddRule( new Csla.Rules.CommonRules. MinValue < int >(MyProperty,1)); The children...
-
I am having trouble implementing two very simple business rules, one updater and one validator. The first rule, verifies if a bool property "IsSelected" is true. If so, it sets the value of a second (a string) property to "". The second rule creates a broken rule if the second property...
-
I REALLY hate property rules that depend on other properties because I can never make up my mind on how to deal with these type of broken rules. The canonical example is the Start and End time properties when both of these properties reside on the same object. For example, supposed that “Start...
-
Hello, When my new object is created (IsNew == true), the object starts up with several broken rules. So I thought I would be nice to create a unit test that creates a new object and makes sure that the appropriate initial broken rules are present. This is all good but my problem is that I am not sure...
-
I am trying to write a rule that compares 4 properties and adds a warning result to all 4 properties when some condition exists. In the ctor I am adding all properties to the InputProperties and adding the non-primary properties to the AffectedProperties like so: public UsiUniqueClient( IPropertyInfo...
-
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...
-
Hi All, I have a form with some silverlight data bound controls along with the csla propertystatus controls. Now the business object it is bound to, have some business rules in it. If I am explicitly making changes to the data in the control which in turn triggers any validation error i am getting a...
-
Hi. I have the fallowing problem: My BusinessObject has two Properties, which should be checked by a businessRule: DefaultInchargeModeProperty - this is of type byte and has 0, 1 or 2 as value. DefaultInchargeUserProperty - this is a ReadOnlyObject. Now, when DefaultInchargeMode has the value 2, DefaultInchargeUserProperty...
-
How do you add to the BrokenRulesCollection? I see that there is a method, AddRange( List <BrokenRule> list) But I don't see how you can even create the list of BrokenRules because there is no constructor for the BrokenRules class and the member varaibles have no public set.
-
We keep running into issues where developers on our team hook up a UI to a large object graph and then have trouble saving the parent object due to invalidity existing in various child objects. I came up with an idea: Serialize the object graph to XML and parse the XML to return a list of broken rules...
-
Hi, I am using CSLA 3.0.5.0. I have one instance - On edit of an object does not permit users to edit certain properties in accordance with the value of another property . For example there is an object Person with properties Name, age,active. If a person want to edit person details he will load the...
-
I am trying to learn how to add custom business rules. I am using CSLA 3.8 and I understand the basics from the book about adding a business rule like the common rules. I have an object that has FlightTime (decimal) property. This object has 2 other properties whose sum cannot exceed FlightTime, but...
-
Hello, I'm currently working on a project featuring localization depending on a login related culture. Basically, for each user logged in, there can be a different culture assigned (in DB). I have defined rules that have to be checked either on on server or on client side (or even on both sides)...
-
In CSLA 3.x you could provide extra information to the rule, but you couldn't extend the BrokenRule type that is contained in BrokenRulesCollection. To provide extra information to the rule you would create a subclass of RuleArgs or use DecoratedRuleArgs. In CSLA 4 you provide extra information to...