Beispiel #1
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();
        }
Beispiel #2
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();
        }