Ejemplo n.º 1
0
        private void UnsubscribePolitician()
        {
            var politicianKey = GetQueryString("key");
            var table         = Politicians.GetDataByPoliticianKey(politicianKey);

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

            foreach (var row in table)
            {
                row.OptOut = true;
            }
            Politicians.UpdateTable(table);
            Message.InnerText =
                $"{Politicians.FormatName(table[0])} has been unsubscribed from all future candidate emails.";
        }