Ejemplo n.º 1
0
 //public IEnumerable<EmailRecipients> GetEmailRecipients()
 //{
 //    return new ObservableCollection<EmailRecipients>(_DataBaseContext.EmailRecipients);
 //}
 public IEnumerable <Recipient> GetEmailRecipients()
 {
     using (var db = new SpamTools.lib.Data.DataBaseContext())
     {
         return(new ObservableCollection <Recipient>(db.Recipients.ToList()));
     }
 }
Ejemplo n.º 2
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            Sender newSender = new Sender()
            {
                Name = Name.Text, Adress = Adress.Text, Password = Password.Text
            };

            using (var db = new SpamTools.lib.Data.DataBaseContext())
            {
                db.Senders.Add(newSender);
                db.SaveChanges();
            }
            this.Close();
        }
Ejemplo n.º 3
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            SpamTools.lib.Data.SchedulerTask task = new SpamTools.lib.Data.SchedulerTask()
            {
                DateTime   = (DateTime)DateTimePicker.Value,
                Recipients = Recipients.SelectedItems as IList <Recipient>,
                MailServer = Servers.SelectedItem as MailServer,
                Sender     = From.SelectedItem as Sender,
                Mail       = new Mail()
                {
                    Body    = Content.Text,
                    Subject = Subject.Text
                },
                Title = Title.Text
            };

            using (var db = new SpamTools.lib.Data.DataBaseContext())
            {
                db.SchedulerTask.Add(task);
                db.SaveChanges();
            }

            this.Close();
        }