//新增 private void New_Click(object sender, RoutedEventArgs e) { //将当前时间传入NewData窗口中 time = DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString(); NewData newData = new NewData(tab.SelectedIndex, name, time); newData.ShowDialog(); //刷新数据 init_dataGrid(); init_search(); }