private void detach_T_NotificationTypes(T_NotificationType entity) { this.SendPropertyChanging(); entity.T_EmailTemplate = null; }
partial void DeleteT_NotificationType(T_NotificationType instance);
partial void InsertT_NotificationType(T_NotificationType instance);
partial void UpdateT_NotificationType(T_NotificationType instance);
public string GetEmailTemplate(int notificationTypeId) { var template = new T_NotificationType(); var emailTemplate = new T_EmailTemplate(); using (var dc = new EngageCCTDataClassesDataContext()) { template = dc.T_NotificationTypes.Where(n => n.TypeID == notificationTypeId).FirstOrDefault(); try { emailTemplate = dc.T_EmailTemplates.Where(a => a.TemplateID == template.ntAssociatedTemplateID).FirstOrDefault(); } catch (NullReferenceException e) { var exc = new Exception("No such notification type in DB", e); throw exc; } } if (emailTemplate == null) { var exc = new Exception("No such email template in DB"); throw exc; } return emailTemplate.tmpText; }