예제 #1
0
        /// <summary> Returns true if the master is set up (see IsMasterSetup()), and there is a value for each of the master's columns (or WriteWhereClause is true). </summary>
        public override bool IsMasterValid()
        {
            if (IsMasterSetup())
            {
                TableDataSet dataSet       = MasterSource.DataSet as TableDataSet;
                bool         isMasterValid = (dataSet == null) || (!dataSet.IsDetail() || dataSet.IsMasterValid());
                if (isMasterValid && !MasterSource.DataSet.IsEmpty())
                {
                    if (!WriteWhereClause)                     // If the where clause is custom, allow nil master values
                    {
                        return(true);
                    }

                    foreach (DAE.Schema.TableVarColumn column in MasterKey.Columns)
                    {
                        if (!(MasterSource.DataSet.Fields[column.Name].HasValue()))
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
            }
            return(false);
        }
예제 #2
0
 /// <summary> Returns true if the master is set up (see IsMasterSetup()), and there is a value for each of the master's columns. </summary>
 public virtual bool IsMasterValid()
 {
     if (IsMasterSetup())
     {
         TableDataSet dataSet       = MasterSource.DataSet as TableDataSet;
         bool         isMasterValid = (dataSet == null) || (!dataSet.IsDetail() || dataSet.IsMasterValid());
         if (isMasterValid && !MasterSource.DataSet.IsEmpty())
         {
             foreach (DAE.Schema.TableVarColumn column in _masterKey.Columns)
             {
                 if (!(MasterSource.DataSet.Fields[column.Name].HasValue()))
                 {
                     return(false);
                 }
             }
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
 public MasterDataLink(TableDataSet dataSet)
 {
     _detailDataSet = dataSet;
 }