示例#1
0
        /// <summary>
        /// Update extra location specific fields in DataRow APartnerLocationDR
        /// </summary>
        /// <param name="ALocationDT">Table containing location records to be used to update APartnerLocation records.</param>
        /// <param name="APartnerLocationDR">Single DataRow to be updated with Location specific information.</param>
        /// <param name="AMakePLocationRecordUnchanged">Set to true to make the PLocation Record unchanged
        /// (by calling .AcceptChanges() on it).</param>
        public static void SyncPartnerEditTDSPartnerLocation(PLocationTable ALocationDT, PartnerEditTDSPPartnerLocationRow APartnerLocationDR,
                                                             bool AMakePLocationRecordUnchanged = false)
        {
            DataRow      Row;
            PLocationRow LocationRow;

            if (APartnerLocationDR.RowState != DataRowState.Deleted)
            {
                Row = ALocationDT.Rows.Find(new Object[] { APartnerLocationDR.SiteKey, APartnerLocationDR.LocationKey });

                if (Row != null)
                {
                    LocationRow = (PLocationRow)Row;

                    APartnerLocationDR.LocationLocality    = LocationRow.Locality;
                    APartnerLocationDR.LocationStreetName  = LocationRow.StreetName;
                    APartnerLocationDR.LocationAddress3    = LocationRow.Address3;
                    APartnerLocationDR.LocationCity        = LocationRow.City;
                    APartnerLocationDR.LocationCounty      = LocationRow.County;
                    APartnerLocationDR.LocationPostalCode  = LocationRow.PostalCode;
                    APartnerLocationDR.LocationCountryCode = LocationRow.CountryCode;

                    APartnerLocationDR.LocationCreatedBy = LocationRow.CreatedBy;

                    if (!LocationRow.IsDateCreatedNull())
                    {
                        APartnerLocationDR.LocationDateCreated = (DateTime)LocationRow.DateCreated;
                    }

                    APartnerLocationDR.LocationModifiedBy = LocationRow.ModifiedBy;

                    if (!LocationRow.IsDateModifiedNull())
                    {
                        APartnerLocationDR.LocationDateModified = (DateTime)LocationRow.DateModified;
                    }

                    if (AMakePLocationRecordUnchanged)
                    {
                        Row.AcceptChanges();
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// Update extra location specific fields in table APartnerLocationTable
        /// </summary>
        /// <param name="ALocationTable">Table containing location records to be used to update APartnerLocation records</param>
        /// <param name="APartnerLocationTable">Table to be updated with Location specific information</param>
        /// <returns></returns>
        public static void SyncPartnerEditTDSPartnerLocation(PLocationTable ALocationTable, PartnerEditTDSPPartnerLocationTable APartnerLocationTable)
        {
            DataRow      Row;
            PLocationRow LocationRow;

            foreach (PartnerEditTDSPPartnerLocationRow PartnerLocationRow in APartnerLocationTable.Rows)
            {
                Row = ALocationTable.Rows.Find(new Object[] { PartnerLocationRow.SiteKey, PartnerLocationRow.LocationKey });

                if (Row != null)
                {
                    LocationRow = (PLocationRow)Row;

                    PartnerLocationRow.LocationLocality    = LocationRow.Locality;
                    PartnerLocationRow.LocationStreetName  = LocationRow.StreetName;
                    PartnerLocationRow.LocationAddress3    = LocationRow.Address3;
                    PartnerLocationRow.LocationCity        = LocationRow.City;
                    PartnerLocationRow.LocationCounty      = LocationRow.County;
                    PartnerLocationRow.LocationPostalCode  = LocationRow.PostalCode;
                    PartnerLocationRow.LocationCountryCode = LocationRow.CountryCode;

                    PartnerLocationRow.LocationCreatedBy = LocationRow.CreatedBy;

                    if (!LocationRow.IsDateCreatedNull())
                    {
                        PartnerLocationRow.LocationDateCreated = (DateTime)LocationRow.DateCreated;
                    }

                    PartnerLocationRow.LocationModifiedBy = LocationRow.ModifiedBy;

                    if (!LocationRow.IsDateModifiedNull())
                    {
                        PartnerLocationRow.LocationDateModified = (DateTime)LocationRow.DateModified;
                    }
                }
            }
        }
 public LocationRowChangeEvent(LocationRow row, global::System.Data.DataRowAction action)
 {
     this.eventRow    = row;
     this.eventAction = action;
 }