using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using WpfApp29.Models; namespace WpfApp29 { /// /// Логика взаимодействия для TaskCreationWindow.xaml /// public partial class TaskCreationWindow : Window { public TaskCreationWindow() { InitializeComponent(); } private void ButtonGoBack_Click(object sender, RoutedEventArgs e) { CloseThisWindow(); } private void ButtonAddNewTask_Click(object sender, RoutedEventArgs e) { MainContext ctx = new MainContext(); ctx.Tasks.Add(new Models.Task(TbTaskName.Text, TbTaskDesc.Text, DateTime.Now, User.CurrentUser.Id, User.CurrentUser.Id, 1)); ctx.SaveChanges(); CloseThisWindow(); } private void CloseThisWindow() { this.Close(); } } }