Ejemplo n.º 1
0
        internal static void AddNewEquipment(EquipmentGrouping equipmentGrouping, ListView systemListView, ListView equipmentGroupsListView)
        {
            var dialog = new AddNewEquipmentDialog(equipmentGrouping, systemListView, equipmentGroupsListView);

            dialog.NewEquipmentRequest += NewEquipmentRequest;

            dialog.ShowDialog();
        }
Ejemplo n.º 2
0
        internal static void DeleteEquipmentGrouping(EquipmentGrouping equipmentGrouping, ListView list)
        {
            var dialog = new ConfirmDeleteDialog();

            if ((bool)dialog.ShowDialog())
            {
                EquipmentSystem selectedSystem = null;

                foreach (var system in database.EquipmentSystems)
                {
                    if (system.EquipmentGroupings.Any(e => e.Id == equipmentGrouping.Id))
                    {
                        selectedSystem = system;
                    }
                }
                database.EquipmentGroupings.Remove(equipmentGrouping);

                Save();
                RefreshSystemList();
                list.SelectedItem = systemList.First(s => s.Id == selectedSystem.Id);
            }
        }