Example #1
0
        static DependencyResolver()
        {
            var dataReadConfig = DataMode.GetLogic("DataMode");

            switch (dataReadConfig)
            {
            case "XML":
                UserDAO  = new UserXmlDAO();
                AwardDAO = new AwardXMLDAO();
                break;

            case "Memory":
                UserDAO  = new UserFakeDAO();
                AwardDAO = new AwardFakeDAO();
                break;

            case "DB":
                UserDAO  = new UserDbDAO();
                AwardDAO = new AwardDbDAO();
                break;

            default:
                UserDAO  = new UserFakeDAO();
                AwardDAO = new AwardFakeDAO();
                break;
            }
            AuthUserDAO = new AuthUserDAO();
        }
Example #2
0
 static DependencyResolver()
 {
     _settingsDao   = new Settings();
     _settingsLogic = new SettingsLogic(_settingsDao);
     if (ConfigurationManager.AppSettings["DAL"].Equals("Memory"))
     {
         _userDao  = new Memory();
         _awardDao = new MemoryAward();
     }
     else
     {
         if (ConfigurationManager.AppSettings["DAL"].Equals("TextFile"))
         {
             _userDao  = new TextFiles(SettingsLogic);
             _awardDao = new TextFileAward(SettingsLogic);
             SettingsLogic.SetPath(ConfigurationManager.AppSettings["PathToFile"]);
             SettingsLogic.SetPathToUsers(ConfigurationManager.AppSettings["PathToAuthFile"]);
             SettingsLogic.SetPathToImages(ConfigurationManager.AppSettings["PathToImages"]);
         }
     }
     _authUserDao   = new AuthUserTextFile(_settingsLogic);
     _authUserLogic = new AuthUserLogic(_authUserDao);
     _userLogic     = new UserLogic(_userDao);
     _awardLogic    = new AwardLogic(_awardDao);
 }
Example #3
0
        static DependencyResolver()
        {
            _awardDAO   = new JsonAwardDAO();
            _userDAO    = new JsonUserDAO();
            _accountDAO = new JsonAccountDAO();

            _userLogic    = new UserManager(_userDAO, _awardDAO);
            _awardLogic   = new AwardManager(_awardDAO, _userDAO);
            _accountLogic = new AccountManager(_accountDAO);
        }
Example #4
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);
        }
Example #5
0
 public AwardBL()
 {
     awardsDAO = new AwardSqlDAO();
 }
Example #6
0
 public AwardsBL()
 {
     awardsDAO = new AwardsDAOdb();
 }
Example #7
0
 public AwardLogic(IAwardDAO awardDao, IUsersAndAwardsDAO usersAndAwardsDao)
 {
     this._awardDao          = awardDao;
     this._usersAndAwardsDao = usersAndAwardsDao;
 }
Example #8
0
        public AwardLogic()
        {
            IKernel ninjectKernel = new StandardKernel(new NinjectRegistrations());

            awardDAO = ninjectKernel.Get <IAwardDAO>();
        }
Example #9
0
 public AwardService(IAwardDAO awardDAO, IUserAwardDAO userAwardDAO, IUserDAO userDAO)
 {
     _awardDAO     = awardDAO;
     _userAwardDAO = userAwardDAO;
     _userDAO      = userDAO;
 }
Example #10
0
 public AwardBLL()
 {
     _awardDAL = UsersAndAwardsDALDependencies.AwardDAO;
 }
Example #11
0
 public AwardLogic(IAwardDAO awardDAO)
 {
     _awardDAO = awardDAO;
 }
Example #12
0
 public UserManager(IUserDAO userDAO, IAwardDAO awardDAO)
 {
     _userDAO  = userDAO;
     _awardDAO = awardDAO;
 }
Example #13
0
 public AwardBL()
 {
     //  awardsDAO = new AwardDAO();
     awardsDAO = new AwardSqlDAO();
 }
Example #14
0
 public AwardManager(IAwardDAO awardDAO, IUserDAO userDAO)
 {
     _awardDAO = awardDAO;
     _userDAO  = userDAO;
 }
Example #15
0
 public AwardLogic(IAwardDAO awardDao)
 {
     _awardDAO = awardDao;
 }
Example #16
0
 /*public IEnumerable<Common.Award> InitAwardsList()
  * {
  *  AddAward(new Award() { Title = "Нобелевская премия", Description = "" });
  *  AddAward(new Award() { Title = "Оскар", Description = "2018" });
  *  return GetAwardsList();
  * }*/
 public AwardBL(IAwardDAO award)
 {
     //this.usersDAO = new UsersDAO();
     awardsDAO = award;
 }
Example #17
0
 public AwardLogic(IAwardDAO userDAO)
 {
     _awardDAO = userDAO;
 }
Example #18
0
 public UserService(IUserDAO userDAO, IAwardDAO awardDAO, IUserAwardDAO userAwardDAO)
 {
     _userDAO      = userDAO;
     _awardDAO     = awardDAO;
     _userAwardDAO = userAwardDAO;
 }
Example #19
0
 public AwardLogic(IAwardDAO awardDao, IUsersAndAwardsDAO usersAndAwardsDao, IAwardsAndImagesLogic awardsAndImagesLogic)
 {
     this._awardDao             = awardDao;
     this._usersAndAwardsDao    = usersAndAwardsDao;
     this._awardsAndImagesLogic = awardsAndImagesLogic;
 }