Ejemplo n.º 1
0
 /// <summary>
 /// contructor of RentBikeController
 /// </summary>
 public RentBikeController()
 {
     bikeService        = new BaseBikeService(SQLConnecter.GetInstance());
     stationService     = new StationService(SQLConnecter.GetInstance());
     cardService        = new CardService(SQLConnecter.GetInstance());
     transactionService = new TransactionService(SQLConnecter.GetInstance());
 }
Ejemplo n.º 2
0
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //connect to database
            connecter = SQLConnecter.GetInstance();

            //init services
            bikeService         = new BikeService(connecter);
            cardService         = new CardService(connecter);
            electricBikeService = new ElectricBikeService(connecter);
            stationService      = new StationService(connecter);
            tandemService       = new TandemService(connecter);
            transactionService  = new TransactionService(connecter);
            userService         = new UserService(connecter);

            //init controllers
            rentBikeController    = new RentBikeController();
            bikeStationController = new BikeStationController();
            returnBikeController  = new ReturnBikeController();

            //init the presentation
            homePageForm               = new HomePageForm();
            stationDetailForm          = new StationDetailForm();
            bikeDetailForm             = new BikeDetailForm();
            cardInformationForm        = new CardInformationForm();
            listBikeForm               = new ListBikeForm();
            rentBikeForm               = new RentBikeForm();
            returnBikeForm             = new ReturnBikeForm();
            transactionInformationForm = new TransactionInformationForm();

            Application.Run(homePageForm);
        }
Ejemplo n.º 3
0
        public StorageService()
        {
            string currentPath      = Utils.GetCurrentDirectory();
            string projectDirectory = Directory.GetParent(currentPath).Parent.FullName;

            connecter = SQLConnecter.GetInstance(string.Format("Data Source={0}; Version = 3;",
                                                               projectDirectory + @"\Resources\data\data.sqlite"));
            connecter.OpenConnection();
            gameWorker = new SaveGameWorker();

            CurrentIndex = -1;
            InitializeConfiguration();
            LoadGame();
        }
 /// <summary>
 /// Contructor of ViewBikeController
 /// </summary>
 public ViewBikeController()
 {
     bikeService = new BaseBikeService(SQLConnecter.GetInstance());
 }
 /// <summary>
 /// Contructor of ViewStationController
 /// </summary>
 public ViewStationController()
 {
     stationService = new StationService(SQLConnecter.GetInstance());
 }