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); }
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."); }
// ************************************************************* private void btnRoomLoadGrid_Click(object sender, RoutedEventArgs e) { service.RoomService roomService = new service.RoomService(); this.DataContext = roomService.GetAllRooms(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { service.RoomService roomService = new service.RoomService(); this.DataContext = roomService.GetAllRooms(); }