public static bool Add(CurrentAttendee attendee) { attendee.EventID = NextEventId; var ctx = new ICCData(); ctx.CurrentAttendees.InsertOnSubmit(attendee); ctx.SubmitChanges(); return true; }
public static bool SendConfirmationEmail(CurrentAttendee attendee) { bool returnValue = true; try { string enabled = ConfigurationManager.AppSettings["enableRegistrationConfirmation"]; if (enabled != "1") { return true; } string smtpServer = ConfigurationManager.AppSettings["smtpserver"]; var client = new SmtpClient(smtpServer); client.Timeout = 60000; string messageFrom = ConfigurationManager.AppSettings["registrationEmailAddress"]; var message = new MailMessage(messageFrom, attendee.Email); message.Subject = "Iowa Code Camp - Registration Confirmation"; message.SubjectEncoding = Encoding.UTF8; var nextEvent = Event.GetNextEvent(); message.Body = GetRegistrationConfirmationMessageTemplate(); message.Body = string.Format( message.Body, attendee.FirstName, attendee.LastName, nextEvent.EventName, nextEvent.StartOn.ToHumanOrdinalized(), messageFrom); message.BodyEncoding = Encoding.UTF8; message.IsBodyHtml = true; message.Priority = MailPriority.Normal; string smtpUser = ConfigurationManager.AppSettings["smtpuser"]; string smtpPassword = ConfigurationManager.AppSettings["smtppassword"]; var cred = new NetworkCredential(smtpUser, smtpPassword); client.Credentials = cred; string smtpSsl = ConfigurationManager.AppSettings["smtpssl"]; client.EnableSsl = (smtpSsl == "1"); client.Send(message); } catch { returnValue = false; } return returnValue; }
public static bool Add(CurrentAttendee attendee) { attendee.EventID = NextEventId; var ctx = new ICCData(); ctx.CurrentAttendees.InsertOnSubmit(attendee); ctx.SubmitChanges(); return(true); }
partial void DeleteCurrentAttendee(CurrentAttendee instance);
partial void UpdateCurrentAttendee(CurrentAttendee instance);
partial void InsertCurrentAttendee(CurrentAttendee instance);
private void detach_CurrentAttendees(CurrentAttendee entity) { this.SendPropertyChanging(); entity.Event = null; }