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.
PersonWIthSmartDateField.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="PersonWIthSmartDateField.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;
10using Csla;
11
13{
15 public class PersonWIthSmartDateField : BusinessBase<PersonWIthSmartDateField>
16 {
17 static PersonWIthSmartDateField() { }
18
19 public static PersonWIthSmartDateField GetPersonWIthSmartDateField(string personName, int year)
20 {
22 person.LoadProperty(NameProperty, personName);
23 person.LoadProperty(BirthdateProperty, new SmartDate(new DateTime(year, 1, 1)));
24 return person;
25 }
26
27 public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(typeof(PersonWIthSmartDateField), new PropertyInfo<string>("Name"));
28
29 public static readonly PropertyInfo<SmartDate> BirthdateProperty = RegisterProperty<SmartDate>(
31 new PropertyInfo<SmartDate>("Birthdate"));
32
33 public string Name
34 {
35 get { return GetProperty<string>(NameProperty); }
36 }
37
39 {
40 get { return GetProperty<SmartDate>(BirthdateProperty); }
41 set { SetProperty(BirthdateProperty, value); }
42 }
43 }
44}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
Maintains metadata about a property.
static PersonWIthSmartDateField GetPersonWIthSmartDateField(string personName, int year)
static readonly PropertyInfo< SmartDate > BirthdateProperty
@ Serializable
Prevents updating or inserting until the transaction is complete.
Provides a date data type that understands the concept of an empty date value.
Definition: SmartDate.cs:32