本文整理汇总了C#中SidejobModel.SidejobEntities.AddToAutomationEmailProblems方法的典型用法代码示例。如果您正苦于以下问题:C# SidejobEntities.AddToAutomationEmailProblems方法的具体用法?C# SidejobEntities.AddToAutomationEmailProblems怎么用?C# SidejobEntities.AddToAutomationEmailProblems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SidejobModel.SidejobEntities
的用法示例。
在下文中一共展示了SidejobEntities.AddToAutomationEmailProblems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmailAutomation
public void EmailAutomation()
{
using (var context = new SidejobEntities())
{
var message = (from c in context.AutomatedMessages
select c).ToList();
if (message.Count != 0)
{
foreach (var e in message)
{
try
{
SendEmail(e.EmailAddress, e.Title, e.MessageID.ToString(CultureInfo.InvariantCulture), Server.MapPath("~/EmailTemplates/AutomatedMessage.aspx"), Message.Automated);
}
catch (Exception emailexception)
{
var emailProblem = new AutomationEmailProblem
{
MessageID = e.MessageID,
EmailAddress = e.EmailAddress,
Title = e.Title,
Message = e.Message
};
context.AddToAutomationEmailProblems(emailProblem);
}
}
}
context.DeleteObject(message);
context.SaveChanges();
}
}
示例2: CatchMessage
public void CatchMessage(SidejobEntities context, AutomatedMessage m)
{
var messageProblem = new AutomationEmailProblem
{
MessageID = m.MessageID,
EmailAddress = m.EmailAddress,
Title = m.Title,
Message = m.Message
};
context.AddToAutomationEmailProblems(messageProblem);
context.SaveChanges();
}