private void Start(object sender, RoutedEventArgs e) { accounting = new accounting(); accounting.status = 1; accounting.startWork = DateTime.Now; accounting.user = Authorization.User.id; accounting.endwork = null; Startbt.IsEnabled = false; Stopbt.IsEnabled = true; info.Content = $"Начал работу {accounting.startWork}"; context.accounting.AddOrUpdate(accounting); context.SaveChanges(); }