/// <summary> /// enable a specific relation /// /// </summary> /// <returns>void</returns> protected void EnableRelation(TTypedRelation ARelation) { DataTable Table1; DataTable Table2; Table1 = Tables[ARelation.FTable1]; Table2 = Tables[ARelation.FTable2]; if ((Table1 != null) && (Table2 != null)) { //MessageBox.Show("Enabling Relation: " + ARelation.FName + " (" + ARelation.FTable1.ToString() + "; " + ARelation.FTable2.ToString() + ")..."); //MessageBox.Show("Relation Keys: " + ARelation.FName + " (" + ARelation.FKey1[0].ToString() + "; " + ARelation.FKey2[0].ToString() + ")"); if ((!Relations.Contains(ARelation.FName))) { Relations.Add(ARelation.FName, GetDataColumnArrayFromString(Table1, ARelation.FKey1), // parentcolumn GetDataColumnArrayFromString(Table2, ARelation.FKey2), // childcolumn ARelation.FCreateConstraints); // MessageBox.Show("Enabled Relation: " + ARelation.FName + " (" + ARelation.FKey1.ToString() + "; " + ARelation.FKey2.ToString()); } } }
/// <summary> /// enable a specific relation /// /// </summary> /// <returns>void</returns> protected void EnableRelation(TTypedRelation ARelation) { DataTable Table1; DataTable Table2; Table1 = Tables[ARelation.FTable1]; Table2 = Tables[ARelation.FTable2]; if ((Table1 != null) && (Table2 != null)) { //MessageBox.Show("Enabling Relation: " + ARelation.FName + " (" + ARelation.FTable1.ToString() + "; " + ARelation.FTable2.ToString() + ")..."); //MessageBox.Show("Relation Keys: " + ARelation.FName + " (" + ARelation.FKey1[0].ToString() + "; " + ARelation.FKey2[0].ToString() + ")"); if ((!Relations.Contains(ARelation.FName))) { Relations.Add(ARelation.FName, GetDataColumnArrayFromString(Table1, ARelation.FKey1), // parentcolumn GetDataColumnArrayFromString(Table2, ARelation.FKey2), // childcolumn ARelation.FCreateConstraints); // MessageBox.Show("Enabled Relation: " + ARelation.FName + " (" + ARelation.FKey1.ToString() + "; " + ARelation.FKey2.ToString()); } } }