예제 #1
0
        public static void InitDataBase(bool exec)
        {
            GetSession(exec); //初始化表
            IRepository     repository     = UnityIoC.Get <IRepository>();
            IAccountService accountService = UnityIoC.Get <IAccountService>();

            if (!repository.IsExisted(new Account.By(AccountIdentifier.of("肖斌武")))) //初始化数据
            {
                accountService.CreateAccount("肖斌武", "SDT34200")
                .SetPassWord("1")
                .SetRole(Role.All)
                .SetCanDelete(false);
                accountService.CreateAccount("王旺玲", "SDT02207")
                .SetPassWord("1")
                .SetRole(Role.All)
                .SetCanDelete(false)
                .Commit();
            }
        }
예제 #2
0
 public AdminController(IAccountService accountService)
 {
     this.accountService = accountService;
     exemplarServer      = UnityIoC.Get <ExemplarServer>();
 }
 public ExemplarCommand(Exemplar exemplar, IRepository repository)
 {
     this.repository     = repository;
     this.exemplar       = exemplar;
     this.sessionService = UnityIoC.Get <IMySessionService>();
 }
 public MailServer()
 {
     this.repository = UnityIoC.Get <IRepository>();
 }
예제 #5
0
 public ExemplarServer(IRepository repository)
 {
     this.repository     = repository;
     this.sessionService = UnityIoC.Get <IMySessionService>();
     this.mailServer     = new MailServer();
 }
예제 #6
0
 protected void Application_Start()
 {
     UnityIoC.RegisterComponents();                 //依赖注入
     AreaRegistration.RegisterAllAreas();           //注册区域路由
     RouteConfig.RegisterRoutes(RouteTable.Routes); //注册全局路由
 }