Exemplo n.º 1
0
        /// <summary>
        /// Get user setting for each adapter. Where current user is not owner. Setting can not be changed.
        /// </summary>
        /// <param name="currentUser">Logged user.</param>
        /// <returns></returns>
        public static List <IAccountSettings> GetAllSharedUserAccounts(this UserProvider.UserDTO currentUser)
        {
            ServiceAccountDTO[]     allAcc     = services.GetAllSharedUserAccountsByUserID(currentUser.UserID);
            List <IAccountSettings> targetAccs = new List <IAccountSettings>();

            foreach (ServiceAccountDTO account in allAcc)
            {
                IAccountSettings acc = GetCurrentInstance(account);
                if (acc != null)
                {
                    acc       = acc.ConvertFromDAO(account);
                    acc.Owner = false;
                    targetAccs.Add(acc.ConvertFromDAO(account));
                }
            }
            return(targetAccs);
        }
Exemplo n.º 2
0
        public static IAccountSettings GetDetailsForAccount(this UserProvider.UserDTO currentUser, Int32 accountId, Boolean owner = true)
        {
            ServiceAccountDTO serviceAcc = services.GetUserAccountsByUserIDAndAccountId(currentUser.UserID, accountId);
            IAccountSettings  targetAcc  = GetCurrentInstance(serviceAcc);

            targetAcc       = targetAcc.ConvertFromDAO(serviceAcc);
            targetAcc.Owner = owner;
            return(targetAcc);
        }
Exemplo n.º 3
0
        public static Boolean AccountSettingsTest(IAccountSettings accountForTest, Byte[] fileInBytes)
        {
            ServiceAccountDTO account       = accountForTest.ConvertToDAO(accountForTest);
            ServiceAccountDTO resultAccount = services.TestExcelAccount(account, fileInBytes);

            IAccountSettings resultIaccount = GetCurrentInstance(resultAccount);

            resultIaccount = resultIaccount.ConvertFromDAO(resultAccount);
            return(resultAccount.TestResult);
        }
Exemplo n.º 4
0
        public static Boolean AccountSettingsTest(IAccountSettings accountForTest, out IAccountSettings settingResult)
        {
            ServiceAccountDTO account       = accountForTest.ConvertToDAO(accountForTest);
            ServiceAccountDTO resultAccount = services.TestAccount(account);

            IAccountSettings resultIaccount = GetCurrentInstance(resultAccount);

            resultIaccount = resultIaccount.ConvertFromDAO(resultAccount);
            settingResult  = resultIaccount;
            return(resultAccount.TestResult);
        }