예제 #1
0
 private void deleteRoomMenuItem_Click(object sender, RoutedEventArgs e)
 {
     if (roomsUserControl.allRoomsTable.SelectedItem != null)
     {
         room = (Room)this.roomsUserControl.allRoomsTable.SelectedItem;
         if (string.Equals(room.Name, "Magacin"))
         {
             return;
         }
         if (!room.RoomRenovationState.ActivityStatus)
         {
             RoomController.GetInstance().DeleteRoom((Room)this.roomsUserControl.allRoomsTable.SelectedItem);
             ManagerMainWindow.getInstance().roomsUserControl.refreshTable();
             MessageBox.Show("Izabrana prostorija je sada obrisana iz sistema.", "Brisanje prostorije", MessageBoxButton.OK, MessageBoxImage.Information);
         }
         else
         {
             RenovationMessageWindow.GetInstance().Show();
         }
     }
     else
     {
         MessageBox.Show("Niste odabrali prostoriju!", "Upozorenje", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
예제 #2
0
 public static ManagerMainWindow getInstance()
 {
     if (instance == null)
     {
         instance = new ManagerMainWindow();
     }
     return(instance);
 }
 private void changeRoomButton_Click(object sender, RoutedEventArgs e)
 {
     if (TryUpdateRoom())
     {
         ManagerMainWindow.getInstance().roomsUserControl.refreshTable();
         MessageBox.Show("Informacije o prostoriji su sada izmenjene.", "Izmena informacija", MessageBoxButton.OK, MessageBoxImage.Information);
         changeRoomButton.IsEnabled = false;
         this.Close();
     }
 }
예제 #4
0
 private void confirmButton_Click(object sender, RoutedEventArgs e)
 {
     if (CheckControlsInputCorrection())
     {
         MedicineController.GetInstance().AddMedicine(new Medicine(int.Parse(idTextBox.Text), nameTextBox.Text, LoadMedicineType(), purposeTextBoxt.Text, useTextBox.Text, LoadReplacementMedicine(), medicineIngredientList));
         ManagerMainWindow.getInstance().medicineTableUserControl.RefreshTable();
         this.Close();
         MessageBox.Show("Unet je novi lek u sistem.", "Novi lek", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
 private void confirmButton_Click(object sender, RoutedEventArgs e)
 {
     MakeRoomAttributes();
     while (TryCreateRoom())
     {
         ManagerMainWindow.getInstance().roomsUserControl.refreshTable();
         this.Close();
         MessageBox.Show("Uneta je nova prostorija u sistem.", "Nova prostorija", MessageBoxButton.OK, MessageBoxImage.Information);
         break;
     }
 }
예제 #6
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);
     }
 }
 private void changeButton_Click(object sender, RoutedEventArgs e)
 {
     MakeEquipmentAttributes();
     if(ValidateInputs())
     {
         UpdateEquipment();
         ManagerMainWindow.getInstance().equipmentTable.refreshTable();
         this.Close();
         MessageBox.Show("Informacije o opremi su sada izmenjene.", "Izmena prostorije", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
예제 #8
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();
     }
 }
예제 #9
0
        private void deleteEquipmentMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Equipment selectedEquipment = null;

            if (equipmentTable.equipmentTable.SelectedItem != null)
            {
                selectedEquipment = (Equipment)this.equipmentTable.equipmentTable.SelectedItem;
            }
            else
            {
                MessageBox.Show("Odaberite opremu iz opšteg prikaza opreme!", "Upozorenje", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }
            EquipmentController.getInstance().deleteEquipment(selectedEquipment);
            ManagerMainWindow.getInstance().equipmentTable.refreshTable();
            MessageBox.Show("Izabrana oprema je sada obrisana iz sistema.", "Brisanje opreme", MessageBoxButton.OK, MessageBoxImage.Information);
        }
 private void RefreshEquipmentTables()
 {
     ManagerMainWindow.getInstance().equipmentTable.refreshTable();
     ManagerMainWindow.getInstance().detailEquipmentTable.LoadAllUserControlComponents();
 }
예제 #11
0
 private void exitMenuItem_Click(object sender, RoutedEventArgs e)
 {
     this.Close();
     instance = null;
 }
예제 #12
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     instance = null;
     MainWindow.Serialize();
 }