// protected void ButtonUnsubscribe_Click(object sender, EventArgs e) { var attendeesODS = new AttendeesODS(); List<AttendeesODS.DataObjectAttendees> listAttendees = attendeesODS.GetByUsername(string.Empty, Context.User.Identity.Name, false); AttendeesODS.DataObjectAttendees attendee = listAttendees[0]; string email = attendee.Email; var optoutUser = (EmailOptOutManager.I.Get(new EmailOptOutQuery() {Email = email})).SingleOrDefault(); if (optoutUser == null) { LabelUnsubscribe.Visible = true; LabelUnsubscribe.Text = email + " Has been unsubscribed. To resubscribe, contact " + Utils.GetServiceEmailAddress(); LabelUnsubscribe.BackColor = Color.Blue; LabelUnsubscribe.ForeColor = Color.Yellow; ButtonUnsubscribe.Enabled = false; EmailOptOutManager.I.Insert(new EmailOptOutResult(){ Comment = "Opted Out By Profile",DateAdded = DateTime.Now,Email = email}); } else { LabelUnsubscribe.Visible = true; LabelUnsubscribe.Text = email + " has previously been opted out."; LabelUnsubscribe.BackColor = Color.Red; LabelUnsubscribe.ForeColor = Color.Yellow; ButtonUnsubscribe.Enabled = false; } }
protected string GetEvalName(bool showEvalName,Guid PKID) { string retString = "anonymous eval"; if (showEvalName) { string username = CodeCampSV.Utils.GetAttendeeUsernameByGUID(PKID.ToString()); AttendeesODS attendeeODS = new AttendeesODS(); List<CodeCampSV.AttendeesODS.DataObjectAttendees> li = attendeeODS.GetByUsername(string.Empty, username, false); retString = li[0].Userfirstname + " " + li[0].Userlastname + " email: " + li[0].Email; } return retString; }