예제 #1
0
        static void Main(string[] args)
        {
            using (var dbContext = new StockExchangeDBContext())
            {
                XmlConfigurator.Configure();

                var container = new Container(new DIContainer());

                var loggerService = container.GetInstance <ILoggerService>();
                var businessLogic = container.GetInstance <BusinessLogic>();
                var simulator     = container.GetInstance <ISimulation>();

                Database.SetInitializer(new EFInitializer(businessLogic));

                Task.Factory.StartNew(() =>
                {
                    simulator.Run();
                });

                Console.ReadLine();
                simulator.IsContinue = false;

                Console.ReadLine();
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            using (var dbContext = new StockExchangeDBContext())
            {
                XmlConfigurator.Configure();
                var logger        = LogManager.GetLogger("StockExchangeLogger");
                var loggerService = new LoggerService(logger);

                var businessLogic = new BusinessLogic(dbContext, loggerService);
                var simulator     = new Simulation(businessLogic, loggerService);

                Database.SetInitializer(new EFInitializer(businessLogic));

                var clients = businessLogic.GetClients();
                businessLogic.ShowClients(clients.ToList());


                Console.WriteLine("\nClients in orange area:");
                businessLogic.ShowClients(businessLogic.GetClientsFromOrangeZone());

                Console.WriteLine("\nDeals are producing. Press Enter to stop producing/");
                Task.Factory.StartNew(() =>
                {
                    simulator.Run();
                });

                Console.ReadLine();
                simulator.IsContinue = false;

                Console.WriteLine("\nDeals producing stopped. Clients table is updated:");
                businessLogic.ShowClients(clients.ToList());

                Console.ReadLine();
            }
        }
예제 #3
0
 public ShareTypeTableRepository(StockExchangeDBContext dBContext)
 {
     this.dBContext = dBContext;
 }
 public BlockedMoneyTableRepository(StockExchangeDBContext dBContext)
 {
     this.dBContext = dBContext;
 }
예제 #5
0
 public ClientTableRepository(StockExchangeDBContext dBContext)
 {
     this.dBContext = dBContext;
 }
예제 #6
0
 public BalanceTableRepository(StockExchangeDBContext dBContext)
 {
     this.dBContext = dBContext;
 }
예제 #7
0
 public OperationTableRepository(StockExchangeDBContext dBContext)
 {
     this.dBContext = dBContext;
 }
 public BlockedSharesNumberTableRepository(StockExchangeDBContext dBContext)
 {
     this.dBContext = dBContext;
 }