Пример #1
0
        public SubscriptionResult Unsubscribe(string email, RecipientList recipientList)
        {
            if (string.IsNullOrEmpty(email))
            {
                return(SubscriptionResult.EmailNotValid);
            }

            if (recipientList == null)
            {
                return(SubscriptionResult.RecipientListNotValid);
            }

            // Get a list to add to, will throw an exception if not found

            int count = recipientList.RemoveEmailAddresses(email);

            if (count == 0)
            {
                return(SubscriptionResult.NotMemberOfList);
            }
            else
            {
                return(SubscriptionResult.Success);
            }
        }
Пример #2
0
        protected void grdWorkItemsItemCommandHandler(object sender, DataGridCommandEventArgs e)
        {
            if (string.Compare(e.CommandName, "delete", true /* Ignore Case */) == 0)
            {
                // Delete it
                string email = e.Item.Cells[0].Text;
                // Remove from collection
                RecipientList.RemoveEmailAddresses(email);

                // Rebind Data
                if (string.IsNullOrEmpty(txtSearchFor.Text.Trim()))
                {
                    BindData();
                    BindWorkItemData(this.RecipientList.EmailAddresses);
                }
                else
                {
                    cmdSearchFor_Click(null, null);
                }
            }
        }