Exemplo n.º 1
0
 public static AppSystemState Create(IAcDomain acDomain, AppSystemBase appSystem)
 {
     if (acDomain == null)
     {
         throw new ArgumentNullException("acDomain");
     }
     if (appSystem == null)
     {
         throw new ArgumentNullException("appSystem");
     }
     return(new AppSystemState(appSystem.Id)
     {
         _acDomain = acDomain,
         _createOn = appSystem.CreateOn
     }.InternalModify(appSystem));
 }
Exemplo n.º 2
0
        internal AppSystemState InternalModify(AppSystemBase appSystem)
        {
            if (appSystem == null)
            {
                throw new ArgumentNullException("appSystem");
            }
            AccountState principal;

            if (!_acDomain.SysUserSet.TryGetDevAccount(appSystem.PrincipalId, out principal))
            {
                throw new AnycmdException("意外的应用系统负责人标识" + appSystem.PrincipalId);
            }
            _code           = appSystem.Code;
            _name           = appSystem.Name;
            _sortCode       = appSystem.SortCode;
            _principalId    = appSystem.PrincipalId;
            _isEnabled      = appSystem.IsEnabled;
            _ssoAuthAddress = appSystem.SsoAuthAddress;
            _icon           = appSystem.Icon;

            return(this);
        }