当前位置: 首页>>代码示例>>C#>>正文


C# PartnerEditTDS类代码示例

本文整理汇总了C#中PartnerEditTDS的典型用法代码示例。如果您正苦于以下问题:C# PartnerEditTDS类的具体用法?C# PartnerEditTDS怎么用?C# PartnerEditTDS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PartnerEditTDS类属于命名空间,在下文中一共展示了PartnerEditTDS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VerifyUnitData

        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="e"></param>
        /// <param name="AMainDS"></param>
        /// <param name="AVerificationResult"></param>
        /// <returns></returns>
        public static Boolean VerifyUnitData(DataColumnChangeEventArgs e, PartnerEditTDS AMainDS, out TVerificationResult AVerificationResult)
        {
            Boolean ReturnValue;

            AVerificationResult = null;

            if (e.Column.ColumnName == PUnitTable.GetUnitNameDBName())
            {
                VerifyUnitNameChange(e, AMainDS, out AVerificationResult);
            }

            // any verification errors?
            if (AVerificationResult == null)
            {
                ReturnValue = true;
            }
            else
            {
                ReturnValue = false;

                // MessageBox.Show('VerifyUnitData: There was an error!');
            }

            return ReturnValue;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:32,代码来源:UC_PartnerEdit_CollapsiblePart.cs

示例2: UpdateGiftDestination

        /// <summary>
        /// Gives the user the option to update Gift Destination records if commitments have been added
        /// </summary>
        /// <param name="AInspectDS"></param>
        public bool UpdateGiftDestination(ref PartnerEditTDS AInspectDS)
        {
            PmStaffDataTable EligibleCommitments = new PmStaffDataTable();

            FIndividualDataDS = new IndividualDataTDS();
            FInspectDS = AInspectDS;

            FIndividualDataDS.Merge(AInspectDS);

            // return if no changes have been made to commitments
            if ((FIndividualDataDS.PmStaffData == null) || (FIndividualDataDS.PmStaffData.Rows.Count == 0))
            {
                return false;
            }

            // load original (currently saved) PmStaffData
            FOriginalCommitments = TRemote.MPersonnel.WebConnectors.LoadPersonellStaffData(AInspectDS.PPartner[0].PartnerKey).PmStaffData;

            if (!GetEligibleRowsForUpdatingGiftDestination(ref EligibleCommitments))
            {
                // no eligible records
                return false;
            }

            // iterate through each eligible row
            foreach (PmStaffDataRow EligibleCommitmentRow in EligibleCommitments.Rows)
            {
                UpdateGiftDestinationForSingleCommitment(EligibleCommitmentRow);
            }

            return true;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:36,代码来源:PartnerEdit.GiftDestination.ManualCode.cs

示例3: GetPartnerDetails

        public static PartnerEditTDS GetPartnerDetails(Int64 APartnerKey, bool AWithAddressDetails, bool AWithSubscriptions, bool AWithRelationships)
        {
            PartnerEditTDS MainDS = new PartnerEditTDS();

            TDBTransaction Transaction = null;

            DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.ReadCommitted, ref Transaction,
                delegate
                {
                    PPartnerAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);

                    if (MainDS.PPartner.Rows.Count > 0)
                    {
                        switch (MainDS.PPartner[0].PartnerClass)
                        {
                            case MPartnerConstants.PARTNERCLASS_FAMILY:
                                PFamilyAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
                                break;

                            case MPartnerConstants.PARTNERCLASS_PERSON:
                                PPersonAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
                                break;

                            case MPartnerConstants.PARTNERCLASS_CHURCH:
                                PChurchAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
                                break;

                            case MPartnerConstants.PARTNERCLASS_ORGANISATION:
                                POrganisationAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
                                break;
                        }

                        if (AWithAddressDetails)
                        {
                            PPartnerLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                            PLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
                        }

                        if (AWithRelationships)
                        {
                            PPartnerRelationshipAccess.LoadViaPPartnerPartnerKey(MainDS, APartnerKey, Transaction);
                        }

                        if (AWithSubscriptions)
                        {
                            PSubscriptionAccess.LoadViaPPartnerPartnerKey(MainDS, APartnerKey, Transaction);
                        }
                    }
                });

            return MainDS;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:52,代码来源:SimplePartnerEdit.cs

示例4: PostInitUserControl

        /// <summary>todoComment</summary>
        public void PostInitUserControl(PartnerEditTDS AMainDS)
        {
            // exchanges instead of Icon=1 we get Icon=2
            FMainDS.PPartnerLocation.ColumnIconForSort.Expression = "IIF(Icon = 1, 2, IIF(Icon = 2, 1, 3))";

            // introduce sorting -> override DefaultView that was set in earlier methods
            DataView myDataView = new DataView(FMainDS.PPartnerLocation, "",
                PartnerEditTDSPPartnerLocationTable.GetIconForSortDBName() + " ASC, " +
                PartnerEditTDSPPartnerLocationTable.GetDateEffectiveDBName() +
                " DESC", DataViewRowState.CurrentRows);
            myDataView.AllowNew = false;
            grdDetails.DataSource = new DevAge.ComponentModel.BoundDataView(myDataView);
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:14,代码来源:UC_PartnerAddresses.ManualCode.cs

示例5: CreateNewFamilyPartner

        /// create a new family
        public static PPartnerRow CreateNewFamilyPartner(PartnerEditTDS AMainDS)
        {
            PPartnerRow PartnerRow = CreateNewPartner(AMainDS);

            PartnerRow.PartnerClass = MPartnerConstants.PARTNERCLASS_FAMILY;
            PartnerRow.PartnerShortName = PartnerRow.PartnerKey.ToString() + ", TestPartner, Mr";

            PFamilyRow FamilyRow = AMainDS.PFamily.NewRowTyped();
            FamilyRow.PartnerKey = PartnerRow.PartnerKey;
            FamilyRow.FamilyName = PartnerRow.PartnerKey.ToString();
            FamilyRow.FirstName = "TestPartner";
            FamilyRow.Title = "Mr";
            AMainDS.PFamily.Rows.Add(FamilyRow);

            return PartnerRow;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:17,代码来源:CreateTestPartnerData.cs

示例6: InitializeManualCode

        private void InitializeManualCode()
        {
            // show this dialog in center of screen
            this.StartPosition = FormStartPosition.CenterScreen;

            FMainDS = new PartnerEditTDS();

            // now add the one subscription row to the DS that we are working with
            PSubscriptionTable SubscriptionTable = new PSubscriptionTable();
            FMainDS.Merge(SubscriptionTable);
            PSubscriptionRow SubscriptionRow = FMainDS.PSubscription.NewRowTyped(true);
            SubscriptionRow.PublicationCode = ""; // avoid NOT NULL error message
            FMainDS.PSubscription.Rows.Add(SubscriptionRow);

            ucoSubscription.MainDS = FMainDS;
            ucoSubscription.SpecialInitUserControl();
            FPetraUtilsObject.HasChanges = false;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:18,代码来源:UpdateExtractAddSubscriptionDialog.ManualCode.cs

示例7: InitializeManualCode

        private void InitializeManualCode()
        {
            // show this dialog in center of screen
            this.StartPosition = FormStartPosition.CenterScreen;

            FMainDS = new PartnerEditTDS();

            // now add the one subscription row to the DS that we are working with
            PContactLogTable ContactLogTable = new PContactLogTable();
            FMainDS.Merge(ContactLogTable);
            PContactLogRow ContactLogRow = FMainDS.PContactLog.NewRowTyped(true);
            ContactLogRow.ContactCode = "";
            FMainDS.PContactLog.Rows.Add(ContactLogRow);

            ucoContactLog.MainDS = FMainDS;
            ucoContactLog.SpecialInitUserControl();
            FPetraUtilsObject.HasChanges = false;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:18,代码来源:UpdateExtractAddContactLogDialog.ManualCode.cs

示例8: CreateNewPartner

        /// create a new partner
        public static PPartnerRow CreateNewPartner(PartnerEditTDS AMainDS)
        {
            PPartnerRow PartnerRow = AMainDS.PPartner.NewRowTyped();

            // get a new partner key
            Int64 newPartnerKey = -1;

            do
            {
                newPartnerKey = TNewPartnerKey.GetNewPartnerKey(DomainManager.GSiteKey);
                TNewPartnerKey.SubmitNewPartnerKey(DomainManager.GSiteKey, newPartnerKey, ref newPartnerKey);
                PartnerRow.PartnerKey = newPartnerKey;
            } while (newPartnerKey == -1);

            PartnerRow.StatusCode = MPartnerConstants.PARTNERSTATUS_ACTIVE;

            AMainDS.PPartner.Rows.Add(PartnerRow);

            TLogging.Log("Creating new partner: " + PartnerRow.PartnerKey.ToString());

            return PartnerRow;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:23,代码来源:CreateTestPartnerData.cs

示例9: CreateFamilyWithTwoPersonRecords

        /// create a new family with two persons
        public static void CreateFamilyWithTwoPersonRecords(PartnerEditTDS AMainDS)
        {
            PPartnerRow PartnerRow = CreateNewFamilyPartner(AMainDS);

            CreateNewLocation(PartnerRow.PartnerKey, AMainDS);

            CreateNewPerson(AMainDS,
                PartnerRow.PartnerKey,
                AMainDS.PLocation[0].LocationKey,
                "Adam",
                "Mr",
                0);
            CreateNewPerson(AMainDS,
                PartnerRow.PartnerKey,
                AMainDS.PLocation[0].LocationKey,
                "Eve",
                "Mrs",
                1);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:20,代码来源:CreateTestPartnerData.cs

示例10: CreateNewLocation

        /// create a new location
        public static void CreateNewLocation(Int64 APartnerKey, PartnerEditTDS AMainDS)
        {
            // avoid duplicate addresses: StreetName contains the partner key
            PLocationRow LocationRow = AMainDS.PLocation.NewRowTyped();

            LocationRow.SiteKey = DomainManager.GSiteKey;
            LocationRow.LocationKey = -1;
            LocationRow.StreetName = APartnerKey.ToString() + " Nowhere Lane";
            LocationRow.PostalCode = "LO2 2CX";
            LocationRow.City = "London";
            LocationRow.CountryCode = "99";
            AMainDS.PLocation.Rows.Add(LocationRow);

            PPartnerLocationRow PartnerLocationRow = AMainDS.PPartnerLocation.NewRowTyped();
            PartnerLocationRow.SiteKey = LocationRow.SiteKey;
            PartnerLocationRow.PartnerKey = APartnerKey;
            PartnerLocationRow.LocationKey = LocationRow.LocationKey;
            AMainDS.PPartnerLocation.Rows.Add(PartnerLocationRow);
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:20,代码来源:CreateTestPartnerData.cs

示例11: TestDeleteOrganisation

        public void TestDeleteOrganisation()
        {
            DataSet ResponseDS = new PartnerEditTDS();
            TVerificationResultCollection VerificationResult;
            String TextMessage;
            Boolean CanDeletePartner;
            PPartnerRow OrganisationPartnerRow;
            TSubmitChangesResult result;
            Int64 PartnerKey;

            TPartnerEditUIConnector connector = new TPartnerEditUIConnector();

            PartnerEditTDS MainDS = new PartnerEditTDS();

            OrganisationPartnerRow = TCreateTestPartnerData.CreateNewOrganisationPartner(MainDS);
            result = connector.SubmitChanges(ref MainDS, ref ResponseDS, out VerificationResult);
            Assert.AreEqual(TSubmitChangesResult.scrOK, result, "create organisation record");

            // check if organisation partner can be deleted (still needs to be possible at this point)
            CanDeletePartner = TPartnerWebConnector.CanPartnerBeDeleted(OrganisationPartnerRow.PartnerKey, out TextMessage);

            if (TextMessage.Length > 0)
            {
                TLogging.Log(TextMessage);
            }

            Assert.IsTrue(CanDeletePartner);

            // now test actual deletion of Organisation partner
            PartnerKey = OrganisationPartnerRow.PartnerKey;
            Assert.IsTrue(TPartnerWebConnector.DeletePartner(PartnerKey, out VerificationResult));

            // check that Organisation record is really deleted
            Assert.IsTrue(!TPartnerServerLookups.VerifyPartner(PartnerKey));
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:35,代码来源:TestPartnerEdit.cs

示例12: CreateNewVenuePartner

        /// create a new venue
        public static PPartnerRow CreateNewVenuePartner(PartnerEditTDS AMainDS)
        {
            PPartnerRow PartnerRow = CreateNewPartner(AMainDS);

            PartnerRow.PartnerClass = MPartnerConstants.PARTNERCLASS_VENUE;
            PartnerRow.PartnerShortName = PartnerRow.PartnerKey.ToString() + ", TestVenue";

            PVenueRow VenueRow = AMainDS.PVenue.NewRowTyped();
            VenueRow.PartnerKey = PartnerRow.PartnerKey;
            VenueRow.VenueCode = "TEST" + PartnerRow.PartnerKey.ToString();
            VenueRow.VenueName = "TestVenue" + PartnerRow.PartnerKey.ToString();
            AMainDS.PVenue.Rows.Add(VenueRow);

            return PartnerRow;
        }
开发者ID:Davincier,项目名称:openpetra,代码行数:16,代码来源:CreateTestPartnerData.cs

示例13: GenerateAddressForFamily

        /// <summary>
        /// create PPartnerLocation records for the FAMILY partner, and all the PERSON records of this family
        /// </summary>
        public static void GenerateAddressForFamily(XmlNode ACurrentNode, PFamilyRow AFamilyRow, PartnerEditTDS AMainDS)
        {
            PLocationRow locationRow = AMainDS.PLocation.NewRowTyped();

            locationRow.SiteKey = 0; // DomainManager.GSiteKey;
            locationRow.LocationKey = (AMainDS.PLocation.Count + 1) * -1;
            locationRow.StreetName = TXMLParser.GetAttribute(ACurrentNode, "Addr2");
            locationRow.PostalCode = TXMLParser.GetAttribute(ACurrentNode, "PostCode");
            locationRow.City = TXMLParser.GetAttribute(ACurrentNode, "City");
            locationRow.County = TXMLParser.GetAttribute(ACurrentNode, "Province");
            locationRow.CountryCode = TXMLParser.GetAttribute(ACurrentNode, "CountryCode");

            AMainDS.PLocation.Rows.Add(locationRow);

            PPartnerLocationRow familyLocationRow = AMainDS.PPartnerLocation.NewRowTyped();

            familyLocationRow.PartnerKey = AFamilyRow.PartnerKey;
            familyLocationRow.LocationKey = locationRow.LocationKey;
            familyLocationRow.SiteKey = locationRow.SiteKey;
            familyLocationRow.LocationType = MPartnerConstants.LOCATIONTYPE_HOME;
            familyLocationRow.SendMail = true;

            AMainDS.PPartnerLocation.Rows.Add(familyLocationRow);

            DataView FamilyView = new DataView(AMainDS.PPerson);
            FamilyView.RowFilter = PPersonTable.GetFamilyKeyDBName() + " = " + AFamilyRow.PartnerKey.ToString();
            FamilyView.Sort = PPersonTable.GetFamilyIdDBName();

            // for each person, also create a location record
            for (int countPerson = 0; countPerson < FamilyView.Count; countPerson++)
            {
                PPersonRow personRow = (PPersonRow)FamilyView[countPerson].Row;

                PPartnerLocationRow personLocationRow = AMainDS.PPartnerLocation.NewRowTyped();
                personLocationRow.PartnerKey = personRow.PartnerKey;
                personLocationRow.LocationKey = familyLocationRow.LocationKey;
                personLocationRow.SiteKey = familyLocationRow.SiteKey;
                personLocationRow.LocationType = MPartnerConstants.LOCATIONTYPE_HOME;
                personLocationRow.SendMail = true;
                AMainDS.PPartnerLocation.Rows.Add(personLocationRow);

                string prefix = "Male";

                if (countPerson == 1)
                {
                    prefix = "Female";
                }
                else if (countPerson > 1)
                {
                    prefix = "Child" + (countPerson - 1).ToString();
                }

                personLocationRow.EmailAddress = TXMLParser.GetAttribute(ACurrentNode, prefix + "Email");

                // set email of first person for whole family
                if (countPerson == 0)
                {
                    familyLocationRow.EmailAddress = personLocationRow.EmailAddress;
                }
            }
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:64,代码来源:GenerateWorkers.cs

示例14: GenerateBankDetails

        /// <summary>
        /// create PPartnerBankingDetail records for the FAMILY partner
        /// </summary>
        public static void GenerateBankDetails(XmlNode ACurrentNode, PFamilyRow AFamilyRow, PartnerEditTDS AMainDS,
            DataTable ABankKeys)
        {
            if (TXMLParser.HasAttribute(ACurrentNode, "bankaccount_bank"))
            {
                Int32 BankID =
                    Convert.ToInt32(TXMLParser.GetAttribute(ACurrentNode, "bankaccount_bank")) % ABankKeys.Rows.Count;
                long BankPartnerKey = Convert.ToInt64(ABankKeys.Rows[BankID].ItemArray[0]);

                PBankingDetailsRow bankingDetailsRow = AMainDS.PBankingDetails.NewRowTyped();

                bankingDetailsRow.BankingDetailsKey = (AMainDS.PBankingDetails.Rows.Count + 1) * -1;
                bankingDetailsRow.BankKey = BankPartnerKey;
                bankingDetailsRow.BankAccountNumber = TXMLParser.GetAttribute(ACurrentNode, "bankaccount_account");
                bankingDetailsRow.BankingType = MPartnerConstants.BANKINGTYPE_BANKACCOUNT;
                bankingDetailsRow.AccountName = AFamilyRow.FirstName + " " + AFamilyRow.FamilyName;

                AMainDS.PBankingDetails.Rows.Add(bankingDetailsRow);

                PPartnerBankingDetailsRow partnerBankingRow = AMainDS.PPartnerBankingDetails.NewRowTyped();
                partnerBankingRow.PartnerKey = AFamilyRow.PartnerKey;
                partnerBankingRow.BankingDetailsKey = bankingDetailsRow.BankingDetailsKey;
                AMainDS.PPartnerBankingDetails.Rows.Add(partnerBankingRow);

                PBankingDetailsUsageRow bankingUsageRow = AMainDS.PBankingDetailsUsage.NewRowTyped();
                bankingUsageRow.BankingDetailsKey = bankingDetailsRow.BankingDetailsKey;
                bankingUsageRow.PartnerKey = AFamilyRow.PartnerKey;
                bankingUsageRow.Type = MPartnerConstants.BANKINGUSAGETYPE_MAIN;
                AMainDS.PBankingDetailsUsage.Rows.Add(bankingUsageRow);
            }
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:34,代码来源:GenerateWorkers.cs

示例15: GenerateFamilyRecord

        /// <summary>
        /// generate a family record
        /// </summary>
        public static PFamilyRow GenerateFamilyRecord(XmlNode ACurrentNode, string APrefix, PartnerEditTDS AMainDS)
        {
            PFamilyRow FamilyRow = AMainDS.PFamily.NewRowTyped();
            PPartnerRow PartnerRow = AMainDS.PPartner.NewRowTyped();

            if (NumberOfPartnerKeysReserved == 0)
            {
                NumberOfPartnerKeysReserved = 100;
                NextPartnerKey = TNewPartnerKey.ReservePartnerKeys(-1, ref NumberOfPartnerKeysReserved);
            }

            long PartnerKey = NextPartnerKey;
            NextPartnerKey++;
            NumberOfPartnerKeysReserved--;

            PartnerRow.PartnerKey = PartnerKey;
            FamilyRow.PartnerKey = PartnerRow.PartnerKey;

            FamilyRow.FirstName = TXMLParser.GetAttribute(ACurrentNode, APrefix + "FirstName");
            FamilyRow.FamilyName = TXMLParser.GetAttribute(ACurrentNode, APrefix + "FamilyName");
            FamilyRow.Title = TXMLParser.GetAttribute(ACurrentNode, APrefix + "Title");

            PartnerRow.PartnerShortName = Calculations.DeterminePartnerShortName(
                FamilyRow.FamilyName,
                FamilyRow.Title,
                FamilyRow.FirstName);

            PartnerRow.PartnerClass = MPartnerConstants.PARTNERCLASS_FAMILY;
            PartnerRow.StatusCode = MPartnerConstants.PARTNERSTATUS_ACTIVE;

            AMainDS.PFamily.Rows.Add(FamilyRow);
            AMainDS.PPartner.Rows.Add(PartnerRow);

            return FamilyRow;
        }
开发者ID:js1987,项目名称:openpetragit,代码行数:38,代码来源:GenerateWorkers.cs


注:本文中的PartnerEditTDS类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。