Exemple #1
0
        public RefBTAttribute(RefBLAttribute blAttribute, BTInterface ifa)
        {
            this.blAttribute         = blAttribute;
            this.refBLAttribute      = blAttribute;
            this.otherBlAttribute    = null;
            this.ParentInterface     = ifa;
            this.IsIdentity          = blAttribute.IsIdentity;
            this.IsPartOfUniqueKey   = blAttribute.IsPartOfUniqueKey;
            this.HasToUseVerionTable = GetHasToUseVersionTable();

            if (HasToUseVerionTable)
            {
                // Wenn das aktuelle Interface keine FactTable ist und beide eine Historie haben,
                // dann wird die Beziehung über die Historientabellen aufgelöst
                var blModel = blAttribute.ParentInterface.ParentModel;
                this.ReferencedBLInterface = blModel.Interfaces.Single(i => i.Name == blAttribute.ReferencedAttribute.ParentInterface.Name + "_VERSION");
                this.ReferencedBLAttribute = this.ReferencedBLInterface.Attributes.Single(a => a.IsPartOfUniqueKey && !a.IsTechnicalAttribute && a.Name != "Mandant_KNZ");
            }
            else
            {
                // ansonsten wird die Tabelle ohne Historie verwendet.
                this.ReferencedBLAttribute = blAttribute.ReferencedAttribute;
                this.ReferencedBLInterface = blAttribute.ReferencedAttribute.ParentInterface;
            }

            this.IdAttribute  = new IdSubAttribute(this);
            this.KnzAttribute = new KnzSubAttribute(this);
        }
Exemple #2
0
        ///
        /// Wichtig: nur in BT zur Abbildung der History-Beziehung nutzen!
        ///
        internal RefBTAttribute(BaseBLAttribute blAttribute, IBLInterface blIfa, BTInterface ifa)
        {
            this.blAttribute         = blAttribute;
            this.refBLAttribute      = null;
            this.otherBlAttribute    = blAttribute;
            this.ParentInterface     = ifa;
            this.IsIdentity          = otherBlAttribute.IsIdentity;
            this.IsPartOfUniqueKey   = otherBlAttribute.IsPartOfUniqueKey;
            this.HasToUseVerionTable = false; // TODO: Das ist noch nicht sicher !

            var blModel = blAttribute.ParentInterface.ParentModel;

            this.ReferencedBLInterface = blIfa;
            this.ReferencedBLAttribute = blIfa.Attributes.Single(a => a.IsPartOfUniqueKey && (a is BaseBLAttribute));

            this.IdAttribute  = new IdSubAttribute(this);
            this.KnzAttribute = new KnzSubAttribute(this);
        }
Exemple #3
0
 public BaseBTAttribute(CustomBLAttribute blAttribute, BTInterface ifa)
 {
     this.blAttribute     = blAttribute;
     this.ParentInterface = ifa;
     SetName();
 }
Exemple #4
0
 public BaseBTAttribute(string name, BaseBLAttribute blAttribute, BTInterface ifa)
 {
     this.blAttribute     = blAttribute;
     this.ParentInterface = ifa;
     Name = name;
 }