コード例 #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();
        }
コード例 #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);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
0
ファイル: AwardBl.cs プロジェクト: Gazizova-Olga/EPAM.NET
 public AwardBL()
 {
     awardsDAO = new AwardSqlDAO();
 }
コード例 #6
0
ファイル: AwardsBL.cs プロジェクト: Borowik1/Dot_net_lessons
 public AwardsBL()
 {
     awardsDAO = new AwardsDAOdb();
 }
コード例 #7
0
ファイル: AwardLogic.cs プロジェクト: gruled/xt_net_web
 public AwardLogic(IAwardDAO awardDao, IUsersAndAwardsDAO usersAndAwardsDao)
 {
     this._awardDao          = awardDao;
     this._usersAndAwardsDao = usersAndAwardsDao;
 }
コード例 #8
0
ファイル: AwardLogic.cs プロジェクト: kola011235/MVC
        public AwardLogic()
        {
            IKernel ninjectKernel = new StandardKernel(new NinjectRegistrations());

            awardDAO = ninjectKernel.Get <IAwardDAO>();
        }
コード例 #9
0
 public AwardService(IAwardDAO awardDAO, IUserAwardDAO userAwardDAO, IUserDAO userDAO)
 {
     _awardDAO     = awardDAO;
     _userAwardDAO = userAwardDAO;
     _userDAO      = userDAO;
 }
コード例 #10
0
 public AwardBLL()
 {
     _awardDAL = UsersAndAwardsDALDependencies.AwardDAO;
 }
コード例 #11
0
ファイル: AwardLogic.cs プロジェクト: GordeevaM/XT-2018Q4
 public AwardLogic(IAwardDAO awardDAO)
 {
     _awardDAO = awardDAO;
 }
コード例 #12
0
ファイル: UserManager.cs プロジェクト: VorXal/xt_net_web
 public UserManager(IUserDAO userDAO, IAwardDAO awardDAO)
 {
     _userDAO  = userDAO;
     _awardDAO = awardDAO;
 }
コード例 #13
0
 public AwardBL()
 {
     //  awardsDAO = new AwardDAO();
     awardsDAO = new AwardSqlDAO();
 }
コード例 #14
0
 public AwardManager(IAwardDAO awardDAO, IUserDAO userDAO)
 {
     _awardDAO = awardDAO;
     _userDAO  = userDAO;
 }
コード例 #15
0
 public AwardLogic(IAwardDAO awardDao)
 {
     _awardDAO = awardDao;
 }
コード例 #16
0
ファイル: AwardBL.cs プロジェクト: esrayskaya/DotNetCourse
 /*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;
 }
コード例 #17
0
 public AwardLogic(IAwardDAO userDAO)
 {
     _awardDAO = userDAO;
 }
コード例 #18
0
 public UserService(IUserDAO userDAO, IAwardDAO awardDAO, IUserAwardDAO userAwardDAO)
 {
     _userDAO      = userDAO;
     _awardDAO     = awardDAO;
     _userAwardDAO = userAwardDAO;
 }
コード例 #19
0
 public AwardLogic(IAwardDAO awardDao, IUsersAndAwardsDAO usersAndAwardsDao, IAwardsAndImagesLogic awardsAndImagesLogic)
 {
     this._awardDao             = awardDao;
     this._usersAndAwardsDao    = usersAndAwardsDao;
     this._awardsAndImagesLogic = awardsAndImagesLogic;
 }