static void Main(string[] args) { ValidateEchipa validateEchipa = new ValidateEchipa(); ValidateElev validateElev = new ValidateElev(); ValidateJucator validateJucator = new ValidateJucator(); ValidateMeci validateMeci = new ValidateMeci(); ValidateJucatorActiv validateJucatorActiv = new ValidateJucatorActiv(); EchipaRepository echipaRepository = new EchipaRepository(validateEchipa, "C:\\Users\\pc\\source\\repos\\Lab9\\Lab9\\files\\echipe.txt", new InFileRepository <int, Echipa> .CreateEntityFromString(CreateEchipaFromString)); ElevRepository elevRepository = new ElevRepository(validateElev, "C:\\Users\\pc\\source\\repos\\Lab9\\Lab9\\files\\elevi.txt", new InFileRepository <int, Elev> .CreateEntityFromString(CreateElevFromString)); JucatorRepository jucatorRepository = new JucatorRepository(validateJucator, "C:\\Users\\pc\\source\\repos\\Lab9\\Lab9\\files\\jucatori.txt", new InFileRepository <int, Jucator> .CreateEntityFromString(CreateJucatorFromString)); MeciRepository meciRepository = new MeciRepository(validateMeci, "C:\\Users\\pc\\source\\repos\\Lab9\\Lab9\\files\\meciuri.txt", new InFileRepository <int, Meci> .CreateEntityFromString(CreateMeciFromString)); JucatorActivRepository jucatorActivRepository = new JucatorActivRepository(validateJucatorActiv, "C:\\Users\\pc\\source\\repos\\Lab9\\Lab9\\files\\jucatoriActivi.txt", new InFileRepository <int, JucatorActiv> .CreateEntityFromString(CreateJucatorActivFromString)); EchipaService echipaService = new EchipaService(echipaRepository); ElevService elevService = new ElevService(elevRepository); JucatorService jucatorService = new JucatorService(jucatorRepository); MeciService meciService = new MeciService(meciRepository); JucatorActivService jucatorActivService = new JucatorActivService(jucatorActivRepository); Teste.RunTests(echipaService, elevService, jucatorActivService, jucatorService, meciService); Consola consola = new Consola(echipaService, elevService, jucatorService, meciService, jucatorActivService); consola.run(); }
static void Main(string[] args) { SqliteConnectionFactory sqliteConnection = new SqliteConnectionFactory("database"); IUserRepo userRepo = new UserRepository(sqliteConnection); ICursaRepo cursaRepository = new CursaRepository(sqliteConnection); IEchipaRepo echipaRepository = new EchipaRepository(sqliteConnection); IParticipantRepo participantRepo = new ParticipantRepository(sqliteConnection); IServices serviceImpl = new ServerImpl(cursaRepository, echipaRepository, participantRepo, userRepo); // IChatServer serviceImpl = new ChatServerImpl(); SerialChatServer server = new SerialChatServer("127.0.0.1", 55555, serviceImpl); server.Start(); Console.WriteLine("Server started ..."); //Console.WriteLine("Press <enter> to exit..."); Console.ReadLine(); }
public static void Main(string[] args) { AngajatRepository angajat = new AngajatRepository(); Console.WriteLine(angajat.findOne(1).User); CursaRepository cursa = new CursaRepository(); Console.WriteLine(cursa.findOne(1).Capacitate); EchipaRepository echipaRepository = new EchipaRepository(); Console.WriteLine(echipaRepository.findOne(1).Nume); ParticipantRepository participant = new ParticipantRepository(); Console.WriteLine(participant.findOne(1).Nume); Cursa C = new Cursa(100, 900); cursa.save(C); Console.WriteLine(cursa.findOne(100).Capacitate); Echipa E = new Echipa(200, "test"); echipaRepository.save(E); Console.WriteLine(echipaRepository.findOne(200).Nume); Participant P = new Participant(600, "test1", 200); participant.save(P); Console.WriteLine(participant.findOne(600).Nume); cursa.delete(100); echipaRepository.delete(200); participant.delete(600); int maxim = participant.FindMaxId(); Console.WriteLine(maxim); Console.WriteLine(cursa.findIdByCapacitate(500)); List <DTOBJCursa> list = cursa.GroupByCapacitate(); foreach (DTOBJCursa test in list) { Console.Write(test.Capacitate); Console.Write(" "); Console.WriteLine(test.NrInscrisi); } Console.WriteLine(angajat.LocalLogin("mgar1992", "12234")); Console.WriteLine(angajat.LocalLogin("mgar1992", "1234")); Console.WriteLine(echipaRepository.FindIdByName("BMW")); List <DTOBJPart> list2 = echipaRepository.cautare("Suzuki"); foreach (DTOBJPart test2 in list2) { Console.Write(test2.Nume); Console.Write(" "); Console.WriteLine(test2.Capacitate); } }
public Service(AngajatRepository angajatRepository, CursaRepository cursaRepository, EchipaRepository echipaRepository, InscriereRepository inscriereRepository, ParticipantRepository participantRepository) { this.angajati = angajatRepository; this.curse = cursaRepository; this.echipe = echipaRepository; this.inscrieri = inscriereRepository; this.participanti = participantRepository; }
public EchipaService(EchipaRepository repo) { this.repo = repo; }