Exemplo n.º 1
0
        static void Main()
        {
            Type obj = Type.GetType(ConfigurationManager.AppSettings["UserRepository"]);

            System.Reflection.ConstructorInfo constructor = obj.GetConstructor(new Type[] { });
            IUserDAO userRepository = (IUserDAO)constructor.Invoke(null);

            UserService userService = new UserService(userRepository);

            obj         = Type.GetType(ConfigurationManager.AppSettings["ServiciuRepository"]);
            constructor = obj.GetConstructor(new Type[] { });
            IServiciuDAO serviciuRepository = (IServiciuDAO)constructor.Invoke(null);

            ServiciuService serviciuServer = new ServiciuService(serviciuRepository);

            obj         = Type.GetType(ConfigurationManager.AppSettings["ProgramareServiciuRepository"]);
            constructor = obj.GetConstructor(new Type[] { });
            IProgramareServiciuDAO programareServiciuRepository = (IProgramareServiciuDAO)constructor.Invoke(null);


            obj         = Type.GetType(ConfigurationManager.AppSettings["ProgramareRepository"]);
            constructor = obj.GetConstructor(new Type[] { });
            IProgramareDAO programareRepository = (IProgramareDAO)constructor.Invoke(null);

            ProgramareService programareService = new ProgramareService(programareRepository, serviciuRepository, programareServiciuRepository);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new LoginForm(userService, serviciuServer, programareService));
        }
 public ProgramareService(IProgramareDAO programareDAO, IServiciuDAO serviciuDAO, IProgramareServiciuDAO programareServiciuDAO)
 {
     _programareDAO         = programareDAO;
     _serviciuDAO           = serviciuDAO;
     _programareServiciuDAO = programareServiciuDAO;
 }
 public ProgramareServiciuServer(IProgramareServiciuDAO programareServiciuDAO)
 {
     _programareServiciuDAO = programareServiciuDAO;
 }