Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs @ 3948

Last change on this file since 3948 was 3943, checked in by hmayr, 14 years ago

following changes (#1046):

  • extended DatabaseUtil.cs
  • extended HeuristicLabUser.cs
  • created HeuristicLabUserTest.cs
  • created AbstractHeuristicLabTest.cs
  • implemented a demo method in HeuristicLabMembershipProvider.cs to show usage of HeuristicLabUser.cs and DatabaseUtil.cs
File size: 19.5 KB
Line 
1#pragma warning disable 1591
2//------------------------------------------------------------------------------
3// <auto-generated>
4//     This code was generated by a tool.
5//     Runtime Version:2.0.50727.4927
6//
7//     Changes to this file may cause incorrect behavior and will be lost if
8//     the code is regenerated.
9// </auto-generated>
10//------------------------------------------------------------------------------
11
12namespace Persistence
13{
14  using System.Data.Linq;
15  using System.Data.Linq.Mapping;
16  using System.Data;
17  using System.Collections.Generic;
18  using System.Reflection;
19  using System.Linq;
20  using System.Linq.Expressions;
21  using System.ComponentModel;
22  using System;
23 
24 
25  public partial class DataClassesDataContext : System.Data.Linq.DataContext
26  {
27   
28    private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
29   
30    #region Extensibility Method Definitions
31    partial void OnCreated();
32    partial void InsertHeuristicLabUser(HeuristicLabUser instance);
33    partial void UpdateHeuristicLabUser(HeuristicLabUser instance);
34    partial void DeleteHeuristicLabUser(HeuristicLabUser instance);
35    partial void InsertHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
36    partial void UpdateHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
37    partial void DeleteHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
38    partial void InsertHeuristicLabUserRole(HeuristicLabUserRole instance);
39    partial void UpdateHeuristicLabUserRole(HeuristicLabUserRole instance);
40    partial void DeleteHeuristicLabUserRole(HeuristicLabUserRole instance);
41    #endregion
42   
43    public DataClassesDataContext(string connection) :
44        base(connection, mappingSource)
45    {
46      OnCreated();
47    }
48   
49    public DataClassesDataContext(System.Data.IDbConnection connection) :
50        base(connection, mappingSource)
51    {
52      OnCreated();
53    }
54   
55    public DataClassesDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
56        base(connection, mappingSource)
57    {
58      OnCreated();
59    }
60   
61    public DataClassesDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
62        base(connection, mappingSource)
63    {
64      OnCreated();
65    }
66   
67    public System.Data.Linq.Table<HeuristicLabUser> HeuristicLabUsers
68    {
69      get
70      {
71        return this.GetTable<HeuristicLabUser>();
72      }
73    }
74   
75    public System.Data.Linq.Table<HeuristicLabAbstractRole> HeuristicLabAbstractRoles
76    {
77      get
78      {
79        return this.GetTable<HeuristicLabAbstractRole>();
80      }
81    }
82   
83    public System.Data.Linq.Table<HeuristicLabUserRole> HeuristicLabUserRole
84    {
85      get
86      {
87        return this.GetTable<HeuristicLabUserRole>();
88      }
89    }
90  }
91 
92  [Table(Name="")]
93  public partial class HeuristicLabUser : INotifyPropertyChanging, INotifyPropertyChanged
94  {
95   
96    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
97   
98    private long _id = default(long);
99   
100    private string _UserName = default(string);
101   
102    private string _Password;
103   
104    private System.DateTime _LastPasswordChangedDate = default(System.DateTime);
105   
106    private string _PasswordQuestion = default(string);
107   
108    private string _PasswordAnswer;
109   
110    private string _Email;
111   
112    private string _Comment;
113   
114    private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
115   
116    #region Extensibility Method Definitions
117    partial void OnLoaded();
118    partial void OnValidate(System.Data.Linq.ChangeAction action);
119    partial void OnCreated();
120    partial void OnPasswordChanging(string value);
121    partial void OnPasswordChanged();
122    partial void OnPasswordAnswerChanging(string value);
123    partial void OnPasswordAnswerChanged();
124    partial void OnEmailChanging(string value);
125    partial void OnEmailChanged();
126    partial void OnCommentChanging(string value);
127    partial void OnCommentChanged();
128    #endregion
129   
130    public HeuristicLabUser()
131    {
132      this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
133      OnCreated();
134    }
135   
136    [Column(Name="id", Storage="_id", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
137    public long ID
138    {
139      get
140      {
141        return this._id;
142      }
143    }
144   
145    [Column(Storage="_UserName", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
146    public virtual string UserName
147    {
148      get
149      {
150        return this._UserName;
151      }
152    }
153   
154    [Column(Storage="_Password", CanBeNull=false)]
155    public string Password
156    {
157      get
158      {
159        return this._Password;
160      }
161      set
162      {
163        if ((this._Password != value))
164        {
165          this.OnPasswordChanging(value);
166          this.SendPropertyChanging();
167          this._Password = value;
168          this.SendPropertyChanged("Password");
169          this.OnPasswordChanged();
170        }
171      }
172    }
173   
174    [Column(Storage="_LastPasswordChangedDate", UpdateCheck=UpdateCheck.Never)]
175    public virtual System.DateTime LastPasswordChangedDate
176    {
177      get
178      {
179        return this._LastPasswordChangedDate;
180      }
181    }
182   
183    [Column(Storage="_PasswordQuestion", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
184    public virtual string PasswordQuestion
185    {
186      get
187      {
188        return this._PasswordQuestion;
189      }
190    }
191   
192    [Column(Storage="_PasswordAnswer", CanBeNull=false)]
193    public string PasswordAnswer
194    {
195      get
196      {
197        return this._PasswordAnswer;
198      }
199      set
200      {
201        if ((this._PasswordAnswer != value))
202        {
203          this.OnPasswordAnswerChanging(value);
204          this.SendPropertyChanging();
205          this._PasswordAnswer = value;
206          this.SendPropertyChanged("PasswordAnswer");
207          this.OnPasswordAnswerChanged();
208        }
209      }
210    }
211   
212    [Column(Storage="_Email", CanBeNull=false)]
213    public virtual string Email
214    {
215      get
216      {
217        return this._Email;
218      }
219      set
220      {
221        if ((this._Email != value))
222        {
223          this.OnEmailChanging(value);
224          this.SendPropertyChanging();
225          this._Email = value;
226          this.SendPropertyChanged("Email");
227          this.OnEmailChanged();
228        }
229      }
230    }
231   
232    [Column(Storage="_Comment", CanBeNull=false)]
233    public virtual string Comment
234    {
235      get
236      {
237        return this._Comment;
238      }
239      set
240      {
241        if ((this._Comment != value))
242        {
243          this.OnCommentChanging(value);
244          this.SendPropertyChanging();
245          this._Comment = value;
246          this.SendPropertyChanged("Comment");
247          this.OnCommentChanged();
248        }
249      }
250    }
251   
252    [Association(Name="HeuristicLabUser_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabUserID")]
253    public EntitySet<HeuristicLabUserRole> HeuristicLabUserRole
254    {
255      get
256      {
257        return this._HeuristicLabUserRole;
258      }
259      set
260      {
261        this._HeuristicLabUserRole.Assign(value);
262      }
263    }
264   
265    public event PropertyChangingEventHandler PropertyChanging;
266   
267    public event PropertyChangedEventHandler PropertyChanged;
268   
269    protected virtual void SendPropertyChanging()
270    {
271      if ((this.PropertyChanging != null))
272      {
273        this.PropertyChanging(this, emptyChangingEventArgs);
274      }
275    }
276   
277    protected virtual void SendPropertyChanged(String propertyName)
278    {
279      if ((this.PropertyChanged != null))
280      {
281        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
282      }
283    }
284   
285    private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
286    {
287      this.SendPropertyChanging();
288      entity.HeuristicLabUser = this;
289    }
290   
291    private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
292    {
293      this.SendPropertyChanging();
294      entity.HeuristicLabUser = null;
295    }
296  }
297 
298  [Table(Name="")]
299  [InheritanceMapping(Code="permission", Type=typeof(HeuristicLabPermissionRole))]
300  [InheritanceMapping(Code="role", Type=typeof(HeuristicLabRole), IsDefault=true)]
301  public abstract partial class HeuristicLabAbstractRole : INotifyPropertyChanging, INotifyPropertyChanged
302  {
303   
304    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
305   
306    private long _ID = default(long);
307   
308    private string _roleName;
309   
310    private long _parentRoleID;
311   
312    private string _RoleType = default(string);
313   
314    private EntitySet<HeuristicLabAbstractRole> _HeuristicLabAbstractRole2;
315   
316    private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
317   
318    private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole1;
319   
320    #region Extensibility Method Definitions
321    partial void OnLoaded();
322    partial void OnValidate(System.Data.Linq.ChangeAction action);
323    partial void OnCreated();
324    partial void OnRoleNameChanging(string value);
325    partial void OnRoleNameChanged();
326    partial void OnParentRoleIDChanging(long value);
327    partial void OnParentRoleIDChanged();
328    #endregion
329   
330    public HeuristicLabAbstractRole()
331    {
332      this._HeuristicLabAbstractRole2 = new EntitySet<HeuristicLabAbstractRole>(new Action<HeuristicLabAbstractRole>(this.attach_HeuristicLabAbstractRole2), new Action<HeuristicLabAbstractRole>(this.detach_HeuristicLabAbstractRole2));
333      this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
334      this._HeuristicLabAbstractRole1 = default(EntityRef<HeuristicLabAbstractRole>);
335      OnCreated();
336    }
337   
338    [Column(Storage="_ID", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true, UpdateCheck=UpdateCheck.Never)]
339    public long ID
340    {
341      get
342      {
343        return this._ID;
344      }
345    }
346   
347    [Column(Name="roleName", Storage="_roleName", CanBeNull=false)]
348    public string RoleName
349    {
350      get
351      {
352        return this._roleName;
353      }
354      set
355      {
356        if ((this._roleName != value))
357        {
358          this.OnRoleNameChanging(value);
359          this.SendPropertyChanging();
360          this._roleName = value;
361          this.SendPropertyChanged("RoleName");
362          this.OnRoleNameChanged();
363        }
364      }
365    }
366   
367    [Column(Name="parentRoleID", Storage="_parentRoleID")]
368    public long ParentRoleID
369    {
370      get
371      {
372        return this._parentRoleID;
373      }
374      set
375      {
376        if ((this._parentRoleID != value))
377        {
378          this.OnParentRoleIDChanging(value);
379          this.SendPropertyChanging();
380          this._parentRoleID = value;
381          this.SendPropertyChanged("ParentRoleID");
382          this.OnParentRoleIDChanged();
383        }
384      }
385    }
386   
387    [Column(Storage="_RoleType", CanBeNull=false, UpdateCheck=UpdateCheck.Never, IsDiscriminator=true)]
388    public string RoleType
389    {
390      get
391      {
392        return this._RoleType;
393      }
394    }
395   
396    [Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole2", ThisKey="ID", OtherKey="ParentRoleID")]
397    public EntitySet<HeuristicLabAbstractRole> HeuristicLabAbstractRole2
398    {
399      get
400      {
401        return this._HeuristicLabAbstractRole2;
402      }
403      set
404      {
405        this._HeuristicLabAbstractRole2.Assign(value);
406      }
407    }
408   
409    [Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")]
410    public EntitySet<HeuristicLabUserRole> HeuristicLabUserRole
411    {
412      get
413      {
414        return this._HeuristicLabUserRole;
415      }
416      set
417      {
418        this._HeuristicLabUserRole.Assign(value);
419      }
420    }
421   
422    [Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole1", ThisKey="ParentRoleID", OtherKey="ID", IsForeignKey=true)]
423    public HeuristicLabAbstractRole HeuristicLabAbstractRole1
424    {
425      get
426      {
427        return this._HeuristicLabAbstractRole1.Entity;
428      }
429      set
430      {
431        HeuristicLabAbstractRole previousValue = this._HeuristicLabAbstractRole1.Entity;
432        if (((previousValue != value)
433              || (this._HeuristicLabAbstractRole1.HasLoadedOrAssignedValue == false)))
434        {
435          this.SendPropertyChanging();
436          if ((previousValue != null))
437          {
438            this._HeuristicLabAbstractRole1.Entity = null;
439            previousValue.HeuristicLabAbstractRole2.Remove(this);
440          }
441          this._HeuristicLabAbstractRole1.Entity = value;
442          if ((value != null))
443          {
444            value.HeuristicLabAbstractRole2.Add(this);
445            this._parentRoleID = value.ID;
446          }
447          else
448          {
449            this._parentRoleID = default(long);
450          }
451          this.SendPropertyChanged("HeuristicLabAbstractRole1");
452        }
453      }
454    }
455   
456    public event PropertyChangingEventHandler PropertyChanging;
457   
458    public event PropertyChangedEventHandler PropertyChanged;
459   
460    protected virtual void SendPropertyChanging()
461    {
462      if ((this.PropertyChanging != null))
463      {
464        this.PropertyChanging(this, emptyChangingEventArgs);
465      }
466    }
467   
468    protected virtual void SendPropertyChanged(String propertyName)
469    {
470      if ((this.PropertyChanged != null))
471      {
472        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
473      }
474    }
475   
476    private void attach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
477    {
478      this.SendPropertyChanging();
479      entity.HeuristicLabAbstractRole1 = this;
480    }
481   
482    private void detach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
483    {
484      this.SendPropertyChanging();
485      entity.HeuristicLabAbstractRole1 = null;
486    }
487   
488    private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
489    {
490      this.SendPropertyChanging();
491      entity.HeuristicLabAbstractRole = this;
492    }
493   
494    private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
495    {
496      this.SendPropertyChanging();
497      entity.HeuristicLabAbstractRole = null;
498    }
499  }
500 
501  public partial class HeuristicLabPermissionRole : HeuristicLabAbstractRole
502  {
503   
504    #region Extensibility Method Definitions
505    partial void OnLoaded();
506    partial void OnValidate(System.Data.Linq.ChangeAction action);
507    partial void OnCreated();
508    #endregion
509   
510    public HeuristicLabPermissionRole()
511    {
512      OnCreated();
513    }
514  }
515 
516  public partial class HeuristicLabRole : HeuristicLabAbstractRole
517  {
518   
519    #region Extensibility Method Definitions
520    partial void OnLoaded();
521    partial void OnValidate(System.Data.Linq.ChangeAction action);
522    partial void OnCreated();
523    #endregion
524   
525    public HeuristicLabRole()
526    {
527      OnCreated();
528    }
529  }
530 
531  [Table(Name="")]
532  public partial class HeuristicLabUserRole : INotifyPropertyChanging, INotifyPropertyChanged
533  {
534   
535    private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
536   
537    private long _ID;
538   
539    private long _HeuristicLabUserID;
540   
541    private long _HeuristicLabRoleID;
542   
543    private EntityRef<HeuristicLabUser> _HeuristicLabUser;
544   
545    private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole;
546   
547    #region Extensibility Method Definitions
548    partial void OnLoaded();
549    partial void OnValidate(System.Data.Linq.ChangeAction action);
550    partial void OnCreated();
551    partial void OnIDChanging(long value);
552    partial void OnIDChanged();
553    partial void OnHeuristicLabUserIDChanging(long value);
554    partial void OnHeuristicLabUserIDChanged();
555    partial void OnHeuristicLabRoleIDChanging(long value);
556    partial void OnHeuristicLabRoleIDChanged();
557    #endregion
558   
559    public HeuristicLabUserRole()
560    {
561      this._HeuristicLabUser = default(EntityRef<HeuristicLabUser>);
562      this._HeuristicLabAbstractRole = default(EntityRef<HeuristicLabAbstractRole>);
563      OnCreated();
564    }
565   
566    [Column(Storage="_ID", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true)]
567    public long ID
568    {
569      get
570      {
571        return this._ID;
572      }
573      set
574      {
575        if ((this._ID != value))
576        {
577          this.OnIDChanging(value);
578          this.SendPropertyChanging();
579          this._ID = value;
580          this.SendPropertyChanged("ID");
581          this.OnIDChanged();
582        }
583      }
584    }
585   
586    [Column(Storage="_HeuristicLabUserID")]
587    public long HeuristicLabUserID
588    {
589      get
590      {
591        return this._HeuristicLabUserID;
592      }
593      set
594      {
595        if ((this._HeuristicLabUserID != value))
596        {
597          if (this._HeuristicLabUser.HasLoadedOrAssignedValue)
598          {
599            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
600          }
601          this.OnHeuristicLabUserIDChanging(value);
602          this.SendPropertyChanging();
603          this._HeuristicLabUserID = value;
604          this.SendPropertyChanged("HeuristicLabUserID");
605          this.OnHeuristicLabUserIDChanged();
606        }
607      }
608    }
609   
610    [Column(Storage="_HeuristicLabRoleID")]
611    public long HeuristicLabRoleID
612    {
613      get
614      {
615        return this._HeuristicLabRoleID;
616      }
617      set
618      {
619        if ((this._HeuristicLabRoleID != value))
620        {
621          if (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue)
622          {
623            throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
624          }
625          this.OnHeuristicLabRoleIDChanging(value);
626          this.SendPropertyChanging();
627          this._HeuristicLabRoleID = value;
628          this.SendPropertyChanged("HeuristicLabRoleID");
629          this.OnHeuristicLabRoleIDChanged();
630        }
631      }
632    }
633   
634    [Association(Name="HeuristicLabUser_HeuristicLabUserRole", Storage="_HeuristicLabUser", ThisKey="HeuristicLabUserID", OtherKey="ID", IsForeignKey=true)]
635    public HeuristicLabUser HeuristicLabUser
636    {
637      get
638      {
639        return this._HeuristicLabUser.Entity;
640      }
641      set
642      {
643        HeuristicLabUser previousValue = this._HeuristicLabUser.Entity;
644        if (((previousValue != value)
645              || (this._HeuristicLabUser.HasLoadedOrAssignedValue == false)))
646        {
647          this.SendPropertyChanging();
648          if ((previousValue != null))
649          {
650            this._HeuristicLabUser.Entity = null;
651            previousValue.HeuristicLabUserRole.Remove(this);
652          }
653          this._HeuristicLabUser.Entity = value;
654          if ((value != null))
655          {
656            value.HeuristicLabUserRole.Add(this);
657            this._HeuristicLabUserID = value.ID;
658          }
659          else
660          {
661            this._HeuristicLabUserID = default(long);
662          }
663          this.SendPropertyChanged("HeuristicLabUser");
664        }
665      }
666    }
667   
668    [Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabAbstractRole", ThisKey="HeuristicLabRoleID", OtherKey="ID", IsForeignKey=true)]
669    public HeuristicLabAbstractRole HeuristicLabAbstractRole
670    {
671      get
672      {
673        return this._HeuristicLabAbstractRole.Entity;
674      }
675      set
676      {
677        HeuristicLabAbstractRole previousValue = this._HeuristicLabAbstractRole.Entity;
678        if (((previousValue != value)
679              || (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue == false)))
680        {
681          this.SendPropertyChanging();
682          if ((previousValue != null))
683          {
684            this._HeuristicLabAbstractRole.Entity = null;
685            previousValue.HeuristicLabUserRole.Remove(this);
686          }
687          this._HeuristicLabAbstractRole.Entity = value;
688          if ((value != null))
689          {
690            value.HeuristicLabUserRole.Add(this);
691            this._HeuristicLabRoleID = value.ID;
692          }
693          else
694          {
695            this._HeuristicLabRoleID = default(long);
696          }
697          this.SendPropertyChanged("HeuristicLabAbstractRole");
698        }
699      }
700    }
701   
702    public event PropertyChangingEventHandler PropertyChanging;
703   
704    public event PropertyChangedEventHandler PropertyChanged;
705   
706    protected virtual void SendPropertyChanging()
707    {
708      if ((this.PropertyChanging != null))
709      {
710        this.PropertyChanging(this, emptyChangingEventArgs);
711      }
712    }
713   
714    protected virtual void SendPropertyChanged(String propertyName)
715    {
716      if ((this.PropertyChanged != null))
717      {
718        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
719      }
720    }
721  }
722}
723#pragma warning restore 1591
Note: See TracBrowser for help on using the repository browser.