1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace TestSiteARSupport
.Model
19 using Castle
.ActiveRecord
;
21 using Iesi
.Collections
;
23 [ActiveRecord("TSAS_ProdLicense")]
24 public class ProductLicense
: ActiveRecordBase
27 private DateTime created
;
28 private DateTime expires
;
29 private ISet accounts
= new ListSet();
31 public ProductLicense()
33 created
= DateTime
.Now
;
34 expires
= DateTime
.Now
.AddDays(1);
44 [Property(Update
=false, Insert
=true)]
45 public DateTime Created
47 get { return created; }
48 set { created = value; }
52 public DateTime Expires
54 get { return expires; }
55 set { expires = value; }
58 [HasMany(typeof(Account
), Inverse
=false)]
61 get { return accounts; }
62 set { accounts = value; }
65 public override string ToString()
67 return String
.Format("License Created at {0} Expires at {1}",
68 created
.ToShortDateString(), expires
.ToShortDateString());
71 public static ProductLicense
[] FindAll()
73 return (ProductLicense
[]) ActiveRecordBase
.FindAll(typeof(ProductLicense
));