示例#1
0
 ///<summary>Creates tables that should only be loaded at design-time.</summary>
 ///<remarks>At runtime, these tables are loaded when needed.  However, I still want them in the designer.</remarks>
 static void AddDesignTimeTables(DataContext context)
 {
     context.Tables.AddTable(SeatingReservation.CreateTable());
     context.Tables.AddTable(MelaveMalkaInfo.CreateTable());
     context.Tables.AddTable(MelaveMalkaInvitation.CreateTable());
     context.Tables.AddTable(MelaveMalkaSeat.CreateTable());
     context.Tables.AddTable(Caller.CreateTable());
     context.Tables.AddTable(AdReminderEmail.CreateTable());
     context.Tables.AddTable(RaffleTicket.CreateTable());
 }
示例#2
0
        void SendEmail(MelaveMalkaInvitation recipient)
        {
            using (var message = new MailMessage {
                From = Email.JournalAddress,
                SubjectEncoding = Email.DefaultEncoding,
                BodyEncoding = Email.DefaultEncoding,
                Subject = recipient.EmailSubject,
                Body = recipient.EmailSource,
                IsBodyHtml = true
            }) {
                message.To.Add(recipient.EmailAddresses);                   //Comma-separated string
                Email.Hosted.Send(message);
            }

            BeginInvoke(new Action(delegate {               //The table can only be updated from the UI thread.
                Program.Table <AdReminderEmail>().Rows.Add(new AdReminderEmail {
                    Recipient    = recipient,
                    Date         = DateTime.Now,
                    EmailSubject = recipient.EmailSubject,
                    EmailSource  = recipient.EmailSource
                });
            }));
        }