private void ApplyText(String AOtherFormTitle, String AOtherExplanation, PLocationRow ALocationRow)
        {
            PLocationTable LocationDT;

            if (AOtherExplanation != "")
            {
                lblExplainPartnerList1.Text = AOtherExplanation;
            }
            else
            {
                lblExplainPartnerList1.Text = Catalog.GetString("The following Partners also use this Partner's address.");
            }

            if (AOtherFormTitle != "")
            {
                this.Text = AOtherFormTitle;
            }
            else
            {
                this.Text = Catalog.GetString("Change Location for selected Partners");
            }

            /* Set up address lines display */
            LocationDT             = (PLocationTable)ALocationRow.Table;
            txtChangedAddress.Text =
                TSaveConvert.StringColumnToString(LocationDT.ColumnLocality, ALocationRow) + "\r\n" + TSaveConvert.StringColumnToString(
                    LocationDT.ColumnStreetName,
                    ALocationRow) + "\r\n" +
                TSaveConvert.StringColumnToString(LocationDT.ColumnAddress3, ALocationRow) + "\r\n" + TSaveConvert.StringColumnToString(
                    LocationDT.ColumnCity,
                    ALocationRow) + ' ' +
                TSaveConvert.StringColumnToString(LocationDT.ColumnPostalCode, ALocationRow) + "\r\n" + TSaveConvert.StringColumnToString(
                    LocationDT.ColumnCounty,
                    ALocationRow) + ' ' + TSaveConvert.StringColumnToString(LocationDT.ColumnCountryCode, ALocationRow);
        }
Esempio n. 2
0
        /// <summary>
        /// Copies over all columns of a Location Row, except the Primary Key columns
        /// and the last four columns (containing creation and change information).
        ///
        /// </summary>
        /// <param name="ACopyLocationsRow">Row to copy data from</param>
        /// <param name="ADestinationLocationsRow">Row to copy data to
        /// </param>
        /// <returns>void</returns>
        public static void CopyLocationData(PLocationRow ACopyLocationsRow, PLocationRow ADestinationLocationsRow)
        {
            ADestinationLocationsRow.Locality    = ACopyLocationsRow.Locality;
            ADestinationLocationsRow.StreetName  = ACopyLocationsRow.StreetName;
            ADestinationLocationsRow.Address3    = ACopyLocationsRow.Address3;
            ADestinationLocationsRow.City        = ACopyLocationsRow.City;
            ADestinationLocationsRow.PostalCode  = ACopyLocationsRow.PostalCode;
            ADestinationLocationsRow.County      = ACopyLocationsRow.County;
            ADestinationLocationsRow.CountryCode = ACopyLocationsRow.CountryCode;

            // Created/Modified info
            if (!ACopyLocationsRow.IsDateCreatedNull())
            {
                ADestinationLocationsRow.DateCreated = ACopyLocationsRow.DateCreated;
            }

            if (!ACopyLocationsRow.IsDateModifiedNull())
            {
                ADestinationLocationsRow.DateModified = ACopyLocationsRow.DateModified;
            }

            ADestinationLocationsRow.CreatedBy = TSaveConvert.StringColumnToString(((PLocationTable)ACopyLocationsRow.Table).ColumnCreatedBy,
                                                                                   ACopyLocationsRow);
            ADestinationLocationsRow.ModifiedBy = TSaveConvert.StringColumnToString(((PLocationTable)ACopyLocationsRow.Table).ColumnModifiedBy,
                                                                                    ACopyLocationsRow);
            ADestinationLocationsRow.ModificationId = ACopyLocationsRow.ModificationId;
        }
Esempio n. 3
0
        /// <summary>
        /// Returns the Family Members of a Family.
        /// </summary>
        /// <param name="AFamilyPartnerKey">PartnerKey of the FAMILY.</param>
        /// <param name="AReadTransaction">Open DB Transaction.</param>
        /// <returns>An Instance of <see cref="PartnerInfoTDSFamilyMembersTable" />.
        /// If there were Family Members, there will be one DataRow for each Family Member.</returns>
        private static PartnerInfoTDSFamilyMembersTable GetFamilyMembers(Int64 AFamilyPartnerKey,
                                                                         TDBTransaction AReadTransaction)
        {
            OdbcParameter[] ParametersArray;
            DataSet         TmpDS;
            PPersonTable    FamilyPersonsDT;
            PartnerInfoTDSFamilyMembersRow   NewRow;
            PartnerInfoTDSFamilyMembersTable FamilyMembersDT;

            FamilyMembersDT = new PartnerInfoTDSFamilyMembersTable();

            ParametersArray          = new OdbcParameter[1];
            ParametersArray[0]       = new OdbcParameter("", OdbcType.Decimal, 10);
            ParametersArray[0].Value = (System.Object)AFamilyPartnerKey;

            TmpDS = new DataSet();

            FamilyPersonsDT = new PPersonTable();
            TmpDS.Tables.Add(FamilyPersonsDT);

            AReadTransaction.DataBaseObj.Select(TmpDS,
                                                "SELECT " + "PUB_" + PPartnerTable.GetTableDBName() + '.' +
                                                PPartnerTable.GetPartnerKeyDBName() + ", " +
                                                PPersonTable.GetFamilyNameDBName() + ", " +
                                                PPersonTable.GetTitleDBName() + ", " +
                                                PPersonTable.GetFirstNameDBName() + ", " +
                                                PPersonTable.GetMiddleName1DBName() + ", " +
                                                PPersonTable.GetFamilyIdDBName() + ' ' +
                                                "FROM PUB_" + PPersonTable.GetTableDBName() +
                                                " INNER JOIN " + "PUB_" + PPartnerTable.GetTableDBName() + " ON " +
                                                "PUB_" + PPersonTable.GetTableDBName() + '.' +
                                                PPartnerTable.GetPartnerKeyDBName() + " = " +
                                                "PUB_" + PPartnerTable.GetTableDBName() + '.' +
                                                PPartnerTable.GetPartnerKeyDBName() + ' ' +
                                                "WHERE " + PPersonTable.GetFamilyKeyDBName() + " = ? " +
                                                "AND " + PPartnerTable.GetStatusCodeDBName() + " <> '" +
                                                SharedTypes.StdPartnerStatusCodeEnumToString(TStdPartnerStatusCode.spscMERGED) + "' " + // Make sure we don't load MERGED Partners (shouldn't have a p_family_key_n, but just in case.)
                                                "ORDER BY " + PPersonTable.GetFamilyIdDBName() + " ASC",
                                                PPersonTable.GetTableName(), AReadTransaction, ParametersArray, 0, 0);

            // Add Persons to Table
            for (Int32 Counter = 0; Counter <= FamilyPersonsDT.Rows.Count - 1; Counter += 1)
            {
                NewRow                  = FamilyMembersDT.NewRowTyped(false);
                NewRow.PartnerKey       = FamilyPersonsDT[Counter].PartnerKey;
                NewRow.PartnerShortName =
                    Calculations.DeterminePartnerShortName(TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnFamilyName,
                                                                                             FamilyPersonsDT[Counter]), TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnTitle,
                                                                                                                                                          FamilyPersonsDT[Counter]), TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnFirstName,
                                                                                                                                                                                                                       FamilyPersonsDT[Counter]),
                                                           TSaveConvert.StringColumnToString(FamilyPersonsDT.ColumnMiddleName1, FamilyPersonsDT[Counter]));
                NewRow.FamilyId = FamilyPersonsDT[Counter].FamilyId;

                FamilyMembersDT.Rows.Add(NewRow);
            }

            return(FamilyMembersDT);
        }