Example #1
0
        private void btnRoomAdd_Click(object sender, RoutedEventArgs e)
        {
            service.RoomService roomService = new service.RoomService();

            Room room = new Room()
            {
                Type         = txtRoomType.Text,
                NoOfBeds     = Byte.Parse(txtRoomNoOfBeds.Text),
                Availability = (chkRoomAvailability.IsChecked == true),
                RatePerDay   = Decimal.Parse(txtRoomRatePerDay.Text)
            };

            roomService.AddRoom(room);
        }
Example #2
0
        private void btnRoomEdit_Click(object sender, RoutedEventArgs e)
        {
            service.RoomService roomService = new service.RoomService();

            Room room = new Room();

            room.RoomId       = Byte.Parse(txtRoomRoomId.Text);
            room.Type         = txtRoomType.Text;
            room.NoOfBeds     = Byte.Parse(txtRoomNoOfBeds.Text);
            room.Availability = (chkRoomAvailability.IsChecked == true);
            room.RatePerDay   = Decimal.Parse(txtRoomRatePerDay.Text);

            roomService.EditRoom(room);

            MessageBox.Show("Room has been updated. Please reload Grid.");
        }
Example #3
0
 // *************************************************************
 private void btnRoomLoadGrid_Click(object sender, RoutedEventArgs e)
 {
     service.RoomService roomService = new service.RoomService();
     this.DataContext = roomService.GetAllRooms();
 }
Example #4
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     service.RoomService roomService = new service.RoomService();
     this.DataContext = roomService.GetAllRooms();
 }