Esempio n. 1
0
        protected void TestInitializeBase()
        {
            var config = new ConfigurationBuilder().AddJsonFile("appconfig.json").Build();// ECB API URL HERE

            userRepository  = new UserRepository();
            userService     = new UserService(userRepository);
            currencyService = new CurrencyService(config);
            accountService  = new AccountService(userService, currencyService);


            defaultThreeAccountCurrencies = new List <Currency> {
                Currency.RUB, Currency.USD, Currency.EUR
            };
            defaultOneAccountCurrency = new List <Currency> {
                Currency.IDR
            };

            uniqueUsers = UsersInit.GetAllUsers();
            dupeUsers   = UsersInit.GetAllUsersWithDuplicate();

            uniqueAccounts = AccountInit.GetAllAccounts();
            dupeAccounts   = AccountInit.GetAllAccountsWithDuplicate();

            uniqueAccountInfoColl = AccountInfoInit.GetAccountInfoList();
            dupeAccountInfoColl   = AccountInfoInit.GetAccountInfosWithDuplicate();

            uniqueMoneyColl    = MoneyListInit.GetMoneyList1();
            dupeMoneyColl      = MoneyListInit.GetMoneyListWithDuplicates();
            basicTestMoneyList = MoneyListInit.GetOperatorTestMoney();

            uniqueVOCollections = ValueObjectCollectionInit.GetValueObjectCollectionList();
            dupeVOCollections   = ValueObjectCollectionInit.GetValueObjectCollectionListWithDuplicates();
        }
Esempio n. 2
0
 private void OnUsersInit(List <User> usersList)
 {
     if (UsersInit == null)
     {
         return;
     }
     UsersInit.Invoke(usersList);
 }
Esempio n. 3
0
        internal static void Start()
        {
            AppRuntime.AppType     = ((Environment.CurrentDirectory == AppDomain.CurrentDomain.BaseDirectory) ? "WIN" : "WEB");
            AppRuntime.AppSiteName = HostingEnvironment.SiteName;
            AppRuntime.AppRootPath = HostingEnvironment.ApplicationPhysicalPath;
            string applicationVirtualPath = HostingEnvironment.ApplicationVirtualPath;

            AppRuntime.AppVirtualPath = ((applicationVirtualPath != "/") ? (applicationVirtualPath + "/") : applicationVirtualPath);
            AppRuntime.AppBit         = ((IntPtr.Size != 4) ? ((IntPtr.Size != 8) ? AppBitType.None : AppBitType.Bit64) : AppBitType.Bit32);
            AppRuntime.MachineName    = Environment.MachineName;
            Environment.SetEnvironmentVariable("NLS_LANG", "SIMPLIFIED CHINESE_CHINA.ZHS16GBK");
            Environment.SetEnvironmentVariable("NLS_DATE_FORMAT", "YYYY-MM-DD HH24:MI:SS");
            Environment.SetEnvironmentVariable("NLS_TIMESTAMP_FORMAT", "YYYY-MM-DD HH24:MI:SS");
            string str  = AppConfig.TNS_ADMIN;
            bool   flag = !string.IsNullOrEmpty(str);

            if (flag)
            {
                Environment.SetEnvironmentVariable("TNS_ADMIN", str);
            }
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(AppRuntime.CurrentDomain_AssemblyResolve);
            AppRuntime._DbQueryDateTime              = AppUtils.GetDbServerDateTime();
            AppRuntime.ServerDateTime = AppRuntime._DbQueryDateTime;
            try
            {
                ComponentInit.Init();
                UsersInit.Init();
                TIM.T_KERNEL.SystemInit.SystemInit.Init();
                PermissionOpInit.Init();
                CacheEvent.UpdateUCache();
            }
            catch (Exception ex)
            {
                AppEventLog.Error("AppRuntime 异常" + ex.Message);
            }
            TimerManager.Initialize();
            TimerManager.Instance.AddTask(TimerCategory.SessionTask, "AUTHSESSION", typeof(AuthSessionUpdateTask), string.Empty, string.Empty);
            TimerManager.Instance.AddTask(TimerCategory.SessionTask, "MEMORYSESSION", typeof(UCacheUpdateTask), string.Empty, string.Empty);
            TimerManager.Instance.AddTask(TimerCategory.TableCacheTask, "TABLECACHE", typeof(UCacheUpdateTask), string.Empty, string.Empty);
            TimerManager.Instance.AddTask(TimerCategory.TimeModuleTask, "TIMEMODULE", typeof(JobScheduleTask), AppConfig.DefaultDbId, "ADMIN");
        }
Esempio n. 4
0
 public UserRepository()
 {
     _users = UsersInit.GetAllUsers();
 }