- Timestamp:
- 06/24/10 00:23:16 (14 years ago)
- Location:
- branches/HeuristicLab.Services.Authentication Prototype/Persistence
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml
r3942 r3943 4 4 <Type Name="HeuristicLabUser"> 5 5 <Column Name="id" Member="ID" Storage="_id" Type="System.Int64" IsReadOnly="true" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 6 <Column Name="UserName" Modifier=" Override" Type="System.String" IsReadOnly="true" CanBeNull="false" />6 <Column Name="UserName" Modifier="Virtual" Type="System.String" IsReadOnly="true" CanBeNull="false" /> 7 7 <Column Name="Password" Type="System.String" CanBeNull="false" /> 8 <Column Name="LastPasswordChangedDate" Modifier=" Override" Type="System.DateTime" IsReadOnly="true" CanBeNull="false" />9 <Column Name="PasswordQuestion" Modifier=" Override" Type="System.String" IsReadOnly="true" CanBeNull="false" />8 <Column Name="LastPasswordChangedDate" Modifier="Virtual" Type="System.DateTime" IsReadOnly="true" CanBeNull="false" /> 9 <Column Name="PasswordQuestion" Modifier="Virtual" Type="System.String" IsReadOnly="true" CanBeNull="false" /> 10 10 <Column Name="PasswordAnswer" Type="System.String" CanBeNull="false" /> 11 <Column Name="Email" Modifier=" Override" Type="System.String" CanBeNull="false" />12 <Column Name="Comment" Modifier=" Override" Type="System.String" CanBeNull="false" />11 <Column Name="Email" Modifier="Virtual" Type="System.String" CanBeNull="false" /> 12 <Column Name="Comment" Modifier="Virtual" Type="System.String" CanBeNull="false" /> 13 13 <Association Name="HeuristicLabUser_HeuristicLabUserRole" Member="HeuristicLabUserRole" ThisKey="ID" OtherKey="HeuristicLabUserID" Type="HeuristicLabUserRole" /> 14 14 </Type> 15 15 </Table> 16 16 <Table Name="" Member="HeuristicLabAbstractRoles"> 17 <Type Name="HeuristicLabAbstractRole" IsInheritanceDefault="true"Modifier="Abstract">17 <Type Name="HeuristicLabAbstractRole" Modifier="Abstract"> 18 18 <Column Name="ID" Type="System.Int64" IsReadOnly="true" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 19 19 <Column Name="roleName" Member="RoleName" Storage="_roleName" Type="System.String" CanBeNull="false" /> 20 20 <Column Name="parentRoleID" Member="ParentRoleID" Storage="_parentRoleID" Type="System.Int64" CanBeNull="false" /> 21 <Column Member="RoleType" Type="System.String" IsReadOnly="true" CanBeNull="false" UpdateCheck="Always" IsDiscriminator="true" /> 21 <Column Name="RoleType" Type="System.String" IsReadOnly="true" CanBeNull="false" IsDiscriminator="true" /> 22 <Association Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole" Member="HeuristicLabAbstractRole2" ThisKey="ID" OtherKey="ParentRoleID" Type="HeuristicLabAbstractRole" /> 22 23 <Association Name="HeuristicLabAbstractRole_HeuristicLabUserRole" Member="HeuristicLabUserRole" ThisKey="ID" OtherKey="HeuristicLabRoleID" Type="HeuristicLabUserRole" /> 23 <Association Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole" Member="HeuristicLabAbstractRole2" ThisKey="ID" OtherKey="ParentRoleID" Type="HeuristicLabAbstractRole" />24 24 <Association Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole" Member="HeuristicLabAbstractRole1" ThisKey="ParentRoleID" OtherKey="ID" Type="HeuristicLabAbstractRole" IsForeignKey="true" /> 25 25 <Type Name="HeuristicLabPermissionRole" InheritanceCode="permission" /> 26 <Type Name="HeuristicLabRole" InheritanceCode="role" />26 <Type Name="HeuristicLabRole" InheritanceCode="role" IsInheritanceDefault="true" /> 27 27 </Type> 28 28 </Table> 29 29 <Table Name="" Member="HeuristicLabUserRole"> 30 30 <Type Name="HeuristicLabUserRole"> 31 <Column Member="ID" Type="System.Int64" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />32 <Column Member="HeuristicLabUserID" Type="System.Int64" CanBeNull="false" />33 <Column Member="HeuristicLabRoleID" Type="System.Int64" CanBeNull="false" />31 <Column Name="ID" Type="System.Int64" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" /> 32 <Column Name="HeuristicLabUserID" Type="System.Int64" CanBeNull="false" /> 33 <Column Name="HeuristicLabRoleID" Type="System.Int64" CanBeNull="false" /> 34 34 <Association Name="HeuristicLabUser_HeuristicLabUserRole" Member="HeuristicLabUser" ThisKey="HeuristicLabUserID" OtherKey="ID" Type="HeuristicLabUser" IsForeignKey="true" /> 35 35 <Association Name="HeuristicLabAbstractRole_HeuristicLabUserRole" Member="HeuristicLabAbstractRole" ThisKey="HeuristicLabRoleID" OtherKey="ID" Type="HeuristicLabAbstractRole" IsForeignKey="true" /> -
branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout
r3942 r3943 27 27 </nestedChildShapes> 28 28 </classShape> 29 <inheritanceConnector edgePoints="[(5.5 : 2.22679768880208); (6.875 : 2.22679768880208)]" fixedFrom=" Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">29 <inheritanceConnector edgePoints="[(5.5 : 2.22679768880208); (6.875 : 2.22679768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62"> 30 30 <nodes> 31 31 <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" /> … … 33 33 </nodes> 34 34 </inheritanceConnector> 35 <inheritanceConnector edgePoints="[(5.5 : 1.21719482421875); (6.875 : 1.21719482421875)]" fixedFrom=" Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">35 <inheritanceConnector edgePoints="[(5.5 : 1.21719482421875); (6.875 : 1.21719482421875)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62"> 36 36 <nodes> 37 37 <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" /> … … 45 45 </nestedChildShapes> 46 46 </classShape> 47 <associationConnector edgePoints="[(1.5625 : 2.97280110677083); (1.5625 : 3.625)]" fixedFrom=" Algorithm" fixedTo="Algorithm">47 <associationConnector edgePoints="[(1.5625 : 2.97280110677083); (1.5625 : 3.625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 48 48 <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabUser/HeuristicLabUser_HeuristicLabUserRole" /> 49 49 <nodes> … … 52 52 </nodes> 53 53 </associationConnector> 54 <associationConnector edgePoints="[(3.9687475 : 2.45359537760417); (3.9687475 : 4.35564697265625); (2.625 : 4.35564697265625)]" fixedFrom=" Algorithm" fixedTo="Algorithm">54 <associationConnector edgePoints="[(3.9687475 : 2.45359537760417); (3.9687475 : 4.35564697265625); (2.625 : 4.35564697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 55 55 <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabAbstractRole/HeuristicLabAbstractRole_HeuristicLabUserRole" /> 56 56 <nodes> -
branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs
r3942 r3943 2 2 //------------------------------------------------------------------------------ 3 3 // <auto-generated> 4 // Dieser Code wurde von einem Tool generiert.5 // Laufzeitversion:2.0.50727.49274 // This code was generated by a tool. 5 // Runtime Version:2.0.50727.4927 6 6 // 7 // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn8 // der Code erneut generiert wird.7 // Changes to this file may cause incorrect behavior and will be lost if 8 // the code is regenerated. 9 9 // </auto-generated> 10 10 //------------------------------------------------------------------------------ … … 144 144 145 145 [Column(Storage="_UserName", CanBeNull=false, UpdateCheck=UpdateCheck.Never)] 146 public overridestring UserName146 public virtual string UserName 147 147 { 148 148 get … … 173 173 174 174 [Column(Storage="_LastPasswordChangedDate", UpdateCheck=UpdateCheck.Never)] 175 public overrideSystem.DateTime LastPasswordChangedDate175 public virtual System.DateTime LastPasswordChangedDate 176 176 { 177 177 get … … 182 182 183 183 [Column(Storage="_PasswordQuestion", CanBeNull=false, UpdateCheck=UpdateCheck.Never)] 184 public overridestring PasswordQuestion184 public virtual string PasswordQuestion 185 185 { 186 186 get … … 211 211 212 212 [Column(Storage="_Email", CanBeNull=false)] 213 public overridestring Email213 public virtual string Email 214 214 { 215 215 get … … 231 231 232 232 [Column(Storage="_Comment", CanBeNull=false)] 233 public overridestring Comment233 public virtual string Comment 234 234 { 235 235 get … … 298 298 [Table(Name="")] 299 299 [InheritanceMapping(Code="permission", Type=typeof(HeuristicLabPermissionRole))] 300 [InheritanceMapping(Code="role", Type=typeof(HeuristicLabRole) )]300 [InheritanceMapping(Code="role", Type=typeof(HeuristicLabRole), IsDefault=true)] 301 301 public abstract partial class HeuristicLabAbstractRole : INotifyPropertyChanging, INotifyPropertyChanged 302 302 { … … 312 312 private string _RoleType = default(string); 313 313 314 private EntitySet<HeuristicLabAbstractRole> _HeuristicLabAbstractRole2; 315 314 316 private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole; 315 316 private EntitySet<HeuristicLabAbstractRole> _HeuristicLabAbstractRole2;317 317 318 318 private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole1; … … 330 330 public HeuristicLabAbstractRole() 331 331 { 332 this._HeuristicLabAbstractRole2 = new EntitySet<HeuristicLabAbstractRole>(new Action<HeuristicLabAbstractRole>(this.attach_HeuristicLabAbstractRole2), new Action<HeuristicLabAbstractRole>(this.detach_HeuristicLabAbstractRole2)); 332 333 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 334 this._HeuristicLabAbstractRole1 = default(EntityRef<HeuristicLabAbstractRole>); 335 335 OnCreated(); … … 394 394 } 395 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 396 409 [Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")] 397 410 public EntitySet<HeuristicLabUserRole> HeuristicLabUserRole … … 404 417 { 405 418 this._HeuristicLabUserRole.Assign(value); 406 }407 }408 409 [Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole2", ThisKey="ID", OtherKey="ParentRoleID")]410 public EntitySet<HeuristicLabAbstractRole> HeuristicLabAbstractRole2411 {412 get413 {414 return this._HeuristicLabAbstractRole2;415 }416 set417 {418 this._HeuristicLabAbstractRole2.Assign(value);419 419 } 420 420 } … … 474 474 } 475 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 476 488 private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity) 477 489 { … … 484 496 this.SendPropertyChanging(); 485 497 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 498 } 499 499 } -
branches/HeuristicLab.Services.Authentication Prototype/Persistence/DatabaseUtil.cs
r3940 r3943 1 namespace Persistence { 1 using System; 2 3 namespace Persistence { 2 4 /// <summary> 3 /// 5 /// combines multiple used static methods into one class 4 6 /// </summary> 5 7 public class DatabaseUtil { 6 8 /// <summary> 7 /// 9 /// creates and returns a database connection, if possible 8 10 /// </summary> 9 /// <returns> </returns>11 /// <returns>database connection (could be null)</returns> 10 12 public static DataClassesDataContext createDataClassesDataContext() { 11 return new Persistence.DataClassesDataContext(@"C:\TEMP\HeuristicLabTemp.mdf"); 13 DataClassesDataContext db; 14 try { 15 db = new Persistence.DataClassesDataContext(@"C:\TEMP\HeuristicLabTemp.mdf"); 16 } 17 catch (Exception) { 18 return null; 19 } 20 return db; 21 } 22 23 /// <summary> 24 /// creates a new database out of the LINQ to SQL classes 25 /// </summary> 26 /// <param name="db">DataClassesDataContext</param> 27 public static void createDatabase(DataClassesDataContext db) { 28 if (db == null) { 29 throw new ArgumentNullException("db"); 30 } 31 32 if (db.DatabaseExists()) { 33 Console.WriteLine("Deleting old database..."); 34 db.DeleteDatabase(); 35 Console.WriteLine("Deleted old database!"); 36 } 37 38 Console.WriteLine("Creating new database..."); 39 db.CreateDatabase(); 40 Console.WriteLine("Created new database!"); 12 41 } 13 42 } -
branches/HeuristicLab.Services.Authentication Prototype/Persistence/HeuristicLabUser.cs
r3941 r3943 3 3 4 4 namespace Persistence { 5 /// <summary> 6 /// implements the MembershipUser for HeuristicLab 7 /// </summary> 5 8 partial class HeuristicLabUser : MembershipUser { 9 public HeuristicLabUser(string name, string email, string passwordQuestion, string comment) : this() { 10 _UserName = name; 11 Password = "INIT"; // just for tests 12 _LastPasswordChangedDate = System.DateTime.Today; 13 _PasswordQuestion = passwordQuestion; 14 PasswordAnswer = ""; 15 Email = email; 16 Comment = comment; 17 } 18 6 19 public override bool ChangePassword(string oldPassword, string newPassword) { 7 20 if (oldPassword == null) {
Note: See TracChangeset
for help on using the changeset viewer.