Esempio n. 1
0
        private void ShowDiscriminatorForm()
        {
            var inheritanceType = EntityImpl.DetermineInheritanceTypeWithChildren(Entity);

            if (inheritanceType != EntityImpl.InheritanceType.TablePerSubClass &&
                inheritanceType != EntityImpl.InheritanceType.TablePerSubClassWithDiscriminator)
            {
                MessageBox.Show(this, "Invalid: only valid for Table Per Sub-Class inheritance.");
                return;
            }
            List <ArchAngel.Providers.EntityModel.Model.DatabaseLayer.ITable> mappedTables = Entity.MappedTables().ToList();

            if (mappedTables.Count == 0)
            {
                MessageBox.Show(this, "No tables are mapped to this entity. 'Table per Hierarchy' inheritance requires exactly one mapped table.", "No mapped table", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            else if (mappedTables.Count > 1)
            {
                MessageBox.Show(this, "Multiple tables are mapped to this entity. 'Table per Hierarchy' inheritance requires exactly one mapped table.", "Too many mapped tables", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            UserControls.FormSubClassDiscriminator form = new UserControls.FormSubClassDiscriminator(Entity);
            form.ShowDialog(this);
            Populate();
        }
        private void ShowDiscriminatorForm()
        {
            var inheritanceType = EntityImpl.DetermineInheritanceTypeWithChildren(Entity);

            if (inheritanceType != EntityImpl.InheritanceType.TablePerSubClass &&
                inheritanceType != EntityImpl.InheritanceType.TablePerSubClassWithDiscriminator)
            {
                MessageBox.Show(this, "Invalid: only valid for Table Per Sub-Class inheritance.");
                return;
            }
            List<ArchAngel.Providers.EntityModel.Model.DatabaseLayer.ITable> mappedTables = Entity.MappedTables().ToList();

            if (mappedTables.Count == 0)
            {
                MessageBox.Show(this, "No tables are mapped to this entity. 'Table per Hierarchy' inheritance requires exactly one mapped table.", "No mapped table", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            else if (mappedTables.Count > 1)
            {
                MessageBox.Show(this, "Multiple tables are mapped to this entity. 'Table per Hierarchy' inheritance requires exactly one mapped table.", "Too many mapped tables", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            UserControls.FormSubClassDiscriminator form = new UserControls.FormSubClassDiscriminator(Entity);
            form.ShowDialog(this);
            Populate();
        }