Пример #1
0
        static void Main(string[] args)
        {
            XmlConfigurator.Configure(new System.IO.FileInfo(args[0]));
            IDictionary <String, string> props = new SortedList <String, String>();

            props.Add("ConnectionString", GetConnectionStringByName("labDB"));
            IRepoContestant    repoContestant     = new RepoDbContestant(props);
            IRepoRace          repoRace           = new RepoDbRace(props);
            IOfficePers        officePersRepo     = new RepoDbOfficePers(props);
            RepoDbRegistration repoDbRegistration = new RepoDbRegistration(props);
            IServer            serverImpl         = new ServerImpl(repoContestant, repoRace, officePersRepo, repoDbRegistration);
            SerialServer       server             = new SerialServer("127.0.0.1", 55555, serverImpl);

            server.Start();
            Console.WriteLine("Server started...");
            Console.ReadLine();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("hi");

            ArtistRepository   artistRepository   = new ArtistRepository();
            EmployeeRepository employeeRepository = new EmployeeRepository();
            BuyerRepository    buyerRepository    = new BuyerRepository();
            ShowRepository     showRepository     = new ShowRepository();
            TicketRepository   ticketRepository   = new TicketRepository();
            IServices          serviceImpl        = new ServerImpl(employeeRepository, showRepository, artistRepository, buyerRepository, ticketRepository);
            AbstractServer     server             = new SerialServer("127.0.0.1", 55555, serviceImpl);

            server.Start();
            Console.WriteLine("Server started ...");
            //Console.WriteLine("Press <enter> to exit...");
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            VolunteerRepository volunteerRepository = new VolunteerRepository();
            VolunteerService    volunteerService    = new VolunteerService(volunteerRepository);

            DonorRepository    donorRepository    = new DonorRepository();
            DonationRepository donationRepository = new DonationRepository();
            CaseRepository     caseRepository     = new CaseRepository();
            DonationService    donationService    = new DonationService(caseRepository, donorRepository, donationRepository);

            // Volunteer volunteer = volunteerRepository.FindOne("admin", "admin");
            // Console.WriteLine("voluntar: "+volunteer.Username);

            ServerService serverService = new ServerService(volunteerService, donationService);
            SerialServer  server        = new SerialServer("127.0.0.1", 55555, serverService);

            server.Start();
            Console.WriteLine("Server started... ");
            //Console.WriteLine("Press <enter> to exit...");
            Console.ReadLine();
        }