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(); }
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); }
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); }
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); }
public AwardBL() { awardsDAO = new AwardSqlDAO(); }
public AwardsBL() { awardsDAO = new AwardsDAOdb(); }
public AwardLogic(IAwardDAO awardDao, IUsersAndAwardsDAO usersAndAwardsDao) { this._awardDao = awardDao; this._usersAndAwardsDao = usersAndAwardsDao; }
public AwardLogic() { IKernel ninjectKernel = new StandardKernel(new NinjectRegistrations()); awardDAO = ninjectKernel.Get <IAwardDAO>(); }
public AwardService(IAwardDAO awardDAO, IUserAwardDAO userAwardDAO, IUserDAO userDAO) { _awardDAO = awardDAO; _userAwardDAO = userAwardDAO; _userDAO = userDAO; }
public AwardBLL() { _awardDAL = UsersAndAwardsDALDependencies.AwardDAO; }
public AwardLogic(IAwardDAO awardDAO) { _awardDAO = awardDAO; }
public UserManager(IUserDAO userDAO, IAwardDAO awardDAO) { _userDAO = userDAO; _awardDAO = awardDAO; }
public AwardBL() { // awardsDAO = new AwardDAO(); awardsDAO = new AwardSqlDAO(); }
public AwardManager(IAwardDAO awardDAO, IUserDAO userDAO) { _awardDAO = awardDAO; _userDAO = userDAO; }
public AwardLogic(IAwardDAO awardDao) { _awardDAO = awardDao; }
/*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; }
public AwardLogic(IAwardDAO userDAO) { _awardDAO = userDAO; }
public UserService(IUserDAO userDAO, IAwardDAO awardDAO, IUserAwardDAO userAwardDAO) { _userDAO = userDAO; _awardDAO = awardDAO; _userAwardDAO = userAwardDAO; }
public AwardLogic(IAwardDAO awardDao, IUsersAndAwardsDAO usersAndAwardsDao, IAwardsAndImagesLogic awardsAndImagesLogic) { this._awardDao = awardDao; this._usersAndAwardsDao = usersAndAwardsDao; this._awardsAndImagesLogic = awardsAndImagesLogic; }