本文整理汇总了C#中PartnerImportExportTDS.Merge方法的典型用法代码示例。如果您正苦于以下问题:C# PartnerImportExportTDS.Merge方法的具体用法?C# PartnerImportExportTDS.Merge怎么用?C# PartnerImportExportTDS.Merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartnerImportExportTDS
的用法示例。
在下文中一共展示了PartnerImportExportTDS.Merge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParsePartners
private static void ParsePartners(ref PartnerImportExportTDS AMainDS,
XmlNode ACurNode,
TDBTransaction ATransaction,
ref TVerificationResultCollection AVerificationResult)
{
XmlNode LocalNode = ACurNode;
while (LocalNode != null)
{
if (LocalNode.Name.StartsWith("PartnerGroup"))
{
ParsePartners(ref AMainDS, LocalNode.FirstChild, ATransaction, ref AVerificationResult);
}
else if (LocalNode.Name.StartsWith("Partner"))
{
PPartnerRow PartnerRow = AMainDS.PPartner.NewRowTyped();
Boolean IsExistingPartner = false;
if (!TYml2Xml.HasAttributeRecursive(LocalNode, "SiteKey"))
{
throw new Exception(Catalog.GetString("Missing SiteKey Attribute"));
}
if (!TYml2Xml.HasAttributeRecursive(LocalNode, "status"))
{
throw new Exception(Catalog.GetString("Missing status Attribute"));
}
// get a new partner key
if (TYml2Xml.HasAttribute(LocalNode, "PartnerKey"))
{
PartnerRow.PartnerKey = Convert.ToInt64(TYml2Xml.GetAttribute(LocalNode, "PartnerKey"));
if (PPartnerAccess.Exists(PartnerRow.PartnerKey, ATransaction))
{
AMainDS.Merge(PPartnerAccess.LoadByPrimaryKey(PartnerRow.PartnerKey, ATransaction));
AMainDS.PPartner.DefaultView.RowFilter = String.Format("{0} = '{1}'",
PPartnerTable.GetPartnerKeyDBName(),
PartnerRow.PartnerKey);
PartnerRow = (PPartnerRow)AMainDS.PPartner.DefaultView[0].Row;
IsExistingPartner = true;
}
else
{
AMainDS.PPartner.Rows.Add(PartnerRow);
}
}
else
{
PartnerRow.PartnerKey = TImportExportYml.NewPartnerKey;
TImportExportYml.NewPartnerKey--;
}
String PartnerClass = TYml2Xml.GetAttributeRecursive(LocalNode, "class");
TLogging.LogAtLevel(TLogging.DEBUGLEVEL_TRACE,
PartnerClass + " " +
LocalNode.Name + " " +
"PartnerKey=" + PartnerRow.PartnerKey
);
if (IsExistingPartner && (PartnerClass != PartnerRow.PartnerClass))
{
throw new Exception(String.Format("Error: Yml contains Existing Partner {0} with a different partner class {1}!",
PartnerRow.PartnerKey, PartnerClass));
}
PartnerRow.PartnerClass = PartnerClass;
if (PartnerClass == MPartnerConstants.PARTNERCLASS_FAMILY)
{
PFamilyRow FamilyRow;
if (IsExistingPartner)
{
AMainDS.Merge(PFamilyAccess.LoadByPrimaryKey(PartnerRow.PartnerKey, ATransaction));
AMainDS.PFamily.DefaultView.RowFilter = String.Format("{0} = '{1}'",
PFamilyTable.GetPartnerKeyDBName(),
PartnerRow.PartnerKey);
FamilyRow = (PFamilyRow)AMainDS.PFamily.DefaultView[0].Row;
}
else
{
FamilyRow = AMainDS.PFamily.NewRowTyped();
FamilyRow.PartnerKey = PartnerRow.PartnerKey;
PartnerRow.PartnerClass = MPartnerConstants.PARTNERCLASS_FAMILY;
AMainDS.PFamily.Rows.Add(FamilyRow);
}
FamilyRow.FamilyName = TYml2Xml.GetAttributeRecursive(LocalNode, "LastName");
FamilyRow.FirstName = TYml2Xml.GetAttribute(LocalNode, "FirstName");
FamilyRow.Title = TYml2Xml.GetAttribute(LocalNode, "Title");
if (TYml2Xml.HasAttribute(LocalNode, "CreatedAt"))
{
FamilyRow.DateCreated = Convert.ToDateTime(TYml2Xml.GetAttribute(LocalNode, "CreatedAt"));
}
PartnerRow.AddresseeTypeCode = MPartnerConstants.PARTNERCLASS_FAMILY;
//.........这里部分代码省略.........