本文整理汇总了C#中GiftBatchTDS.GetChangesTyped方法的典型用法代码示例。如果您正苦于以下问题:C# GiftBatchTDS.GetChangesTyped方法的具体用法?C# GiftBatchTDS.GetChangesTyped怎么用?C# GiftBatchTDS.GetChangesTyped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GiftBatchTDS
的用法示例。
在下文中一共展示了GiftBatchTDS.GetChangesTyped方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveGiftBatchTDS
public static TSubmitChangesResult SaveGiftBatchTDS(ref GiftBatchTDS AInspectDS,
out TVerificationResultCollection AVerificationResult)
{
AVerificationResult = new TVerificationResultCollection();
TSubmitChangesResult SubmissionResult = TSubmitChangesResult.scrError;
// make sure that empty tables are removed !! This can return NULL!
AInspectDS = AInspectDS.GetChangesTyped(true);
if (AInspectDS == null)
{
AVerificationResult.Add(new TVerificationResult(
Catalog.GetString("Save Gift Batch"),
Catalog.GetString("No changes - nothing to do"),
TResultSeverity.Resv_Info));
return TSubmitChangesResult.scrNothingToBeSaved;
}
bool AllValidationsOK = true;
bool GiftBatchTableInDataSet = (AInspectDS.AGiftBatch != null && AInspectDS.AGiftBatch.Count > 0);
bool GiftTableInDataSet = (AInspectDS.AGift != null && AInspectDS.AGift.Count > 0);
bool GiftDetailTableInDataSet = (AInspectDS.AGiftDetail != null && AInspectDS.AGiftDetail.Count > 0);
//Not needed at present
//int GiftBatchCount = GiftBatchTableInDataSet ? AInspectDS.AGiftBatch.Count : 0;
int GiftCount = GiftTableInDataSet ? AInspectDS.AGift.Count : 0;
int GiftDetailCount = GiftDetailTableInDataSet ? AInspectDS.AGiftDetail.Count : 0;
bool RecurrGiftBatchTableInDataSet = (AInspectDS.ARecurringGiftBatch != null && AInspectDS.ARecurringGiftBatch.Count > 0);
bool RecurrGiftTableInDataSet = (AInspectDS.ARecurringGift != null && AInspectDS.ARecurringGift.Count > 0);
bool RecurrGiftDetailTableInDataSet = (AInspectDS.ARecurringGiftDetail != null && AInspectDS.ARecurringGiftDetail.Count > 0);
if (RecurrGiftBatchTableInDataSet || RecurrGiftTableInDataSet || RecurrGiftDetailTableInDataSet)
{
if (GiftBatchTableInDataSet || GiftTableInDataSet || GiftDetailTableInDataSet)
{
throw new Exception(String.Format("Function:{0} - Recurring and normal gift data found in same changes batch!",
Utilities.GetMethodName(true)));
}
return SaveRecurringGiftBatchTDS(ref AInspectDS,
ref AVerificationResult,
RecurrGiftBatchTableInDataSet,
RecurrGiftTableInDataSet,
RecurrGiftDetailTableInDataSet);
}
else
{
if (!(GiftBatchTableInDataSet || GiftTableInDataSet || GiftDetailTableInDataSet))
{
throw new Exception(String.Format("Function:{0} - No gift data changes to save!", Utilities.GetMethodName(true)));
}
}
//Get a list of all batches involved
List <Int32>ListAllGiftBatchesToProcess = new List <int>();
//Get batch numbers involved
if (GiftDetailTableInDataSet)
{
DataView AllBatchesToProcess = new DataView(AInspectDS.AGiftDetail);
AllBatchesToProcess.RowStateFilter = DataViewRowState.OriginalRows | DataViewRowState.Added;
foreach (DataRowView drv in AllBatchesToProcess)
{
AGiftDetailRow gdr = (AGiftDetailRow)drv.Row;
int batchNumber;
if (gdr.RowState != DataRowState.Deleted)
{
batchNumber = gdr.BatchNumber;
}
else
{
batchNumber = (Int32)gdr[AGiftDetailTable.ColumnBatchNumberId, DataRowVersion.Original];
}
if (!ListAllGiftBatchesToProcess.Contains(batchNumber))
{
ListAllGiftBatchesToProcess.Add(batchNumber);
}
}
ValidateGiftDetail(ref AVerificationResult, AInspectDS.AGiftDetail);
ValidateGiftDetailManual(ref AVerificationResult, AInspectDS.AGiftDetail);
if (!TVerificationHelper.IsNullOrOnlyNonCritical(AVerificationResult))
{
AllValidationsOK = false;
}
}
//Get batch numbers involved
if (GiftTableInDataSet)
{
DataView AllBatchesToProcess = new DataView(AInspectDS.AGift);
AllBatchesToProcess.RowStateFilter = DataViewRowState.OriginalRows | DataViewRowState.Added;
foreach (DataRowView drv in AllBatchesToProcess)
//.........这里部分代码省略.........