예제 #1
0
        static DependencyResolver()
        {
            var DALappSetting = ReadSetting("DAL");

            if (DALappSetting == "File")
            {
                UserDao  = new FileUserDao();
                AwardDao = new FileAwardDao();
            }
            else if (DALappSetting == "DB")
            {
                UserDao      = new DBUserDao();
                AwardDao     = new DBAwardDao();
                AccountDao   = new DBAccountDao();
                AccountLogic = new AccountLogic(AccountDao);
            }
            else
            {
                UserDao  = new MemoryUserDao();
                AwardDao = new MemoryAwardDao();
            }

            UserLogic  = new UserLogic(UserDao);
            AwardLogic = new AwardLogic(AwardDao);
        }
예제 #2
0
 static DaoProvider()
 {
     if (ConfigurationManager.AppSettings["DaoMode"] == "DB")
     {
         UserDao    = new DBUserDao();
         SkillDao   = new DBSkillDao();
         AccountDao = new DBAccountDao();
         PhotoDao   = new DBPhotoDao();
     }
 }
예제 #3
0
 static DaoProvider()
 {
     if (ConfigurationManager.AppSettings["DaoMode"] == "File")
     {
         UserDao  = new FileUserDao();
         AwardDao = new FileAwardDao();
     }
     if (ConfigurationManager.AppSettings["DaoMode"] == "DB")
     {
         UserDao    = new DBUserDao();
         AwardDao   = new DBAwardDao();
         AccountDao = new DBAccountDao();
     }
 }
예제 #4
0
        static DaoProvider()
        {
            switch (ConfigurationManager.AppSettings["db"])
            {
            //case "file":
            //    AwardDao = new FileAwardDao();
            //    UserDao = new FileUserDao();
            //    SecurityDao = new FileSecurityDao();
            //    break;
            case "sql":
                AwardDao = new DBAwardDao();
                UserDao  = new DBUserDao();
                //SecurityDao = new DBSecurityDao();
                //AvatarDao = new DBAvatarDao();
                break;

            default:
                throw new InvalidCastException();
            }
        }