public List <string> PopulateMailTemplateList(ref DropDownList dropDownList) { dropDownList.Items.Clear(); var mailtemplate = MailTemplateDao.GetAll(); var returnList = new List <string>(); returnList.Add("--Select a template--"); dropDownList.Items.Add(new ListItem("--Select a template--")); foreach (var p in mailtemplate) { returnList.Add(p.TemplateName); dropDownList.Items.Add(new ListItem(p.TemplateName)); } dropDownList.SelectedIndex = 0; return(returnList); }
public List <MailTemplate> GetAll() { return(MailTemplateDao.GetAll()); }