示例#1
0
文件: Story.xaml.cs 项目: j3zza/GBE
        private void btnAddUpdate_Click(object sender, RoutedEventArgs e)
        {
            var context = new GBDBContext();

            GBStory story = new GBStory()
            {
                Title = txtTitle.Text
            };

            context.GBStory.Add(story);
            context.SaveChanges();

            addMode = false;
        }
示例#2
0
        private void btnAddUpdate_Click(object sender, RoutedEventArgs e)
        {
            // add or update story block

            var context = new GBDBContext();

            GBStoryBlock storyBlock = new GBStoryBlock()
            {
                Text = txtStoryBlock.Text
            };

            context.GBStoryBlocks.Add(storyBlock);
            context.SaveChanges();

            addMode = false;
        }