示例#1
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);
        }
        /// <summary>
        /// contructor of TransactionInformationForm
        /// </summary>
        public TransactionInformationForm() : base()
        {
            rentBikeController   = new RentBikeController();
            returnBikeController = new ReturnBikeController();
            paymentController    = new PaymentController();

            InitializeComponent("TransactionInformationForm", "Transaction Information");
            DrawTransactionInformationForm();
        }
        /// <summary>
        /// contructor of RentBikeForm
        /// </summary>
        public ReturnBikeForm() : base()
        {
            viewStationController = new ViewStationController();
            returnBikeController  = new ReturnBikeController();

            stationList = viewStationController.ViewListStation();

            InitializeComponent("ReturnBikeForm", "Return Bike");
            DrawReturnBikeForm();
            RenderStationList();
        }