本文整理汇总了C#中SidejobModel.SidejobEntities.AddToRefundCustomerSuccessfulPDTs方法的典型用法代码示例。如果您正苦于以下问题:C# SidejobEntities.AddToRefundCustomerSuccessfulPDTs方法的具体用法?C# SidejobEntities.AddToRefundCustomerSuccessfulPDTs怎么用?C# SidejobEntities.AddToRefundCustomerSuccessfulPDTs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SidejobModel.SidejobEntities
的用法示例。
在下文中一共展示了SidejobEntities.AddToRefundCustomerSuccessfulPDTs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckRefundedCustomerPDT
public void CheckRefundedCustomerPDT(int customerId, CustomerSuccessfulPDT e, SidejobEntities context)
{
//Check to see if exist
var r = (from c in context.RefundCustomerSuccessfulPDTs
where c.ProjectID == ProjectID && c.CustomerID == customerId
select c).FirstOrDefault();
if (r == null)
{
//Check if Record exist
if ((from c in context.RefundCustomerSuccessfulPDTs
where PDTID == e.PDTID
select c).FirstOrDefault() == null)
{
//Insert the new refund from the successful table
var refund = new RefundCustomerSuccessfulPDT
{
PDTID = e.PDTID,
GrossTotal = e.GrossTotal,
Invoice = e.Invoice,
PaymentStatus = e.PaymentStatus,
FirstName = e.FirstName,
LastName = e.LastName,
PaymentFee = e.PaymentFee,
BusinessEmail = e.BusinessEmail,
TxToken = e.TxToken,
ReceiverEmail = e.ReceiverEmail,
ItemName = e.ItemName,
CurrencyCode = e.CurrencyCode,
TransactionId = e.TransactionId,
Custom = e.Custom,
subscriberId = e.subscriberId,
CustomerID = e.CustomerID,
ProjectID = e.ProjectID
};
context.AddToRefundCustomerSuccessfulPDTs(refund);
context.SaveChanges();
PDTID = e.PDTID;
}
}
}
示例2: CheckCustomerArchivedPDT
public void CheckCustomerArchivedPDT(int customerId, SidejobEntities context)
{
//Check ArchivedSuccessful PDT
var e1 = (from c in context.ArchivedCustomerSuccessfulPDTs
where c.CustomerID == customerId && c.ProjectID == ProjectID
select c).FirstOrDefault();
if (e1 != null)
{
var transaction = e1.TransactionId;
//Insert the new refund from archieved table
//Check if Transaction exist in Refund
var exist = (from c in context.RefundCustomerSuccessfulPDTs
where c.TransactionId == transaction
select c).FirstOrDefault();
if (exist == null)
{
//Check if Transaction exist in ArchivedRefund
var existarchived = (from c in context.ArchivedRefundCustomerSuccessfulPDTs
where c.TransactionId == transaction
select c).FirstOrDefault();
if (existarchived == null)
{
//Check if Record exist
if ((from c in context.RefundCustomerSuccessfulPDTs
where PDTID == e1.PDTID
select c).FirstOrDefault() == null)
{
//Insert the new record
var archivedrefund = new RefundCustomerSuccessfulPDT
{
PDTID = e1.PDTID,
GrossTotal = e1.GrossTotal,
Invoice = e1.Invoice,
PaymentStatus = e1.PaymentStatus,
FirstName = e1.FirstName,
LastName = e1.LastName,
PaymentFee = e1.PaymentFee,
BusinessEmail = e1.BusinessEmail,
TxToken = e1.TxToken,
ReceiverEmail = e1.ReceiverEmail,
ItemName = e1.ItemName,
CurrencyCode = e1.CurrencyCode,
TransactionId = e1.TransactionId,
Custom = e1.Custom,
subscriberId = e1.subscriberId,
CustomerID = e1.CustomerID,
ProjectID = e1.ProjectID
};
context.AddToRefundCustomerSuccessfulPDTs(archivedrefund);
context.SaveChanges();
PDTID = e1.PDTID;
}
}
}
}
}