Exemple #1
0
 internal int GetDefaultRecord()
 {
     if (this.tempRecord != -1)
     {
         return(this.tempRecord);
     }
     if (this.newRecord != -1)
     {
         return(this.newRecord);
     }
     if (this.oldRecord == -1)
     {
         throw ExceptionBuilder.RowRemovedFromTheTable();
     }
     throw ExceptionBuilder.DeletedRowInaccessible();
 }
Exemple #2
0
        /// <include file='doc\DataRow.uex' path='docs/doc[@for="DataRow.BeginEdit"]/*' />
        /// <devdoc>
        /// <para>Begins an edit operation on a <see cref='System.Data.DataRow'/>object.</para>
        /// </devdoc>
        public void BeginEdit()
        {
            if (inChangingEvent)
            {
                throw ExceptionBuilder.BeginEditInRowChanging();
            }

            if (tempRecord != -1)
            {
                return;
            }

            if (oldRecord != -1 && newRecord == -1)
            {
                throw ExceptionBuilder.DeletedRowInaccessible();
            }

            tempRecord = Table.NewRecord(newRecord);
        }
Exemple #3
0
 internal int GetDefaultRecord()
 {
     if (tempRecord != -1)
     {
         return(tempRecord);
     }
     if (newRecord != -1)
     {
         return(newRecord);
     }
     // If row has oldRecord - this is deleted row.
     if (oldRecord == -1)
     {
         throw ExceptionBuilder.RowRemovedFromTheTable();
     }
     else
     {
         throw ExceptionBuilder.DeletedRowInaccessible();
     }
 }
Exemple #4
0
 private bool BeginEditInternal()
 {
     if (this.inChangingEvent)
     {
         throw ExceptionBuilder.BeginEditInRowChanging();
     }
     if (this.tempRecord != -1)
     {
         if (this.tempRecord < this._table.recordManager.LastFreeRecord)
         {
             return(false);
         }
         this.tempRecord = -1;
     }
     if ((this.oldRecord != -1) && (this.newRecord == -1))
     {
         throw ExceptionBuilder.DeletedRowInaccessible();
     }
     this.ResetLastChangedColumn();
     this.tempRecord = this._table.NewRecord(this.newRecord);
     return(true);
 }