public static void InsertOriginal(T item, ICollection <T> source)
 {
     if (CheckForExistence <T> .IsExist(item, source) == true)
     {
         Update <T> .UpdateTable(item);
     }
     else
     {
         Add <T> .AddNew(item);
     }
 }
        private static void Equipment(List <object> data)
        {
            var name = data[0].ToString();

            if (!int.TryParse(data[1].ToString(), out int numberOfSeats))
            {
                throw new ArgumentException("Вы ввели не число в поле \"Количество сидений\"", nameof(numberOfSeats));
            }

            var equipment = new Equipment(name, numberOfSeats);

            Insert <Equipment> .InsertOriginal(equipment, Select.Equipment());

            try
            {
                var specialEquipmentNames = data[2] as Dictionary <string, bool>;

                if (specialEquipmentNames.Count == 0)
                {
                    return;
                }

                var specialEquipmentCollection = NamesToObjects <SpecialEquipment> .GetObjects(specialEquipmentNames, Select.SpecialEquipment());

                foreach (var specialEquipment in specialEquipmentCollection)
                {
                    var val = new SpecialEquipmentInEquipment(specialEquipment.Key.Id, equipment.Id);

                    if (CheckForExistence <SpecialEquipmentInEquipment> .IsExist(val, Select.SpecialEquipmentInEquipment()) == true && specialEquipment.Value == false)
                    {
                        Delete <SpecialEquipmentInEquipment> .DeleteFromTable(val);
                    }
                    else if (CheckForExistence <SpecialEquipmentInEquipment> .IsExist(val, Select.SpecialEquipmentInEquipment()) == false && specialEquipment.Value == true)
                    {
                        Add <SpecialEquipmentInEquipment> .AddNew(val);
                    }
                }
            }
            catch { }
        }