private void createNewRoomButton_Click(object sender, EventArgs e)
        {
            hms    = new HotelManagementSystem();
            hotels = new Dictionary <int, Hotel>();
            Room room;

            string employeeItem = managementHotelListBox.SelectedItem.ToString();
            int    employeeId   = Convert.ToInt32(employeeItem.Substring(0, employeeItem.IndexOf(' ')));
            int    HotelId      = employeeId;
            string type         = this.roomTypeTextbox.Text;
            string RoomPrice    = roomPriceTextbox.Text;
            float  price        = (float)Convert.ToDouble(RoomPrice);


            room = new Room(1, HotelId, type, price, null, false);
            this.hms.AddRoom(room);
            Dictionary <int, Room> rooms = hms.getRoomsByHotelId(HotelId);

            managementRoomListBox.Items.Clear();
            roomListBox.Items.Clear();
            // Clear the current list of items

            foreach (var pair in rooms)
            {
                managementRoomListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getType()} - ${pair.Value.getPrice()}");
            }
            managementRoomListBox.Update();
            roomListBox.Update();

            ExceptionInterface excep = new ExceptionInterface("Successfully created new room");

            excep.Show();
        }
        public CustomerInterface(Customer customer)
        {
            InitializeComponent();

            this.customer = customer;
            this.hms      = new HotelManagementSystem();
        }
Beispiel #3
0
        public TransactionInterface(Customer customer, Room room, DateTime startDate, DateTime endDate)
        {
            InitializeComponent();

            this.customer = customer;
            this.room     = room;

            this.startDate = startDate;
            this.endDate   = endDate;

            this.hms = new HotelManagementSystem();
        }
        private void createNewLocationButton_Click_1(object sender, EventArgs e)
        {
            hms    = new HotelManagementSystem();
            hotels = new Dictionary <int, Hotel>();

            string name    = this.managementLocationNameTextBox.Text;
            string address = this.manageHotelAddressTextBox.Text;
            string city    = this.manageHotelCity.Text;
            string state   = this.manageHotelState.Text;

            Hotel hotel = new Hotel(1, address, city, state, name);

            this.hms.AddHotel(hotel);

            ExceptionInterface excep = new ExceptionInterface("Successfully created new hotel");

            excep.Show();
        }
        // On load
        private void EmployeeInterface_Load(object sender, EventArgs e)
        {
            hms = new HotelManagementSystem(); // Instantiate hms

            customers = hms.getCustomerData(); // Get a list of all customers

            foreach (var pair in customers)    // Add each to the listbox for customers
            {
                customerListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getName()} - {pair.Value.getDateOfBirth()}");
            }

            hotels = hms.getHotelData();    // Get a list of all hotels

            foreach (var pair in hotels)    // Add each to the listbox for hotels
            {
                hotelListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getName()} - {pair.Value.getStreetAddress()}, {pair.Value.getCity()}, {pair.Value.getState()}");
                managementHotelListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getName()} - {pair.Value.getStreetAddress()}, {pair.Value.getCity()}, {pair.Value.getState()}");
            }
        }
Beispiel #6
0
        public LoginInterface()
        {
            InitializeComponent();

            this.hms = new HotelManagementSystem();
        }