Exemple #1
0
        private void btnDelete_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            bool res  = false;
            var  rest = MessageBox.Show("确定删除数据吗?", "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (rest == MessageBoxResult.Yes)
            {
                res = viewModel.DeleteHistoryData((DateTime)starttime.Value, (DateTime)endtime.Value);
                if (res)
                {
                    MessageBox.Show("删除数据成功!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    MessageBox.Show("删除数据失败!", "提示", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }