Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/23/10 22:36:33 (14 years ago)
Author:
bfarka
Message:

added classes for role persisting and relation between user and role (#1046)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs

    r3941 r3942  
    22//------------------------------------------------------------------------------
    33// <auto-generated>
    4 //     This code was generated by a tool.
    5 //     Runtime Version:2.0.50727.4927
     4//     Dieser Code wurde von einem Tool generiert.
     5//     Laufzeitversion:2.0.50727.4927
    66//
    7 //     Changes to this file may cause incorrect behavior and will be lost if
    8 //     the code is regenerated.
     7//     Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
     8//     der Code erneut generiert wird.
    99// </auto-generated>
    1010//------------------------------------------------------------------------------
     
    3636    partial void UpdateHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
    3737    partial void DeleteHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
     38    partial void InsertHeuristicLabUserRole(HeuristicLabUserRole instance);
     39    partial void UpdateHeuristicLabUserRole(HeuristicLabUserRole instance);
     40    partial void DeleteHeuristicLabUserRole(HeuristicLabUserRole instance);
    3841    #endregion
    3942   
     
    7578      {
    7679        return this.GetTable<HeuristicLabAbstractRole>();
     80      }
     81    }
     82   
     83    public System.Data.Linq.Table<HeuristicLabUserRole> HeuristicLabUserRole
     84    {
     85      get
     86      {
     87        return this.GetTable<HeuristicLabUserRole>();
    7788      }
    7889    }
     
    100111   
    101112    private string _Comment;
     113   
     114    private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
    102115   
    103116    #region Extensibility Method Definitions
     
    117130    public HeuristicLabUser()
    118131    {
     132      this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
    119133      OnCreated();
    120134    }
     
    236250    }
    237251   
     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   
    238265    public event PropertyChangingEventHandler PropertyChanging;
    239266   
     
    254281        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    255282      }
     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;
    256295    }
    257296  }
    258297 
    259298  [Table(Name="")]
    260   [InheritanceMapping(Code="false", Type=typeof(HeuristicLabRole), IsDefault=true)]
    261   [InheritanceMapping(Code="true", Type=typeof(HeuristicLabPermissionRole))]
     299  [InheritanceMapping(Code="permission", Type=typeof(HeuristicLabPermissionRole))]
     300  [InheritanceMapping(Code="role", Type=typeof(HeuristicLabRole))]
    262301  public abstract partial class HeuristicLabAbstractRole : INotifyPropertyChanging, INotifyPropertyChanged
    263302  {
     
    271310    private long _parentRoleID;
    272311   
    273     private bool _RoleType;
     312    private string _RoleType = default(string);
     313   
     314    private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
     315   
     316    private EntitySet<HeuristicLabAbstractRole> _HeuristicLabAbstractRole2;
     317   
     318    private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole1;
    274319   
    275320    #region Extensibility Method Definitions
     
    281326    partial void OnParentRoleIDChanging(long value);
    282327    partial void OnParentRoleIDChanged();
    283     partial void OnIsPermissionChanging(bool value);
    284     partial void OnIsPermissionChanged();
    285328    #endregion
    286329   
    287330    public HeuristicLabAbstractRole()
    288331    {
     332      this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
     333      this._HeuristicLabAbstractRole2 = new EntitySet<HeuristicLabAbstractRole>(new Action<HeuristicLabAbstractRole>(this.attach_HeuristicLabAbstractRole2), new Action<HeuristicLabAbstractRole>(this.detach_HeuristicLabAbstractRole2));
     334      this._HeuristicLabAbstractRole1 = default(EntityRef<HeuristicLabAbstractRole>);
    289335      OnCreated();
    290336    }
     
    339385    }
    340386   
    341     [Column(Name="RoleType", Storage="_RoleType", IsDiscriminator=true)]
    342     public bool IsPermission
     387    [Column(Storage="_RoleType", CanBeNull=false, UpdateCheck=UpdateCheck.Never, IsDiscriminator=true)]
     388    public string RoleType
    343389    {
    344390      get
     
    346392        return this._RoleType;
    347393      }
    348       set
    349       {
    350         if ((this._RoleType != value))
    351         {
    352           this.OnIsPermissionChanging(value);
    353           this.SendPropertyChanging();
    354           this._RoleType = value;
    355           this.SendPropertyChanged("IsPermission");
    356           this.OnIsPermissionChanged();
     394    }
     395   
     396    [Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")]
     397    public EntitySet<HeuristicLabUserRole> HeuristicLabUserRole
     398    {
     399      get
     400      {
     401        return this._HeuristicLabUserRole;
     402      }
     403      set
     404      {
     405        this._HeuristicLabUserRole.Assign(value);
     406      }
     407    }
     408   
     409    [Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole2", ThisKey="ID", OtherKey="ParentRoleID")]
     410    public EntitySet<HeuristicLabAbstractRole> HeuristicLabAbstractRole2
     411    {
     412      get
     413      {
     414        return this._HeuristicLabAbstractRole2;
     415      }
     416      set
     417      {
     418        this._HeuristicLabAbstractRole2.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");
    357452        }
    358453      }
     
    377472        this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    378473      }
     474    }
     475   
     476    private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
     477    {
     478      this.SendPropertyChanging();
     479      entity.HeuristicLabAbstractRole = this;
     480    }
     481   
     482    private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
     483    {
     484      this.SendPropertyChanging();
     485      entity.HeuristicLabAbstractRole = null;
     486    }
     487   
     488    private void attach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
     489    {
     490      this.SendPropertyChanging();
     491      entity.HeuristicLabAbstractRole1 = this;
     492    }
     493   
     494    private void detach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
     495    {
     496      this.SendPropertyChanging();
     497      entity.HeuristicLabAbstractRole1 = 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();
    379513    }
    380514  }
     
    383517  {
    384518   
    385     private string _DummyField1;
    386    
    387519    #region Extensibility Method Definitions
    388520    partial void OnLoaded();
    389521    partial void OnValidate(System.Data.Linq.ChangeAction action);
    390522    partial void OnCreated();
    391     partial void OnDummyField1Changing(string value);
    392     partial void OnDummyField1Changed();
    393523    #endregion
    394524   
     
    396526    {
    397527      OnCreated();
    398     }
    399    
    400     [Column(Storage="_DummyField1", CanBeNull=false)]
    401     public string DummyField1
    402     {
    403       get
    404       {
    405         return this._DummyField1;
    406       }
    407       set
    408       {
    409         if ((this._DummyField1 != value))
    410         {
    411           this.OnDummyField1Changing(value);
    412           this.SendPropertyChanging();
    413           this._DummyField1 = value;
    414           this.SendPropertyChanged("DummyField1");
    415           this.OnDummyField1Changed();
    416         }
    417       }
    418528    }
    419529  }
    420530 
    421   public partial class HeuristicLabPermissionRole : HeuristicLabAbstractRole
     531  [Table(Name="")]
     532  public partial class HeuristicLabUserRole : INotifyPropertyChanging, INotifyPropertyChanged
    422533  {
    423534   
    424     private string _DummyField2;
     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;
    425546   
    426547    #region Extensibility Method Definitions
     
    428549    partial void OnValidate(System.Data.Linq.ChangeAction action);
    429550    partial void OnCreated();
    430     partial void OnDummyField2Changing(string value);
    431     partial void OnDummyField2Changed();
     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();
    432557    #endregion
    433558   
    434     public HeuristicLabPermissionRole()
    435     {
    436       OnCreated();
    437     }
    438    
    439     [Column(Storage="_DummyField2", CanBeNull=false)]
    440     public string DummyField2
    441     {
    442       get
    443       {
    444         return this._DummyField2;
    445       }
    446       set
    447       {
    448         if ((this._DummyField2 != value))
    449         {
    450           this.OnDummyField2Changing(value);
    451           this.SendPropertyChanging();
    452           this._DummyField2 = value;
    453           this.SendPropertyChanged("DummyField2");
    454           this.OnDummyField2Changed();
    455         }
     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));
    456719      }
    457720    }
Note: See TracChangeset for help on using the changeset viewer.