예제 #1
0
        public BusInfoBusOwnerForm()
        {
            InitializeComponent();
            bus = GlobalConfig.currentBus;
            var owner = GlobalConfig.CurrentOwner();

            LoadBusinfo();
        }
예제 #2
0
        public static void Init()
        {
            Guests     = new List <GuestModel>();
            Owners     = new List <OwnerModel>();
            Buses      = new List <BusModel>();
            Tickets    = new List <TicketModel>();
            GuestUser  = -1;
            OwnerUser  = -1;
            currentBus = new BusModel();

            // Testing
            Owners.Add(new OwnerModel("admin", "0123", "admin", ""));
            Buses.Add(new BusModel(0, "TP. Hồ Chí Minh", "Vũng Tàu", "100", "3000"));
            Buses.Add(new BusModel(0, "Đà Nẵng", "Vũng Tàu", "1000", "7000"));
            Guests.Add(new GuestModel("phuc guest", "911", "phuc", "", "hcm"));
            currentBus = Buses[0];
        }
예제 #3
0
 private void button_AddBus_Click(object sender, EventArgs e)
 {
     if (!ValidInformation())
     {
         MessageBox.Show("Invalid information.\nPlease try again!");
     }
     else
     {
         int      owner  = GlobalConfig.OwnerUser;
         BusModel newbus = new BusModel(owner, startingpointing.Text,
                                        endingpointing.Text,
                                        // expecttime.Text,
                                        dateTimePicker1.Value.ToShortDateString(),
                                        price.Text);
         GlobalConfig.Buses.Add(newbus);
         LoadBusListInfo();
     }
 }
 public BusInfoGuestForm()
 {
     InitializeComponent();
     bus = GlobalConfig.currentBus;
     LoadBusinfo();
 }
예제 #5
0
        public static void AddTicket(BusModel bus, string seat, string button)
        {
            var t = new TicketModel(bus.Id, GuestUser, seat, button);

            Tickets.Add(t);
        }