CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
HasRulesManager.partial.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="HasRulesManager.partial.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>no summary</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Collections.Generic;
10using System.Linq;
11using System.Text;
12
14{
15 public partial class HasRulesManager
16 {
17 [Create]
18 private void DataPortal_Create(object criteria)
19 {
20 Criteria crit = (Criteria)(criteria);
21 using (BypassPropertyChecks)
22 Name = crit._name;
23 TestResults.Add("HasRulesManager", "Created");
24 BusinessRules.CheckRules();
25 }
26
27 [Fetch]
28 protected void DataPortal_Fetch(object criteria)
29 {
30 Criteria crit = (Criteria)(criteria);
31 using (BypassPropertyChecks)
32 Name = crit._name;
33 MarkOld();
34 TestResults.Add("HasRulesManager", "Fetched");
35 }
36
37 [Update]
38 protected void DataPortal_Update()
39 {
40 if (IsDeleted)
41 {
42 //we would delete here
43 TestResults.Add("HasRulesManager", "Deleted");
44 MarkNew();
45 }
46 else
47 {
48 if (this.IsNew)
49 {
50 //we would insert here
51 TestResults.Add("HasRulesManager", "Inserted");
52 }
53 else
54 {
55 //we would update here
56 TestResults.Add("HasRulesManager", "Updated");
57 }
58 MarkOld();
59 }
60 }
61 }
62}
Static dictionary-like class that offers similar functionality to GlobalContext This is used in tests...
Definition: TestResults.cs:21
static void Add(string key, string value)
Add an item to the test results, to indicate an outcome of a particular operation
Definition: TestResults.cs:29
@ Update
Update operation (includes insert, update and delete self).
@ Fetch
Fetch operation.
@ Create
Create operation.