private void newProjectButton_Click(object sender, RoutedEventArgs e) { CreateProjectWindow cpw = new CreateProjectWindow(); cpw.ShowDialog(); if (cpw.DialogResult.HasValue && cpw.DialogResult==true) { Project project1 = new Project(); project1.Name = cpw.nameTextBox.Text; model1.Projects.AddObject(project1); model1.SaveChanges(); ProjectId = model1.Projects.ToList().Last().Id; projectsListBox.ItemsSource = model1.Projects; LoadColumns(); personsTab.Visibility = System.Windows.Visibility.Visible; materialsTab.Visibility = System.Windows.Visibility.Visible; eventsTab.Visibility = System.Windows.Visibility.Visible; tabControl1.SelectedIndex = 1; } }
private void newProjectButton_Click(object sender, RoutedEventArgs e) { CreateProjectWindow cpw = new CreateProjectWindow(); cpw.ShowDialog(); if (cpw.DialogResult.HasValue && cpw.DialogResult == true) { Project project1 = new Project(); project1.Name = cpw.nameTextBox.Text; model1.Projects.AddObject(project1); model1.SaveChanges(); ProjectId = model1.Projects.ToList().Last().Id; projectsListBox.ItemsSource = model1.Projects; LoadColumns(); personsTab.Visibility = System.Windows.Visibility.Visible; materialsTab.Visibility = System.Windows.Visibility.Visible; eventsTab.Visibility = System.Windows.Visibility.Visible; tabControl1.SelectedIndex = 1; } }