Example #1
0
        private void NewTheme(object sender, RoutedEventArgs e)
        {
            TitleNameForm titleNameForm = new TitleNameForm();

            titleNameForm.ShowDialog();
            if (titleNameForm.title_Name != "")
            {
                Title_ title_new = new Title_();
                title_new.Title = titleNameForm.title_Name;

                using (UserContext context = new UserContext())
                {
                    context.TitleClasses.Add(title_new);
                    context.SaveChanges();
                    FillStackPanel(context);
                }
            }
        }
Example #2
0
        private void NewThemeDaily(object sender, RoutedEventArgs e)
        {
            TitleNameForm titleNameForm = new TitleNameForm();

            titleNameForm.ShowDialog();
            if (titleNameForm.title_Name != "")
            {
                Title_Daily title_new_daily = new Title_Daily();
                title_new_daily.TitleD     = titleNameForm.title_Name;
                title_new_daily.title_date = DataPicker1.SelectedDate.ToString();

                using (UserContext context = new UserContext())
                {
                    context.title_Dailies.Add(title_new_daily);
                    context.SaveChanges();
                    FillStackPanelDaily(context);
                }
            }
        }