protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (TemplateID > 0) { TAFDAL newDal = new TAFDAL(); TAFTemplate newTemplate = newDal.GetTAFTemplateByID(TemplateID); PopulateTemplate(newTemplate); } else { populateImageDropDown(); } TAFDAL newTAF = new TAFDAL(); IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates(); foreach (TAFTemplate template in templates) { ListItem item = new ListItem(); item.Text = template.TemplateName; item.Value = template.TemplateID.ToString(); ddlDuplicateTemplate.Items.Add(item); } } }
protected void ddlSelectTemplate_SelectedIndexChanged(object sender, EventArgs e) { int templateID = 0; txtFromEmail.Text = string.Empty; txtEmailSubject.Text = string.Empty; HTMLEditor1.Text = string.Empty; int.TryParse(ddlSelectTemplate.SelectedValue, out templateID); if (templateID > 0) { TAFDAL newTAF = new TAFDAL(); TAFTemplate template = newTAF.GetTAFTemplateByID(templateID); txtFromEmail.Text = template.FromEmail; txtEmailSubject.Text = template.EmailSubject; HTMLEditor1.Text = template.EmailBody; } }
protected void ddlDuplicateTemplate_SelectedIndexChanged(object sender, EventArgs e) { int templateID = 0; int.TryParse(ddlDuplicateTemplate.SelectedValue, out templateID); if (templateID > 0) { TAFDAL newTAF = new TAFDAL(); TAFTemplate template = newTAF.GetTAFTemplateByID(templateID); txtFromEmail.Text = template.FromEmail; txtReplyTo.Text = template.ReplyToEmail; txtEmailSubject.Text = template.EmailSubject; HTMLEditor1.Text = template.EmailBody; } else { txtFromEmail.Text = "Happy Birthday <*****@*****.**>"; txtReplyTo.Text = "*****@*****.**"; txtEmailSubject.Text = "Happy Birthday [Name]!"; HTMLEditor1.Text = "<img id='GiftCertGraphics' class='imgSelection' src='../Email/images/blank.PNG' alt='Please allow your browser to display the GiftCertificate image' /><p></p>"; } }