public static EditRoomWindow getInstance(Room selectedRoom)
 {
     if (instance == null)
     {
         instance = new EditRoomWindow(selectedRoom);
     }
     return(instance);
 }
示例#2
0
 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);
     }
 }
示例#3
0
 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();
     }
 }
示例#4
0
 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);
     }
 }
示例#5
0
 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;
 }