/// <summary>
        /// Saves the DojoBulkAttendanceEntry object state to the database.
        /// </summary>
        public int Save()
        {
            if (member != null)
            {
                member.Save();
            }
            if (rank != null)
            {
                rank.Save();
            }

            if (isSynced)
            {
                return(iD);
            }

            if (iD == -1)
            {
                throw (new Exception("Invalid record; cannot be saved."));
            }
            if (iD == 0)
            {
                iD = DojoBulkAttendanceEntryManager._insert(this);
            }
            else
            {
                DojoBulkAttendanceEntryManager._update(this);
            }
            isSynced = iD != -1;
            return(iD);
        }
        /// <summary>
        /// Duplicates DojoBulkAttendanceEntry object into a database; may or may not be the same database
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoBulkAttendanceEntry object reflecting the replicated DojoBulkAttendanceEntry object.</returns>
        public DojoBulkAttendanceEntry Duplicate()
        {
            DojoBulkAttendanceEntry clonedDojoBulkAttendanceEntry = this.Clone();

            // Insert must be called after children are replicated!
            clonedDojoBulkAttendanceEntry.iD       = DojoBulkAttendanceEntryManager._insert(clonedDojoBulkAttendanceEntry);
            clonedDojoBulkAttendanceEntry.isSynced = true;
            return(clonedDojoBulkAttendanceEntry);
        }