Ejemplo n.º 1
0
        /// <summary>
        /// enable a specific constraint
        ///
        /// </summary>
        /// <returns>void</returns>
        public void EnableConstraint(TTypedConstraint AConstraint)
        {
            DataTable Table1;
            DataTable Table2;

            Table1 = Tables[AConstraint.FTable1];
            Table2 = Tables[AConstraint.FTable2];

            if ((Table1 != null) && (Table2 != null))
            {
                if ((!Table2.Constraints.Contains(AConstraint.FName)))
                {
                    if ((Table1.Rows.Count != 0) && (Table2.Rows.Count != 0) || (Table1.Rows.Count == 0) && (Table2.Rows.Count == 0))
                    {
                    }

                    // ADDING OF CONSTRAINTS TEMPORARILY DISABLED TO BE ABLE TO TRANSFER PCHURCH AND PORGANISTAION TYPED TABLES...
                    // Table2.Constraints.Add(AConstraint.FName,
                    // GetDataColumnArrayFromString(Table1, AConstraint.FKey1),
                    // GetDataColumnArrayFromString(Table2, AConstraint.FKey2));
                }
                else
                {
                    // the constraint exists; does it need to be disabled?
                    if (!((Table1.Rows.Count != 0) && (Table2.Rows.Count != 0) || (Table1.Rows.Count == 0) && (Table2.Rows.Count == 0)))
                    {
                        Table2.Constraints.Remove(AConstraint.FName);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// enable a specific constraint
        ///
        /// </summary>
        /// <returns>void</returns>
        public void EnableConstraint(TTypedConstraint AConstraint)
        {
            DataTable Table1;
            DataTable Table2;

            Table1 = Tables[AConstraint.FTable1];
            Table2 = Tables[AConstraint.FTable2];

            if ((Table1 != null) && (Table2 != null))
            {
                if ((!Table2.Constraints.Contains(AConstraint.FName)))
                {
                    if ((Table1.Rows.Count != 0) && (Table2.Rows.Count != 0) || (Table1.Rows.Count == 0) && (Table2.Rows.Count == 0))
                    {
                    }

                    // ADDING OF CONSTRAINTS TEMPORARILY DISABLED TO BE ABLE TO TRANSFER PCHURCH AND PORGANISTAION TYPED TABLES...
                    // Table2.Constraints.Add(AConstraint.FName,
                    // GetDataColumnArrayFromString(Table1, AConstraint.FKey1),
                    // GetDataColumnArrayFromString(Table2, AConstraint.FKey2));
                }
                else
                {
                    // the constraint exists; does it need to be disabled?
                    if (!((Table1.Rows.Count != 0) && (Table2.Rows.Count != 0) || (Table1.Rows.Count == 0) && (Table2.Rows.Count == 0)))
                    {
                        Table2.Constraints.Remove(AConstraint.FName);
                    }
                }
            }
        }