Exemplo n.º 1
0
 public Object UndefineAllValues(SQLTable myTable)
 {
     Object objTable = myTable.objTable;
     Type this_class = objTable.GetType();
     FieldInfo[] this_class_fields = this_class.GetFields();
     int i;
     int iCount = this_class_fields.Count();
     for (i = 0; i < iCount; i++)
     {
         object obj = this_class_fields[i].GetValue(objTable);
         if (DBTypes.DBtypesFunc.IsBasicType(obj))
         {
             try
             {
                 DBTypes.ValSet valset = (DBTypes.ValSet)obj;
                 valset.defined = false;
             }
             catch (Exception ex)
             {
                 LogFile.Error.Show("Error in UndefineAllValues:" + ex.Message);
             }
         }
         else
         {
             object objChildTable = this_class_fields[i].GetValue(objTable);
             SQLTable OutTbl;
             if (myTable.IsMyChildTable(out OutTbl, objChildTable.GetType()))
             {
                 foreach (Column col in myTable.Column)
                 {
                     if (col.fKey != null)
                     {
                         if (col.fKey.fTable.objTable.GetType() == objChildTable.GetType())
                         {
                             col.fKey.fTable.objTable = objChildTable;
                             col.fKey.fTable.pParentTable = myTable;
                         }
                     }
                 }
                 UndefineAllValues(OutTbl);
             }
         }
     }
     return myTable.objTable;
 }