本文整理汇总了C#中SidejobModel.SidejobEntities.AddToRefundProfessionalSuccessfulPDTs方法的典型用法代码示例。如果您正苦于以下问题:C# SidejobEntities.AddToRefundProfessionalSuccessfulPDTs方法的具体用法?C# SidejobEntities.AddToRefundProfessionalSuccessfulPDTs怎么用?C# SidejobEntities.AddToRefundProfessionalSuccessfulPDTs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SidejobModel.SidejobEntities
的用法示例。
在下文中一共展示了SidejobEntities.AddToRefundProfessionalSuccessfulPDTs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckRefundedProfessionalPDT
public void CheckRefundedProfessionalPDT(SidejobEntities context, ProfessionalSuccessfulPDT e)
{
//Check if Record exist
if ((from c in context.RefundProfessionalSuccessfulPDTs
where PDTID == e.PDTID
select c).FirstOrDefault() == null)
{
//Insert the new refund from the successful table
var refund = new RefundProfessionalSuccessfulPDT
{
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,
ProID = e.ProID,
ProjectID = e.ProjectID
};
context.AddToRefundProfessionalSuccessfulPDTs(refund);
context.SaveChanges();
PDTID = e.PDTID;
}
}
示例2: CheckProfessionalArchivedPDT
public void CheckProfessionalArchivedPDT(int professionalId, SidejobEntities context)
{
//Check ArchivedSuccessful PDT
var e1 = (from c in context.ArchivedProfessionalSuccessfulPDTs
where c.ProID == professionalId && 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.RefundProfessionalSuccessfulPDTs
where c.TransactionId == transaction
select c).FirstOrDefault();
if (exist == null)
{
//Check if Transaction exist in ArchivedRefund
var existarchived = (from c in context.ArchivedRefundProfessionalSuccessfulPDTs
where c.TransactionId == transaction
select c).FirstOrDefault();
if (existarchived == null)
{
//Check if Record exist
if ((from c in context.RefundProfessionalSuccessfulPDTs
where PDTID == e1.PDTID
select c).FirstOrDefault() == null)
{
//Insert the new record
var archivedrefund = new RefundProfessionalSuccessfulPDT
{
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,
ProID = e1.ProID,
ProjectID = e1.ProjectID
};
context.AddToRefundProfessionalSuccessfulPDTs(archivedrefund);
context.SaveChanges();
PDTID = e1.PDTID;
}
}
}
}
}