コード例 #1
0
        public void Copy(LandListing newLandListing)
        {
            if (newLandListing == null)
            {
                throw new ArgumentNullException("newLandListing");
            }

            if (!newLandListing.IsModified)
            {
                return;
            }

            base.Copy(newLandListing);

            if (newLandListing.IsCategoryTypeModified)
            {
                CategoryType = newLandListing.CategoryType;
            }

            if (newLandListing.IsPricingModified)
            {
                if (newLandListing.Pricing == null)
                {
                    Pricing = null;
                }
                else
                {
                    if (Pricing == null)
                    {
                        Pricing = new SalePricing();
                    }

                    if (newLandListing.IsPricingModified)
                    {
                        Pricing.Copy(newLandListing.Pricing);
                    }

                    IsPricingModified = true;
                }
            }

            if (newLandListing.IsAuctionOnModified)
            {
                AuctionOn = newLandListing.AuctionOn;
            }

            if (newLandListing.IsEstateModified)
            {
                if (newLandListing.Estate == null)
                {
                    Estate = null;
                }
                else
                {
                    if (Estate == null)
                    {
                        Estate = new LandEstate();
                    }
                    Estate.Copy(newLandListing.Estate);
                    IsEstateModified = true;
                }
            }

            if (newLandListing.IsCouncilRatesModified)
            {
                CouncilRates = newLandListing.CouncilRates;
            }
        }