partial void DeleteT_EmailTemplate(T_EmailTemplate instance);
 partial void InsertT_EmailTemplate(T_EmailTemplate instance);
 partial void UpdateT_EmailTemplate(T_EmailTemplate instance);
Beispiel #4
0
		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;
		}