Example #1
0
        private void UnsubscribeParty(string email)
        {
            var table = PartiesEmails.GetDataByPartyEmail(email);

            if (table.Count == 0)
            {
                Message.InnerText = "The requested email address was not found";
                return;
            }

            foreach (var row in table)
            {
                row.OptOut = true;
            }
            PartiesEmails.UpdateTable(table);
            Message.InnerText =
                $"Email {email} has been unsubscribed from all future party-related emails.";
        }
Example #2
0
        private void Load_Email_Data(string partyEmail)
        {
            var tableEmail = PartiesEmails.GetDataByPartyEmail(partyEmail);

            if (tableEmail.Count != 1)
            {
                throw new ApplicationException($"Did not find a unique row for this PartyEmail: {partyEmail}");
            }

            var rowEmail = tableEmail[0];

            TextboxEmailAddress.Text = rowEmail.PartyEmail;
            TextboxPhone.Text        = rowEmail.PartyContactPhone;
            TextBox_First_Name.Text  = rowEmail.PartyContactFirstName;
            TextBox_Last_Name.Text   = rowEmail.PartyContactLastName;
            TextBox_Title.Text       = rowEmail.PartyContactTitle;

            Emails_Report();
        }