/// <summary> /// Loads the specified list. /// </summary> /// <param name="name">The name of the list</param> /// <returns>The list if found, null if no job with the name could be found</returns> public static RecipientList Load(string name) { RecipientLists allLists = RecipientLists.ListAll(); RecipientList list = allLists.FirstOrDefault(l => l.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); return(list); }
/// <summary> /// Lists all recipient lists that specified email adress belongs to /// </summary> /// <returns>A RecipientLists collection of all recipient lists</returns> public static RecipientLists ListAllByEmail(string email) { RecipientLists recipientLists = new RecipientLists(); RecipientData dataUtil = GetWorker(); DataTable recipTable = dataUtil.RecipientListGetAllByEmail(email); foreach (DataRow row in recipTable.Rows) { RecipientList recipientList = new RecipientList(row); recipientLists.Add(recipientList); } return(recipientLists); }
public static RecipientLists ListOneType(string listType) { RecipientLists recipientLists = new RecipientLists(); RecipientData dataUtil = GetWorker(); DataTable recipTable = dataUtil.RecipientListGetAll(); foreach (DataRow row in recipTable.Rows) { RecipientList recipientList = new RecipientList(row); if (recipientList.ListType.ToString().Equals(listType)) { recipientLists.Add(recipientList); } } return(recipientLists); }