Exemple #1
0
        /// <summary>
        /// Updates an instance obtained through copy constructor into database.
        /// </summary>
        ///
        public MovieExemplar Update()
        {
            VerifyUpdate();

            BaseRecord.SetFieldsFrom(this);

            Movie.MovieExemplars.OnUpdated(BaseRecord);

            return(BaseRecord);
        }
Exemple #2
0
        /// <summary>
        /// Updates an instance obtained through copy constructor into database.
        /// </summary>
        ///
        public Movie Update()
        {
            VerifyUpdate();

            BaseRecord.SetFieldsFrom(this);

            Database.Movies.OnUpdated(BaseRecord);

            foreach (MovieExemplar exemplar in MovieExemplars)
            {
                MovieExemplars.OnUpdated(exemplar, "Updated Movie");
            }

            return(BaseRecord);
        }
Exemple #3
0
        /// <summary>
        /// Updates an instance obtained through copy constructor into database.
        /// </summary>
        ///
        public Customer Update()
        {
            VerifyUpdate();

            Customer customerWithPID = Database.Customers.FindByPersID(PersonID);

            if (customerWithPID != null && customerWithPID != BaseRecord)
            {
                throw new ArgumentException("Customer #" + customerWithPID.ID
                                            + " (" + customerWithPID.FullName + ") already has PID " + PersonID);
            }

            BaseRecord.SetFieldsFrom(this);

            Database.Customers.OnUpdated(BaseRecord);

            return(BaseRecord);
        }