public static EditRoomWindow getInstance(Room selectedRoom) { if (instance == null) { instance = new EditRoomWindow(selectedRoom); } return(instance); }
private void AddEquipment() { if (window.Equals(Constants.NEW_ROOM_WINDOW)) { NewRoomWindow.getInstance().addEquipmentToRoom(selectedEquipment.Id, quantity); } else { EditRoomWindow.getInstance((Room)ManagerMainWindow.getInstance().roomsUserControl.allRoomsTable.SelectedItem).addEquipment(selectedEquipment.Id, quantity); } }
private void RefreshListBoxes() { if (window.Equals(Constants.NEW_ROOM_WINDOW)) { NewRoomWindow.getInstance().refreshDynamicEquipmentListBox(); NewRoomWindow.getInstance().refreshStaticEquipmentListBox(); } else { EditRoomWindow.getInstance((Room)ManagerMainWindow.getInstance().roomsUserControl.allRoomsTable.SelectedItem).RefreshDynamicEquipmentListBox(); EditRoomWindow.getInstance((Room)ManagerMainWindow.getInstance().roomsUserControl.allRoomsTable.SelectedItem).RefreshStaticEquipmentListBox(); } }
private void confirmButton_Click(object sender, RoutedEventArgs e) { if (CheckTheEnteredQuantity()) { SupplyRoomDynamicEquipment(selectedRoom, idOfSelectedEquipment); RoomController.GetInstance().GetMagacine().EquipmentInRoom.ReduceEquipmentQuantity(idOfSelectedEquipment, int.Parse(quantityTextBox.Text)); EditRoomWindow.getInstance(selectedRoom).LoadRoomEquipment(); EditRoomWindow.getInstance(selectedRoom).RefreshDynamicEquipmentListBox(); this.Close(); } else { MessageBox.Show("Pogrešan unos količine!", "Greška", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void editRoomMenuItem_Click(object sender, RoutedEventArgs e) { room = (Room)this.roomsUserControl.allRoomsTable.SelectedItem; if (room != null) { if (room.RoomRenovationState.ActivityStatus) { RenovationMessageWindow.GetInstance().Show(); } else { EditRoomWindow.getInstance(room).Show(); } } else { MessageBox.Show("Niste odabrali prostoriju!", "Upozorenje", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { instance = null; }