예제 #1
0
        public MainWindowViewModel()
        {
            dbConnection    = new DBConnection();
            productRepo     = new ProductRepository();
            transactionRepo = new TransactionRepository();
            userRepo        = new UserRepository();

            userDBContext        = new UserDBContext(userRepo, dbConnection);
            productDBContext     = new ProductDBContext(productRepo, dbConnection);
            transactionDBContext = new TransactionDBContext(transactionRepo, dbConnection);

            Auth.CreateInstance(userRepo);
            startingView           = new StartingViewModel();
            loginView              = new LoginViewModel();
            dashboardView          = new DashboardViewModel();
            profileView            = new UserProfileViewModel();
            listProdukView         = new ListProductViewModel(productRepo);
            createProductView      = new CreateProductViewModel(productRepo);
            createTransactionView  = new CreateTransactionViewModel(transactionRepo, productRepo);
            editProductView        = new EditProductViewModel();
            transactionHistoryView = new TransactionHistoryViewModel();
            registerView           = new RegisterViewModel(userRepo);
            salesRecapView         = new SalesRecapViewModel();
            Mediator.Subscribe("Change View To Start", GoToStart);
            Mediator.Subscribe("Change View To Dashboard", GoToDasboard);
            Mediator.Subscribe("Change View To Profile", GoToProfile);
            Mediator.Subscribe("Change View To Product List", GoToProductList);
            Mediator.Subscribe("Change View To Create Product", GoToCreateProduct);
            Mediator.Subscribe("Change View To Create Transaction", GoToCreateTransaction);
            Mediator.Subscribe("Change View To Edit Product", GoToEditProduct);
            Mediator.Subscribe("Change View To Transaction History", GoToTransactionHistory);
            Mediator.Subscribe("Change View To Sales Recap", GoToSalesRecap);
            CurrentView = startingView;
        }
 public TransactionService(TransactionDBContext context)
 {
     _context = context;
 }
예제 #3
0
 public HomeController(TransactionDBContext context, ILogger <HomeController> logger, ITransactionService transactionService)
 {
     _logger             = logger;
     _transactionService = transactionService;
 }