Beispiel #1
0
        private static void AddAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
        {
            if (EmptyAcDomain.SingleInstance.Equals(acDomain))
            {
                return;
            }
            var repository = acDomain.GetRequiredService <IRepository <AcSession, Guid> >();

            repository.Add((AcSession)acSessionEntity);
            repository.Context.Commit();
        }
Beispiel #2
0
 internal AcSessionState(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
     : this(acDomain)
 {
     if (acSessionEntity == null)
     {
         throw new ArgumentNullException("acSessionEntity");
     }
     Identity   = new AnycmdIdentity(acSessionEntity.LoginName);
     _acDomain  = acDomain;
     _id        = acSessionEntity.Id;
     _accountId = acSessionEntity.AccountId;
 }
Beispiel #3
0
 internal AcSessionState(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
     : this(acDomain)
 {
     if (acSessionEntity == null)
     {
         throw new ArgumentNullException("acSessionEntity");
     }
     Identity = new AnycmdIdentity(acSessionEntity.LoginName);
     _acDomain = acDomain;
     _id = acSessionEntity.Id;
     _accountId = acSessionEntity.AccountId;
 }
 private void DoUpdateAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
 {
     if (EmptyAcDomain.SingleInstance.Equals(acDomain))
     {
         return;
     }
     using (var conn = GetAccountDb(acDomain).GetConnection())
     {
         if (conn.State != ConnectionState.Open)
         {
             conn.Open();
         }
         conn.Execute("update AcSession set IsAuthenticated=@IsAuthenticated where Id=@Id", new { acSessionEntity.IsAuthenticated, acSessionEntity.Id });
     }
 }
     private void DoAddAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
     {
         if (EmptyAcDomain.SingleInstance.Equals(acDomain))
         {
             return;
         }
         using (var conn = GetAccountDb(acDomain).GetConnection())
         {
             if (conn.State != ConnectionState.Open)
             {
                 conn.Open();
             }
             conn.Execute(
                 @"insert into AcSession(Id,AccountId,AuthenticationType,Description,IsAuthenticated,IsEnabled,LoginName) 
 values(@Id,@AccountId,@AuthenticationType,@Description,@IsAuthenticated,@IsEnabled,@LoginName)", acSessionEntity);
         }
     }
Beispiel #6
0
        private static void UpdateAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
        {
            if (EmptyAcDomain.SingleInstance.Equals(acDomain))
            {
                return;
            }
            var repository = acDomain.GetRequiredService <IRepository <AcSession, Guid> >();

            repository.Update(new AcSession(acSessionEntity.Id)
            {
                AuthenticationType = acSessionEntity.AuthenticationType,
                IsAuthenticated    = acSessionEntity.IsAuthenticated,
                LoginName          = acSessionEntity.LoginName,
                IsEnabled          = acSessionEntity.IsEnabled,
                AccountId          = acSessionEntity.AccountId,
                Description        = acSessionEntity.Description
            });
            repository.Context.Commit();
        }
Beispiel #7
0
 private static void UpdateAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
 {
     if (EmptyAcDomain.SingleInstance.Equals(acDomain))
     {
         return;
     }
     var repository = acDomain.GetRequiredService<IRepository<AcSession>>();
     repository.Update(new AcSession()
     {
         Id = acSessionEntity.Id,
         AuthenticationType = acSessionEntity.AuthenticationType,
         IsAuthenticated = acSessionEntity.IsAuthenticated,
         LoginName = acSessionEntity.LoginName,
         IsEnabled = acSessionEntity.IsEnabled,
         AccountId = acSessionEntity.AccountId,
         Description = acSessionEntity.Description
     });
     repository.Context.Commit();
 }
Beispiel #8
0
 private static void AddAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
 {
     if (EmptyAcDomain.SingleInstance.Equals(acDomain))
     {
         return;
     }
     var repository = acDomain.GetRequiredService<IRepository<AcSession>>();
     repository.Add((AcSession)acSessionEntity);
     repository.Context.Commit();
 }
 private void DoUpdateAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
 {
     if (EmptyAcDomain.SingleInstance.Equals(acDomain))
     {
         return;
     }
     using (var conn = GetAccountDb(acDomain).GetConnection())
     {
         if (conn.State != ConnectionState.Open)
         {
             conn.Open();
         }
         conn.Execute("update AcSession set IsAuthenticated=@IsAuthenticated where Id=@Id", new { acSessionEntity.IsAuthenticated, acSessionEntity.Id });
     }
 }
 private void DoAddAcSession(IAcDomain acDomain, IAcSessionEntity acSessionEntity)
 {
     if (EmptyAcDomain.SingleInstance.Equals(acDomain))
     {
         return;
     }
     using (var conn = GetAccountDb(acDomain).GetConnection())
     {
         if (conn.State != ConnectionState.Open)
         {
             conn.Open();
         }
         conn.Execute(
     @"insert into AcSession(Id,AccountId,AuthenticationType,Description,IsAuthenticated,IsEnabled,LoginName)
     values(@Id,@AccountId,@AuthenticationType,@Description,@IsAuthenticated,@IsEnabled,@LoginName)", acSessionEntity);
     }
 }