// 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; }
private bool UpdateInfo() { bool updateSuccess = false; if (ValidateInfo()) { try { SqlBytes sqlBytes = null; if (FileUploadImage.HasFile) { Byte[] byteAray = FileUploadImage.FileBytes; var ms = new MemoryStream(byteAray); Byte[] smallerImageBytes = Utils.ResizeFromStream(FileUploadImage.FileName, Utils.BigSize, ms); sqlBytes = new SqlBytes(smallerImageBytes); Utils.ClearCacheForAttendeeImage(LabelUsername.Text); } var attendeeODS = new AttendeesODS(); attendeeODS.UpdateSpecial(LabelUsername.Text, CheckBoxWetPaintWiki.Checked ? 1 : 0, TextBoxEmailAddress.Text, TextBoxWebBlog.Text, TextBoxFirstName.Text, TextBoxLastName.Text, TextBoxZipCode.Text, TextBoxBio.Text, CheckBoxShareInfo.Checked, CheckBoxAllowAttendeesToEmailMe.Checked, CheckBoxSaturdayDinner.Checked, CheckBoxSaturday.Checked, CheckBoxSunday.Checked, "true" ); if (sqlBytes != null) { attendeeODS.UpdateBlobsAttendees(sqlBytes, LabelUsername.Text); } // (ignore what is in attendees file for now on) Utils.UpdateAttendeeAttendance(Utils.CurrentCodeCampYear,LabelUsername.Text,CheckBoxSaturday.Checked, CheckBoxSunday.Checked); updateSuccess = true; } catch (Exception eee) { throw new ApplicationException("Update Profile Failed " + eee); } ErrorRow.Visible = false; } else { updateSuccess = false; ErrorRow.Visible = true; } if (updateSuccess) { Response.Redirect("~/ProfileInfoUpdateSuccess.aspx", true); } return updateSuccess; }