Exemple #1
0
        static DependencyResolver()
        {
            switch (ConfigurationManager.AppSettings["DAL"])
            {
            case "Memory":
                _userDao           = new UserOnMemoryDAO();
                _awardDao          = new AwardOnMemoryDAO();
                _usersAndAwardsDao = new UsersAndAwardsOnMemoryDAO();
                break;

            case "File":
                _userDao            = new UserOnFileDAO();
                _awardDao           = new AwardOnFileDAO();
                _usersAndAwardsDao  = new UsersAndAwardsOnFileDAO();
                _webUserDao         = new WebUserFileDao();
                _userRoleDao        = new UserRoleFileDAO();
                _imagesDao          = new ImagesDAO();
                _usersAndImagesDao  = new UsersAndImagesOnFileDAO();
                _awardsAndImagesDao = new AwardsAndImagesDAO();
                break;

            case "Database":
                _userDao            = new UserDatabaseDAO();
                _awardDao           = new AwardDatabaseDAO();
                _usersAndAwardsDao  = new UsersAndAwardsDatabaseDAO();
                _webUserDao         = new WebUserDatabaseDAO();
                _userRoleDao        = new UserRoleDatabaseDAO();
                _imagesDao          = new ImagesDatabaseDAO();
                _usersAndImagesDao  = new UsersAndImagesDatabaseDAO();
                _awardsAndImagesDao = new AwardsAndImagesDatabaseDAO();
                break;
            }

            _usersAndAwardsLogic  = new UsersAndAwardsLogic(_usersAndAwardsDao);
            _webUserLogic         = new WebUserLogic(_webUserDao);
            _userRoleLogic        = new UserRoleLogic(_userRoleDao);
            _usersAndImagesLogic  = new UsersAndImagesLogic(_usersAndImagesDao);
            _awardsAndImagesLogic = new AwardsAndImagesLogic(_awardsAndImagesDao);
            _userLogic            = new UserLogic(_userDao, _usersAndAwardsDao, _usersAndImagesLogic);
            _awardLogic           = new AwardLogic(_awardDao, _usersAndAwardsDao, _awardsAndImagesLogic);
            _imagesLogic          = new ImagesLogic(_imagesDao, _usersAndImagesLogic, _awardsAndImagesLogic);
        }
Exemple #2
0
 public ImagesLogic(IImagesDAO imagesDAO, IUsersAndImagesLogic usersAndImagesLogic, IAwardsAndImagesLogic awardsAndImagesLogic)
 {
     _imagesDao            = imagesDAO;
     _usersAndImagesLogic  = usersAndImagesLogic;
     _awardsAndImagesLogic = awardsAndImagesLogic;
 }