本文整理汇总了C#中PartnerImportExportTDS类的典型用法代码示例。如果您正苦于以下问题:C# PartnerImportExportTDS类的具体用法?C# PartnerImportExportTDS怎么用?C# PartnerImportExportTDS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PartnerImportExportTDS类属于命名空间,在下文中一共展示了PartnerImportExportTDS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportPartner
/// <summary>
/// Load all the data of a partner into a TDS
/// </summary>
public static PartnerImportExportTDS ExportPartner(Int64 APartnerKey)
{
PartnerImportExportTDS MainDS = new PartnerImportExportTDS();
TDBTransaction Transaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.ReadCommitted);
PPartnerAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
PChurchAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
PFamilyAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
PPersonAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
POrganisationAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
PUnitAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
PVenueAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
PLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PPartnerLocationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PPartnerCommentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PPartnerTypeAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PPartnerInterestAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PPartnerGiftDestinationAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PInterestAccess.LoadAll(MainDS, Transaction);
PmPersonalDataAccess.LoadByPrimaryKey(MainDS, APartnerKey, Transaction);
PmPassportDetailsAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmDocumentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PmDocumentTypeAccess.LoadAll(MainDS, Transaction);
PmPersonQualificationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmSpecialNeedAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmPastExperienceAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmPersonLanguageAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmPersonAbilityAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmStaffDataAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmJobAssignmentAccess.LoadViaPPartner(MainDS, APartnerKey, Transaction);
PmPersonEvaluationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmGeneralApplicationAccess.LoadViaPPersonPartnerKey(MainDS, APartnerKey, Transaction);
PtApplicationTypeAccess.LoadAll(MainDS, Transaction);
PmShortTermApplicationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
PmYearProgramApplicationAccess.LoadViaPPerson(MainDS, APartnerKey, Transaction);
UmUnitStructureAccess.LoadViaPUnitChildUnitKey(MainDS, APartnerKey, Transaction);
UmUnitAbilityAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
UmUnitLanguageAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
UmUnitCostAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
UmJobAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
UmJobRequirementAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
UmJobLanguageAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
UmJobQualificationAccess.LoadViaPUnit(MainDS, APartnerKey, Transaction);
PcBuildingAccess.LoadViaPVenue(MainDS, APartnerKey, Transaction);
PcRoomAccess.LoadViaPVenue(MainDS, APartnerKey, Transaction);
DBAccess.GDBAccessObj.RollbackTransaction();
return MainDS;
}
示例2: ImportData
/// <summary>
/// Import data from a CSV file
/// </summary>
/// <param name="ANode"></param>
/// <param name="AReferenceResults"></param>
/// <returns></returns>
public static PartnerImportExportTDS ImportData(XmlNode ANode, ref TVerificationResultCollection AReferenceResults)
{
PartnerImportExportTDS ResultDS = new PartnerImportExportTDS();
TPartnerImportCSV.FLocationKey = -1;
ResultsCol = AReferenceResults;
TDBTransaction ReadTransaction = null;
DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.Serializable, ref ReadTransaction,
delegate
{
while (ANode != null)
{
ResultsContext = "CSV Import";
String PartnerClass = TXMLParser.GetAttribute(ANode, MPartnerConstants.PARTNERIMPORT_PARTNERCLASS).ToUpper();
Int64 PartnerKey = 0;
int LocationKey = 0;
if (PartnerClass.Length == 0)
{
PartnerClass = MPartnerConstants.PARTNERCLASS_FAMILY;
}
if ((PartnerClass == MPartnerConstants.PARTNERCLASS_FAMILY) || (PartnerClass == MPartnerConstants.PARTNERCLASS_PERSON))
{
ResultsContext = "CSV Import Family";
PartnerKey = CreateNewFamily(ANode, out LocationKey, ref ResultDS, ReadTransaction);
CreateSpecialTypes(ANode, PartnerKey, "SpecialTypeFamily_", ref ResultDS);
}
if (PartnerClass == MPartnerConstants.PARTNERCLASS_PERSON)
{
ResultsContext = "CSV Import person";
Int64 PersonKey = CreateNewPerson(PartnerKey, LocationKey, ANode, ref ResultDS, ReadTransaction);
CreateShortTermApplication(ANode, PersonKey, ref ResultDS, ReadTransaction);
CreateSpecialTypes(ANode, PersonKey, ref ResultDS);
CreateSubscriptions(ANode, PersonKey, ref ResultDS);
CreateContacts(ANode, PersonKey, ref ResultDS, "_1");
CreateContacts(ANode, PersonKey, ref ResultDS, "_2");
CreatePassport(ANode, PersonKey, ref ResultDS);
}
ANode = ANode.NextSibling;
}
CreatePartnerAttributes(ref ResultDS, ReadTransaction);
});
return ResultDS;
}
示例3: AddPreviousExperience
private void AddPreviousExperience(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
ImportRecordsByPartnerKey(ANewPartnerDS.PmPastExperience, FMainDS.PmPastExperience,
PmPastExperienceTable.GetPartnerKeyDBName(), AOrigPartnerKey, ANewPartnerKey);
}
示例4: AddRoom
private void AddRoom(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
ImportRecordsByPartnerKey(ANewPartnerDS.PcRoom, FMainDS.PcRoom,
PcRoomTable.GetVenueKeyDBName(), AOrigPartnerKey, ANewPartnerKey);
}
示例5: CheckContactRefs
private static void CheckContactRefs(PartnerImportExportTDS MainDS,
ref TVerificationResultCollection ReferenceResults,
TDBTransaction ATransaction)
{
//int ContactId = 0;
//foreach (PartnerImportExportTDSPPartnerContactRow Row in MainDS.PPartnerContact.Rows)
//{
// PPartnerContactTable Tbl = PPartnerContactAccess.LoadByUniqueKey(Row.PartnerKey, Row.ContactDate, Row.ContactTime, ATransaction);
// bool HereAlready = false;
// if (Tbl.Rows.Count > 0) // I've already imported this..
// {
// Row.AcceptChanges(); // This should make the DB update instead of Add
// Row.ContactId = Tbl[0].ContactId;
// Row.ModificationId = Tbl[0].ModificationId;
// HereAlready = true;
// }
// if (Row.ContactId == 0)
// {
// Row.ContactId = --ContactId;
// }
// // The row has custom Attr and Detail fields, which I need to put into the right tables..
// if (!HereAlready && (Row.ContactAttr != ""))
// {
// AddVerificationResult(ref ReferenceResults, "Adding new contact attribute: " + Row.ContactAttr, TResultSeverity.Resv_Status);
// PContactAttributeDetailRow PcadRow = MainDS.PContactAttributeDetail.NewRowTyped();
// PcadRow.ContactAttributeCode = Row.ContactAttr;
// PcadRow.ContactAttrDetailCode = Row.ContactDetail;
// PcadRow.ContactAttrDetailDescr = FNewRowDescription;
// PContactAttributeDetailAccess.AddOrModifyRecord(
// PcadRow.ContactAttributeCode,
// PcadRow.ContactAttrDetailCode,
// MainDS.PContactAttributeDetail,
// PcadRow, false, ATransaction);
// PPartnerContactAttributeRow PcaRow = MainDS.PPartnerContactAttribute.NewRowTyped();
// PcaRow.ContactId = Row.ContactId;
// PcaRow.ContactAttributeCode = Row.ContactAttr;
// PcaRow.ContactAttrDetailCode = Row.ContactDetail;
// PPartnerContactAttributeAccess.AddOrModifyRecord(
// PcaRow.ContactId,
// PcaRow.ContactAttributeCode,
// PcaRow.ContactAttrDetailCode,
// MainDS.PPartnerContactAttribute,
// PcaRow, false, ATransaction);
// PContactAttributeRow CaRow = MainDS.PContactAttribute.NewRowTyped();
// CaRow.ContactAttributeDescr = FNewRowDescription;
// CaRow.ContactAttributeCode = Row.ContactAttr;
// PContactAttributeAccess.AddOrModifyRecord(
// CaRow.ContactAttributeCode,
// MainDS.PContactAttribute,
// CaRow,
// false,
// ATransaction);
// }
// if (!PMethodOfContactAccess.Exists(Row.ContactCode, ATransaction))
// {
// AddVerificationResult(ref ReferenceResults, "Adding new method of contact: " + Row.ContactCode, TResultSeverity.Resv_Status);
// PMethodOfContactRow MocRow = MainDS.PMethodOfContact.NewRowTyped();
// MocRow.MethodOfContactCode = Row.ContactCode;
// MocRow.Description = FNewRowDescription;
// MocRow.ValidMethod = true;
// MainDS.PMethodOfContact.Rows.Add(MocRow);
// }
//}
}
示例6: AddGiftDestination
/*
* private void AddVision(Int64 OrigPartnerKey, Int64 NewPartnerKey, ref PartnerImportExportTDS NewPartnerDS)
* {
* ImportRecordsByPartnerKey(NewPartnerDS.PmPersonVision, FMainDS.PmPersonVision,
* PmPersonVisionTable.GetPartnerKeyDBName(), OrigPartnerKey, NewPartnerKey);
* }
*/
private void AddGiftDestination(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
ImportRecordsByPartnerKey(ANewPartnerDS.PPartnerGiftDestination, FMainDS.PPartnerGiftDestination,
PPartnerGiftDestinationTable.GetPartnerKeyDBName(), AOrigPartnerKey, ANewPartnerKey);
}
示例7: AddBankingDetails
private void AddBankingDetails(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
FMainDS.PPartnerBankingDetails.DefaultView.Sort = PPartnerBankingDetailsTable.GetPartnerKeyDBName();
int indexPartnerBankingDetails = FMainDS.PPartnerBankingDetails.DefaultView.Find(AOrigPartnerKey);
if (indexPartnerBankingDetails != -1)
{
PPartnerBankingDetailsRow partnerdetailsRow =
(PPartnerBankingDetailsRow)FMainDS.PPartnerBankingDetails.DefaultView[indexPartnerBankingDetails].Row;
partnerdetailsRow.PartnerKey = ANewPartnerKey;
ANewPartnerDS.PPartnerBankingDetails.ImportRow(partnerdetailsRow);
// need to copy the associated PBankingDetails as well
FMainDS.PBankingDetails.DefaultView.Sort = PBankingDetailsTable.GetBankingDetailsKeyDBName();
PBankingDetailsRow OrigBankingDetailsRow =
(PBankingDetailsRow)FMainDS.PBankingDetails.DefaultView[
FMainDS.PBankingDetails.DefaultView.Find(partnerdetailsRow.BankingDetailsKey)].Row;
PBankRow bankRow = (PBankRow)FMainDS.PBank.Rows.Find(OrigBankingDetailsRow.BankKey);
// create the PBank record as well, if it does not exist yet
OrigBankingDetailsRow.BankKey = TRemote.MPartner.Partner.WebConnectors.GetBankBySortCode(bankRow.BranchCode);
ANewPartnerDS.PBankingDetails.ImportRow(OrigBankingDetailsRow);
}
}
示例8: AddProfessionalData
private void AddProfessionalData(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
ImportRecordsByPartnerKey(ANewPartnerDS.PmPersonQualification, FMainDS.PmPersonQualification,
PmPersonQualificationTable.GetPartnerKeyDBName(), AOrigPartnerKey, ANewPartnerKey);
}
示例9: AddSpecialNeeds
private void AddSpecialNeeds(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
ImportRecordsByPartnerKey(ANewPartnerDS.PmSpecialNeed, FMainDS.PmSpecialNeed,
PmSpecialNeedTable.GetPartnerKeyDBName(), AOrigPartnerKey, ANewPartnerKey);
}
示例10: AddSubscriptions
private void AddSubscriptions(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
ImportRecordsByPartnerKey(ANewPartnerDS.PSubscription, FMainDS.PSubscription,
PSubscriptionTable.GetPartnerKeyDBName(), AOrigPartnerKey, ANewPartnerKey);
// I'll also import any related Publication rows.
ANewPartnerDS.PSubscription.DefaultView.RowFilter = String.Format("{0} = {1}", PSubscriptionTable.GetPartnerKeyDBName(), ANewPartnerKey);
foreach (DataRowView rv in ANewPartnerDS.PSubscription.DefaultView)
{
PSubscriptionRow Row = (PSubscriptionRow)rv.Row;
FMainDS.PPublication.DefaultView.RowFilter = String.Format("{0}='{1}'",
PPublicationTable.GetPublicationCodeDBName(), Row.PublicationCode);
foreach (DataRowView Pubrv in FMainDS.PPublication.DefaultView)
{
ANewPartnerDS.PPublication.ImportRow(Pubrv.Row);
}
}
}
示例11: CreateOrUpdatePartner
/// <summary>
/// Copy this Partner, and all the data linked to it, from the large DataSet into a new one,
/// and send it back to the server for committing.
///
/// NOTE: May be called recursively to add parent records before adding children.
/// </summary>
/// <param name="APartnerRow">Row to import</param>
/// <param name="StepAfterImport">Go on to next record afterwards. (Usually true)</param>
/// <returns>Partner key of imported record (although no-one cares)</returns>
private Int64 CreateOrUpdatePartner(PPartnerRow APartnerRow, Boolean StepAfterImport)
{
if ((FCurrentNumberOfRecord < 1) || (FCurrentNumberOfRecord > FTotalNumberOfRecords))
{
return 0;
}
if (FImportedUnits.Contains(APartnerRow.PartnerKey))
{
return APartnerRow.PartnerKey;
}
PartnerImportExportTDS NewPartnerDS = new PartnerImportExportTDS();
NewPartnerDS.PPartner.ImportRow(APartnerRow);
Int64 OrigPartnerKey = APartnerRow.PartnerKey;
Int64 NewPartnerKey = OrigPartnerKey;
bool UpdateExistingRecord = false;
// If the import file had a negative PartnerKey, I need to create a new one here,
// and use it on all the dependent tables.
if (OrigPartnerKey < 0)
{
if (ExistingPartnerKey > 0) // This ExistingPartnerKey has been set by the UseSelectedPerson button.
{
NewPartnerKey = ExistingPartnerKey;
UpdateExistingRecord = true;
ExistingPartnerKey = -1; // Don't use this next time!
}
else
{
NewPartnerKey = TRemote.MPartner.Partner.WebConnectors.NewPartnerKey(-1);
}
}
if (UpdateExistingRecord)
{
NewPartnerDS.PPartner[0].PartnerKey = UserSelectedRow.PartnerKey;
NewPartnerDS.PPartner[0].DateCreated = UserSelectedRow.DateCreated;
NewPartnerDS.PPartner[0].CreatedBy = UserSelectedRow.CreatedBy;
NewPartnerDS.PPartner[0].ModificationId = UserSelectedRow.ModificationId;
NewPartnerDS.PPartner[0].AcceptChanges(); // This should reset the RowState, allowing me to Update rather than Add
}
NewPartnerDS.PPartner[0].PartnerKey = NewPartnerKey;
if (NewPartnerDS.PPartner[0].PartnerClass == MPartnerConstants.PARTNERCLASS_CHURCH)
{
ImportRecordsByPartnerKey(NewPartnerDS.PChurch, FMainDS.PChurch,
PChurchTable.GetPartnerKeyDBName(), OrigPartnerKey, NewPartnerKey, UpdateExistingRecord);
}
else if (NewPartnerDS.PPartner[0].PartnerClass == MPartnerConstants.PARTNERCLASS_FAMILY)
{
//
// Before I change the PartnerKey on this PFamily, I need to update any PPerson records that are linked to it,
// so that the links will still work...
FMainDS.PPerson.DefaultView.RowFilter = String.Format("{0}={1}", PartnerEditTDSPPersonTable.GetFamilyKeyDBName(), OrigPartnerKey);
foreach (DataRowView rv in FMainDS.PPerson.DefaultView)
{
PPersonRow RelatedPerson = (PPersonRow)rv.Row;
RelatedPerson.FamilyKey = NewPartnerKey;
}
ImportRecordsByPartnerKey(NewPartnerDS.PFamily, FMainDS.PFamily,
PFamilyTable.GetPartnerKeyDBName(), OrigPartnerKey, NewPartnerKey, UpdateExistingRecord);
}
else if (NewPartnerDS.PPartner[0].PartnerClass == MPartnerConstants.PARTNERCLASS_PERSON)
{
ImportRecordsByPartnerKey(NewPartnerDS.PPerson, FMainDS.PPerson,
PPersonTable.GetPartnerKeyDBName(), OrigPartnerKey, NewPartnerKey, UpdateExistingRecord);
NewPartnerDS.PPerson.DefaultView.RowFilter = String.Format("{0}={1}", PPersonTable.GetPartnerKeyDBName(), NewPartnerKey);
Int64 RelatedFamilyKey = ((PPersonRow)NewPartnerDS.PPerson.DefaultView[0].Row).FamilyKey;
// If there's an associated PFamily record that I've not imported yet, I could try to do that now,
// but it's problematic because it might end up getting imported twice.
// Anyway, I should not come to here because the family should have been imported first.
if (RelatedFamilyKey < 0) // There's a related family that's not been imported
{
AddStatus("Import Problem: PPerson record with no related PFamily.");
return 0;
}
}
else if (NewPartnerDS.PPartner[0].PartnerClass == MPartnerConstants.PARTNERCLASS_ORGANISATION)
{
ImportRecordsByPartnerKey(NewPartnerDS.POrganisation, FMainDS.POrganisation,
POrganisationTable.GetPartnerKeyDBName(), OrigPartnerKey, NewPartnerKey, UpdateExistingRecord);
}
else if (NewPartnerDS.PPartner[0].PartnerClass == MPartnerConstants.PARTNERCLASS_UNIT)
//.........这里部分代码省略.........
示例12: CheckSTApplicationRefs
private static void CheckSTApplicationRefs(PartnerImportExportTDS MainDS,
ref TVerificationResultCollection ReferenceResults,
TDBTransaction Transaction)
{
// Special Applicant: keep a list of them!
// Arrival Point:
// Transport Type:
// Leadership Rating:
// PartyType:
// PmOutreachRole: All from Short Term Application Rows
foreach (PmShortTermApplicationRow rv in MainDS.PmShortTermApplication.Rows)
{
if ((rv.StSpecialApplicant != "") && (!PtSpecialApplicantAccess.Exists(rv.StSpecialApplicant, Transaction)))
{
MainDS.PtSpecialApplicant.DefaultView.RowFilter = String.Format("{0}='{1}'",
PtSpecialApplicantTable.GetCodeDBName(), rv.StSpecialApplicant);
if (MainDS.PtSpecialApplicant.DefaultView.Count == 0) // Check I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding Special Applicant " + rv.StSpecialApplicant);
PtSpecialApplicantRow Row = MainDS.PtSpecialApplicant.NewRowTyped();
Row.Code = rv.StSpecialApplicant;
Row.Description = FNewRowDescription;
MainDS.PtSpecialApplicant.Rows.Add(Row);
}
}
if ((rv.ArrivalPointCode != "") && (!PtArrivalPointAccess.Exists(rv.ArrivalPointCode, Transaction)))
{
MainDS.PtArrivalPoint.DefaultView.RowFilter = String.Format("{0}='{1}'", PtArrivalPointTable.GetCodeDBName(), rv.ArrivalPointCode);
if (MainDS.PtArrivalPoint.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new arrival point code '" + rv.ArrivalPointCode + "'");
PtArrivalPointRow Row = MainDS.PtArrivalPoint.NewRowTyped();
Row.Code = rv.ArrivalPointCode;
Row.Description = FNewRowDescription;
MainDS.PtArrivalPoint.Rows.Add(Row);
}
}
if ((rv.DeparturePointCode != "") && (!PtArrivalPointAccess.Exists(rv.DeparturePointCode, Transaction)))
{
MainDS.PtArrivalPoint.DefaultView.RowFilter = String.Format("{0}='{1}'",
PtArrivalPointTable.GetCodeDBName(), rv.DeparturePointCode);
if (MainDS.PtArrivalPoint.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new arrival point code '" + rv.DeparturePointCode + "'");
PtArrivalPointRow Row = MainDS.PtArrivalPoint.NewRowTyped();
Row.Code = rv.DeparturePointCode;
Row.Description = FNewRowDescription;
MainDS.PtArrivalPoint.Rows.Add(Row);
}
}
if ((rv.TravelTypeToCongCode != "") && (!PtTravelTypeAccess.Exists(rv.TravelTypeToCongCode, Transaction)))
{
MainDS.PtTravelType.DefaultView.RowFilter = String.Format("{0}='{1}'", PtTravelTypeTable.GetCodeDBName(), rv.TravelTypeToCongCode);
if (MainDS.PtTravelType.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new Travel Type " + rv.TravelTypeToCongCode);
PtTravelTypeRow Row = MainDS.PtTravelType.NewRowTyped();
Row.Code = rv.TravelTypeToCongCode;
Row.Description = FNewRowDescription;
MainDS.PtTravelType.Rows.Add(Row);
}
}
if ((rv.TravelTypeFromCongCode != "") && (!PtTravelTypeAccess.Exists(rv.TravelTypeFromCongCode, Transaction)))
{
MainDS.PtTravelType.DefaultView.RowFilter = String.Format("{0}='{1}'",
PtTravelTypeTable.GetCodeDBName(), rv.TravelTypeFromCongCode);
if (MainDS.PtTravelType.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new Travel Type " + rv.TravelTypeFromCongCode);
PtTravelTypeRow Row = MainDS.PtTravelType.NewRowTyped();
Row.Code = rv.TravelTypeFromCongCode;
Row.Description = FNewRowDescription;
MainDS.PtTravelType.Rows.Add(Row);
}
}
if ((rv.OutreachRole != "") && (!PtCongressCodeAccess.Exists(rv.OutreachRole, Transaction)))
{
MainDS.PtCongressCode.DefaultView.RowFilter = String.Format("{0}='{1}'", PtCongressCodeTable.GetCodeDBName(), (rv.OutreachRole));
if (MainDS.PtCongressCode.DefaultView.Count == 0) // Check I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new Congress Code " + rv.OutreachRole);
PtCongressCodeRow Row = MainDS.PtCongressCode.NewRowTyped();
Row.Code = rv.OutreachRole;
Row.Description = FNewRowDescription;
MainDS.PtCongressCode.Rows.Add(Row);
}
}
}
//.........这里部分代码省略.........
示例13: CheckCommitmentStatus
private static void CheckCommitmentStatus(PartnerImportExportTDS MainDS,
ref TVerificationResultCollection ReferenceResults,
TDBTransaction Transaction)
{
// Commitment Status Code: I'm not going to add this, but I should inform the user...
foreach (PmStaffDataRow rv in MainDS.PmStaffData.Rows)
{
if ((rv.StatusCode != "") && (!PmCommitmentStatusAccess.Exists(rv.StatusCode, Transaction)))
{
AddVerificationResult(ref ReferenceResults, "Removing unknown Commitment Status " + rv.StatusCode);
rv.StatusCode = "";
/*
* TLogging.Log("Adding new commitment status code " + rv.StatusCode);
* PmCommitmentStatusRow commitmentStatusRow = MainDS.PmCommitmentStatus.NewRowTyped();
* commitmentStatusRow.Code = rv.StatusCode;
* commitmentStatusRow.Desc = NewRowDescription;
* MainDS.PmCommitmentStatus.Rows.Add(commitmentStatusRow);
*/
}
}
}
示例14: CheckApplication
private static void CheckApplication(PartnerImportExportTDS MainDS,
ref TVerificationResultCollection ReferenceResults,
TDBTransaction Transaction)
{
// The Application must be unique - if it's present already, I can update the existing record.
// ApplicationStatus: Application Status must be listed in PtApplicantStatus
// ApplicantType: applicants must be of known types
// ApplicationType: applications must be of known types
for (int RowIdx = 0; RowIdx < MainDS.PmGeneralApplication.Rows.Count; RowIdx++)
{
PmGeneralApplicationRow GenAppRow = MainDS.PmGeneralApplication[RowIdx];
// Check if this row already exists, using the unique key
if (PmGeneralApplicationAccess.Exists(GenAppRow.PartnerKey, GenAppRow.GenAppDate, GenAppRow.AppTypeName, GenAppRow.OldLink,
Transaction))
{
// If it does, I need to update and not add.
PmGeneralApplicationTable Tbl = PmGeneralApplicationAccess.LoadByUniqueKey(
GenAppRow.PartnerKey, GenAppRow.GenAppDate, GenAppRow.AppTypeName, GenAppRow.OldLink, Transaction);
PmGeneralApplicationRow ExistingRow = Tbl[0];
GenAppRow.AcceptChanges();
GenAppRow.ModificationId = ExistingRow.ModificationId;
AddVerificationResult(ref ReferenceResults, "Existing Application record updated.");
}
if ((GenAppRow.GenApplicationStatus != "") && (!PtApplicantStatusAccess.Exists(GenAppRow.GenApplicationStatus, Transaction)))
{
MainDS.PtApplicantStatus.DefaultView.RowFilter = String.Format("{0}='{1}'",
PtApplicantStatusTable.GetCodeDBName(), GenAppRow.GenApplicationStatus);
if (MainDS.PtApplicantStatus.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new Applicant Status " + GenAppRow.GenApplicationStatus);
PtApplicantStatusRow Row = MainDS.PtApplicantStatus.NewRowTyped();
Row.Code = GenAppRow.GenApplicationStatus;
Row.Description = FNewRowDescription;
MainDS.PtApplicantStatus.Rows.Add(Row);
}
}
if (GenAppRow.IsGenApplicantTypeNull())
{
GenAppRow.GenApplicantType = "Gen App"; // This field is scheduled for deletion, but for now it's NOT NULL.
}
if (GenAppRow.AppTypeName == "")
{
GenAppRow.AppTypeName = "CONFERENCE";
}
if ((GenAppRow.AppTypeName != "") && (!PtApplicationTypeAccess.Exists(GenAppRow.AppTypeName, Transaction)))
{
MainDS.PtApplicationType.DefaultView.RowFilter = String.Format("{0}='{1}'",
PtApplicationTypeTable.GetAppTypeNameDBName(), GenAppRow.AppTypeName);
if (MainDS.PtApplicationType.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new Application Type " + GenAppRow.AppTypeName);
PtApplicationTypeRow Row = MainDS.PtApplicationType.NewRowTyped();
Row.AppTypeName = GenAppRow.AppTypeName;
Row.AppTypeDescr = FNewRowDescription;
MainDS.PtApplicationType.Rows.Add(Row);
}
}
if ((GenAppRow.GenContact1 != "") && (!PtContactAccess.Exists(GenAppRow.GenContact1, Transaction)))
{
MainDS.PtContact.DefaultView.RowFilter = String.Format("{0}='{1}'", PtContactTable.GetContactNameDBName(), GenAppRow.GenContact1);
if (MainDS.PtContact.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new Contact Name " + GenAppRow.GenContact1);
PtContactRow Row = MainDS.PtContact.NewRowTyped();
Row.ContactName = GenAppRow.GenContact1;
Row.ContactDescr = FNewRowDescription;
MainDS.PtContact.Rows.Add(Row);
}
}
if ((GenAppRow.GenContact2 != "") && (!PtContactAccess.Exists(GenAppRow.GenContact2, Transaction)))
{
MainDS.PtContact.DefaultView.RowFilter = String.Format("{0}='{1}'", PtContactTable.GetContactNameDBName(), GenAppRow.GenContact2);
if (MainDS.PtContact.DefaultView.Count == 0) // I've not just added this a moment ago..
{
AddVerificationResult(ref ReferenceResults, "Adding new Contact Name " + GenAppRow.GenContact2);
PtContactRow Row = MainDS.PtContact.NewRowTyped();
Row.ContactName = GenAppRow.GenContact2;
Row.ContactDescr = FNewRowDescription;
MainDS.PtContact.Rows.Add(Row);
}
}
}
}
示例15: AddPassport
private void AddPassport(Int64 AOrigPartnerKey, Int64 ANewPartnerKey, ref PartnerImportExportTDS ANewPartnerDS)
{
ImportRecordsByPartnerKey(ANewPartnerDS.PmPassportDetails, FMainDS.PmPassportDetails,
PmPassportDetailsTable.GetPartnerKeyDBName(), AOrigPartnerKey, ANewPartnerKey);
}