comparison SilverlightExampleApp/SilverlightExampleApp.Web/Factories/ClientFactory.cs @ 49:502f5f365649

Initial load for Silverlight Example Application
author Steven Hollidge <stevenhollidge@hotmail.com>
date Tue, 17 Apr 2012 17:57:52 +0100
parents
children
comparison
equal deleted inserted replaced
48:d617b54e1f47 49:502f5f365649
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Web;
5 using SilverlightExampleApp.Interfaces.Models;
6 using SilverlightExampleApp.Web.Models;
7
8 namespace SilverlightExampleApp.Web.Factories
9 {
10 public class ClientFactory
11 {
12 private static List<IClient> _clients = new List<IClient>(20)
13 {
14 new Client
15 {
16 Id = 1,
17 Title = TitleFactory.Get(1),
18 FirstName = "Andy",
19 FamilyName = "Appleton",
20 DateOfBirth = new DateTime(1951, 01, 01),
21 Residence = CountryFactory.Get(1),
22 ActiveFlag = true
23 },
24 new Client
25 {
26 Id = 2,
27 Title = TitleFactory.Get(2),
28 FirstName = "Ben",
29 FamilyName = "Birbeck",
30 DateOfBirth = new DateTime(1952, 02, 02),
31 Residence = CountryFactory.Get(2),
32 ActiveFlag = true
33 },
34 new Client
35 {
36 Id = 3,
37 Title = TitleFactory.Get(3),
38 FirstName = "Calvin",
39 FamilyName = "Clayton",
40 DateOfBirth = new DateTime(1953, 03, 03),
41 Residence = CountryFactory.Get(3),
42 ActiveFlag = true
43 },
44 new Client
45 {
46 Id = 4,
47 Title = TitleFactory.Get(4),
48 FirstName = "Derrick",
49 FamilyName = "Digby",
50 DateOfBirth = new DateTime(1954, 04, 04),
51 Residence = CountryFactory.Get(4),
52 ActiveFlag = true
53 },
54 new Client
55 {
56 Id = 5,
57 Title = TitleFactory.Get(5),
58 FirstName = "Eddie",
59 FamilyName = "Edwards",
60 DateOfBirth = new DateTime(1955, 05, 05),
61 Residence = CountryFactory.Get(5),
62 ActiveFlag = true
63 },
64 new Client
65 {
66 Id = 6,
67 Title = TitleFactory.Get(6),
68 FirstName = "Fred",
69 FamilyName = "Flint",
70 DateOfBirth = new DateTime(1956, 06, 06),
71 Residence = CountryFactory.Get(6),
72 ActiveFlag = true
73 },
74 new Client
75 {
76 Id = 7,
77 Title = TitleFactory.Get(7),
78 FirstName = "Greg",
79 FamilyName = "Gaynor",
80 DateOfBirth = new DateTime(1957, 07, 07),
81 Residence = CountryFactory.Get(7),
82 ActiveFlag = true
83 },
84 new Client
85 {
86 Id = 8,
87 Title = TitleFactory.Get(1),
88 FirstName = "Harry",
89 FamilyName = "Hillbilly",
90 DateOfBirth = new DateTime(1958, 08, 08),
91 Residence = CountryFactory.Get(1),
92 ActiveFlag = true
93 },
94 new Client
95 {
96 Id = 9,
97 Title = TitleFactory.Get(2),
98 FirstName = "Ingrid",
99 FamilyName = "Inglebert",
100 DateOfBirth = new DateTime(1959, 9, 9),
101 Residence = CountryFactory.Get(2),
102 ActiveFlag = true
103 },
104 new Client
105 {
106 Id = 10,
107 Title = TitleFactory.Get(3),
108 FirstName = "Jacqui",
109 FamilyName = "Jackson",
110 DateOfBirth = new DateTime(1960, 10, 10),
111 Residence = CountryFactory.Get(3),
112 ActiveFlag = true
113 },
114 new Client
115 {
116 Id = 11,
117 Title = TitleFactory.Get(1),
118 FirstName = "Kelly",
119 FamilyName = "Klackson",
120 DateOfBirth = new DateTime(1961, 01, 01),
121 Residence = CountryFactory.Get(4),
122 ActiveFlag = true
123 },
124 new Client
125 {
126 Id = 12,
127 Title = TitleFactory.Get(2),
128 FirstName = "Leo",
129 FamilyName = "Lyons",
130 DateOfBirth = new DateTime(1952, 02, 02),
131 Residence = CountryFactory.Get(5),
132 ActiveFlag = true
133 },
134 new Client
135 {
136 Id = 13,
137 Title = TitleFactory.Get(3),
138 FirstName = "Marcus",
139 FamilyName = "Matthews",
140 DateOfBirth = new DateTime(1953, 03, 03),
141 Residence = CountryFactory.Get(6),
142 ActiveFlag = true
143 },
144 new Client
145 {
146 Id = 14,
147 Title = TitleFactory.Get(4),
148 FirstName = "Nigel",
149 FamilyName = "Newton",
150 DateOfBirth = new DateTime(1954, 04, 04),
151 Residence = CountryFactory.Get(7),
152 ActiveFlag = true
153 },
154 new Client
155 {
156 Id = 15,
157 Title = TitleFactory.Get(5),
158 FirstName = "Otis",
159 FamilyName = "Otherson",
160 DateOfBirth = new DateTime(1955, 05, 05),
161 Residence = CountryFactory.Get(1),
162 ActiveFlag = true
163 },
164 new Client
165 {
166 Id = 16,
167 Title = TitleFactory.Get(6),
168 FirstName = "Paul",
169 FamilyName = "Pickles",
170 DateOfBirth = new DateTime(1956, 06, 06),
171 Residence = CountryFactory.Get(2),
172 ActiveFlag = true
173 },
174 new Client
175 {
176 Id = 17,
177 Title = TitleFactory.Get(7),
178 FirstName = "Richard",
179 FamilyName = "Rutherford",
180 DateOfBirth = new DateTime(1957, 07, 07),
181 Residence = CountryFactory.Get(3),
182 ActiveFlag = true
183 },
184 new Client
185 {
186 Id = 18,
187 Title = TitleFactory.Get(1),
188 FirstName = "Steve",
189 FamilyName = "Saunders",
190 DateOfBirth = new DateTime(1958, 08, 08),
191 Residence = CountryFactory.Get(4),
192 ActiveFlag = true
193 },
194 new Client
195 {
196 Id = 19,
197 Title = TitleFactory.Get(2),
198 FirstName = "Tommy",
199 FamilyName = "Tackle",
200 DateOfBirth = new DateTime(1959, 9, 9),
201 Residence = CountryFactory.Get(5),
202 ActiveFlag = true
203 },
204 new Client
205 {
206 Id = 20,
207 Title = TitleFactory.Get(3),
208 FirstName = "Yohan",
209 FamilyName = "Yatz",
210 DateOfBirth = new DateTime(1960, 10, 10),
211 Residence = CountryFactory.Get(6),
212 ActiveFlag = true
213 }
214 };
215
216 public static IList<IClient> GetAll()
217 {
218 return _clients;
219 }
220
221 public static IClient Get(int id)
222 {
223 return _clients.FirstOrDefault(c => id == c.Id);
224 }
225 }
226 }