Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4588


Ignore:
Timestamp:
10/09/10 19:11:54 (14 years ago)
Author:
jwolfing
Message:

#1196 added several Classes to DataAccess and DataTranfer

Location:
branches/UserManagement
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml

    r4584 r4588  
    141141    </Type>
    142142  </Table>
     143  <Function Name="dbo.aspnet_Users_DeleteUser" Method="aspnet_Users_DeleteUser">
     144    <Parameter Name="ApplicationName" Parameter="applicationName" Type="System.String" DbType="NVarChar(256)" />
     145    <Parameter Name="UserName" Parameter="userName" Type="System.String" DbType="NVarChar(256)" />
     146    <Parameter Name="TablesToDeleteFrom" Parameter="tablesToDeleteFrom" Type="System.Int32" DbType="Int" />
     147    <Parameter Name="NumTablesDeletedFrom" Parameter="numTablesDeletedFrom" Type="System.Int32" DbType="Int" Direction="InOut" />
     148    <Return Type="System.Int32" />
     149  </Function>
    143150</Database>
  • branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.dbml.layout

    r4584 r4588  
    1515      </nestedChildShapes>
    1616    </classShape>
    17     <associationConnector edgePoints="[(2.5 : 1.60179768880208); (2.66666666666667 : 1.60179768880208 : JumpStart); (2.92708083333333 : 1.60179768880208 : JumpEnd); (3.625 : 1.60179768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     17    <associationConnector edgePoints="[(2.5 : 1.60179768880208); (2.66666666666667 : 1.60179768880208 : JumpStart); (2.83333333333333 : 1.60179768880208 : JumpEnd); (3.625 : 1.60179768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    1818      <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_Membership" />
    1919      <nodes>
     
    2828      </nestedChildShapes>
    2929    </classShape>
    30     <associationConnector edgePoints="[(2.5 : 1.03125); (2.66666666666667 : 1.03125 : JumpStart); (2.83333333333333 : 1.03125 : JumpEnd); (5.79166666666667 : 1.03125 : JumpStart); (5.95833333333333 : 1.03125 : JumpEnd); (7.375 : 1.03125)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     30    <associationConnector edgePoints="[(2.5 : 1.03125); (2.66666666666667 : 1.03125 : JumpStart); (2.83333333333333 : 1.03125 : JumpEnd); (5.79166666666667 : 1.03125 : JumpStart); (5.95833333333333 : 1.03125 : JumpEnd); (7.375 : 1.03125)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    3131      <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_Path" />
    3232      <nodes>
     
    4141      </nestedChildShapes>
    4242    </classShape>
    43     <associationConnector edgePoints="[(7.375 : 1.83617468880208); (5.875 : 1.83617468880208); (5.875 : 0.625); (2.75 : 0.625); (2.75 : 2.32859537760417); (1.5 : 2.32859537760417); (1.5 : 2.75)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     43    <associationConnector edgePoints="[(7.375 : 1.83617468880208); (5.875 : 1.83617468880208); (5.875 : 0.625); (2.75 : 0.625); (2.75 : 2.32859537760417); (1.5 : 2.32859537760417); (1.5 : 2.75)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    4444      <AssociationMoniker Name="/UserManagementDataContext/aspnet_Path/aspnet_Path_aspnet_PersonalizationAllUser" />
    4545      <nodes>
     
    5454      </nestedChildShapes>
    5555    </classShape>
    56     <associationConnector edgePoints="[(8.9375 : 2.57859537760417); (8.9375 : 3.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     56    <associationConnector edgePoints="[(8.9375 : 2.57859537760417); (8.9375 : 3.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    5757      <AssociationMoniker Name="/UserManagementDataContext/aspnet_Path/aspnet_Path_aspnet_PersonalizationPerUser" />
    5858      <nodes>
     
    7373      </nestedChildShapes>
    7474    </classShape>
    75     <associationConnector edgePoints="[(2.5 : 0.78125); (2.66666666666667 : 0.781249999999999 : JumpStart); (2.83333333333333 : 0.78125 : JumpEnd); (5.79166666666667 : 0.781249999999999 : JumpStart); (5.95833333333333 : 0.78125 : JumpEnd); (9.90625 : 0.78125); (9.90625 : 6.375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     75    <associationConnector edgePoints="[(2.5 : 0.78125); (9.90625 : 0.78125); (9.90625 : 6.375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    7676      <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_Role" />
    7777      <nodes>
     
    8686      </nestedChildShapes>
    8787    </classShape>
    88     <classShape Id="6bceff2f-2d6b-4f24-b50d-2296ff7f62c3" absoluteBounds="1.25, 7.375, 2, 2.1554996744791666">
     88    <classShape Id="6bceff2f-2d6b-4f24-b50d-2296ff7f62c3" absoluteBounds="0.75, 8.25, 2, 2.1554996744791666">
    8989      <DataClassMoniker Name="/UserManagementDataContext/aspnet_User" />
    9090      <nestedChildShapes>
    91         <elementListCompartment Id="bf2f1444-f051-4d39-9055-c21643a53875" absoluteBounds="1.2650000000000001, 7.835, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     91        <elementListCompartment Id="bf2f1444-f051-4d39-9055-c21643a53875" absoluteBounds="0.76500000000000012, 8.71, 1.9700000000000002, 1.5954996744791665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    9292      </nestedChildShapes>
    9393    </classShape>
    94     <associationConnector edgePoints="[(3 : 7.375); (3 : 4.56814697265625); (3.625 : 4.56814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     94    <associationConnector edgePoints="[(2.65625 : 8.25); (2.65625 : 4.56814697265625); (3.04166666666667 : 4.56814697265625 : JumpStart); (3.20833333333333 : 4.56814697265625 : JumpEnd); (3.625 : 4.56814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    9595      <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_Membership" />
    9696      <nodes>
     
    9999      </nodes>
    100100    </associationConnector>
    101     <associationConnector edgePoints="[(3.25 : 8.8694482421875); (3.54166666666667 : 8.8694482421875 : JumpStart); (3.70833333333333 : 8.8694482421875 : JumpEnd); (7.84375 : 8.8694482421875); (7.84375 : 5.64589680989583)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     101    <associationConnector edgePoints="[(2.75 : 9.32774983723958); (3.54166666666667 : 9.32774983723958 : JumpStart); (3.70833333333333 : 9.32774983723958 : JumpEnd); (7.84375 : 9.32774983723958); (7.84375 : 5.64589680989583)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    102102      <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_PersonalizationPerUser" />
    103103      <nodes>
     
    106106      </nodes>
    107107    </associationConnector>
    108     <associationConnector edgePoints="[(1.875 : 7.375); (1.875 : 6.77089680989583)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     108    <associationConnector edgePoints="[(1.625 : 8.25); (1.625 : 6.77089680989583)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    109109      <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_Profile" />
    110110      <nodes>
     
    113113      </nodes>
    114114    </associationConnector>
    115     <associationConnector edgePoints="[(2.5 : 1.31652384440104); (2.66666666666667 : 1.31652384440104 : JumpStart); (2.83333333333333 : 1.31652384440104 : JumpEnd); (2.8437475 : 1.31652384440104); (2.8437475 : 7.375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     115    <associationConnector edgePoints="[(2.5 : 2.07859537760417); (3.125 : 2.70359537760417); (3.125 : 7.875); (2.75 : 8.25153746153846)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    116116      <AssociationMoniker Name="/UserManagementDataContext/aspnet_Application/aspnet_Application_aspnet_User" />
    117117      <nodes>
     
    133133      </nodes>
    134134    </associationConnector>
    135     <associationConnector edgePoints="[(2.25 : 9.53049967447917); (2.25 : 12.375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     135    <associationConnector edgePoints="[(2 : 10.4054996744792); (2 : 12.375)]" fixedFrom="Algorithm" fixedTo="Algorithm">
    136136      <AssociationMoniker Name="/UserManagementDataContext/aspnet_User/aspnet_User_aspnet_UsersInRole" />
    137137      <nodes>
  • branches/UserManagement/HeuristicLab.Services.Authentication.DataAccess/UserManagement.designer.cs

    r4584 r4588  
    182182        return this.GetTable<aspnet_WebEvent_Event>();
    183183      }
     184    }
     185   
     186    [global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.aspnet_Users_DeleteUser")]
     187    public int aspnet_Users_DeleteUser([global::System.Data.Linq.Mapping.ParameterAttribute(Name="ApplicationName", DbType="NVarChar(256)")] string applicationName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UserName", DbType="NVarChar(256)")] string userName, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="TablesToDeleteFrom", DbType="Int")] System.Nullable<int> tablesToDeleteFrom, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="NumTablesDeletedFrom", DbType="Int")] ref System.Nullable<int> numTablesDeletedFrom)
     188    {
     189      IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), applicationName, userName, tablesToDeleteFrom, numTablesDeletedFrom);
     190      numTablesDeletedFrom = ((System.Nullable<int>)(result.GetParameterValue(3)));
     191      return ((int)(result.ReturnValue));
    184192    }
    185193  }
  • branches/UserManagement/HeuristicLab.Services.Authentication.TestClient/TestClient.cs

    r4584 r4588  
    2323                    Console.WriteLine("Item=" + item.UserName);
    2424                }
    25              
     25
     26                Console.WriteLine("Try to delete user...");
     27
     28                User u = new User() { UserId = new Guid("e4abc6ae-c954-4efd-8108-e536226fd9c7") };
     29                auth.DeleteUser(u);
    2630
    2731            }
  • branches/UserManagement/HeuristicLab.Services.Authentication/AuthenticationService.cs

    r4584 r4588  
    1313    public class AuthenticationService : IAuthenticationService
    1414    {
     15        #region User
    1516        public DataTransfer.User GetUser(Guid UserId)
    1617        {
     
    4748            return UserList;
    4849        }
     50
     51        public void InsertUser(User user)
     52        {
     53            // insert user
     54            if (user != null)
     55            {
     56
     57               
     58
     59                using (UserManagementDataContext db = new UserManagementDataContext())
     60                {
     61                    aspnet_User userDa = Convert.ToEntity(user);
     62                    db.aspnet_Users.InsertOnSubmit(userDa);
     63                    db.SubmitChanges();
     64                }
     65
     66            }
     67        }
     68
     69        public void DeleteUser(User user)
     70        {
     71            if (user != null)
     72            {
     73
     74
     75
     76                using (UserManagementDataContext db = new UserManagementDataContext())
     77                {
     78
     79                    // membership
     80                    // profile
     81                    // users per role
     82                    // personalization per role
     83
     84                    ////////////////
     85
     86                    // servie mit id aufrufen, id mit datacontext holen und dann löschen ...
     87                   
     88                    db.SubmitChanges();
     89                }
     90
     91            }
     92        }
     93
     94        #endregion
    4995    }
    5096}
  • branches/UserManagement/HeuristicLab.Services.Authentication/Convert.cs

    r4584 r4588  
    1313        #region User
    1414
     15        /// <summary>
     16        /// converts data transfer object to data access objet
     17        /// </summary>
     18        /// <param name="source">data transfer object</param>
     19        /// <returns>data access object</returns>
    1520        public static aspnet_User ToEntity(User source)
    1621        {
    1722            if (source == null) return null;
    18             return new aspnet_User() { UserName = source.UserName };
     23            return new aspnet_User()
     24            {
     25                UserId = source.UserId,
     26                UserName = source.UserName,
     27                LastActivityDate = source.LastActivityDate,
     28                ApplicationId = source.ApplicationId,
     29            };
    1930        }
    2031
     32        /// <summary>
     33        /// converts data access object to data transfer object
     34        /// </summary>
     35        /// <param name="source">data access object</param>
     36        /// <returns>data transfer object</returns>
    2137        public static User ToDataTransfer(aspnet_User source)
    2238        {
    2339            if (source == null) return null;
    24             return new User() { UserName=source.UserName };
     40            return new User()
     41            {
     42                UserName = source.UserName
     43            };
    2544        }
     45
     46        /// <summary>
     47        /// converts data transfer object to data access object
     48        /// </summary>
     49        /// <param name="source">data transfer object</param>
     50        /// <param name="target">data access object</param>
     51        public static void ToEntity(User source, aspnet_User target)
     52        {
     53            if ((source != null) && (target != null))
     54            {
     55                target.UserName = source.UserName;
     56            }
     57
     58        }
     59
    2660
    2761        #endregion
    2862
    29         //#region Platform
    30         //public static DT.Platform ToDto(DA.Platform source)
    31         //{
    32         //    if (source == null) return null;
    33         //    return new DT.Platform { Id = source.Id, Name = source.Name, Description = source.Description };
    34         //}
    35         //public static DA.Platform ToEntity(DT.Platform source)
    36         //{
    37         //    if (source == null) return null;
    38         //    return new DA.Platform { Id = source.Id, Name = source.Name, Description = source.Description };
    39         //}
    40         //public static void ToEntity(DT.Platform source, DA.Platform target)
    41         //{
    42         //    if ((source != null) && (target != null))
    43         //        target.Id = source.Id; target.Name = source.Name; target.Description = source.Description;
    44         //}
    45         //#endregion
     63
     64        #region Application
     65
     66        #endregion
     67
     68        #region Membership
     69
     70        #endregion
     71
     72        #region Role
     73
     74        #endregion
     75
     76        #region User
     77
     78        #endregion
     79
    4680    }
    4781}
  • branches/UserManagement/HeuristicLab.Services.Authentication/Interfaces/IAuthenticationService.cs

    r4584 r4588  
    1212    public interface IAuthenticationService
    1313    {
     14        #region User
    1415        [OperationContract]
    1516        User GetUser(Guid id);
     17
    1618        [OperationContract]
    1719        IEnumerable<User> GetUsers();
     20
     21        [OperationContract]
     22        void InsertUser(User user);
     23        #endregion
     24
    1825    }
    1926}
Note: See TracChangeset for help on using the changeset viewer.