private void InitCommand() { DataGridDefaultConfigCommand = new DelegateCommand((obj) => { DataGridManagementWinodw window = new DataGridManagementWinodw(); window.ShowDialog(); }); TextBlockMouseLeftButtonDownCommand = new DelegateCommand((obj) => { }); DataGridRowMouseLeftClickBaseCommand = new DelegateCommand((obj) => { long dt1 = DateTime.Now.Ticks; ActionOperationLogModel dr = (obj as DataGridRow).Item as ActionOperationLogModel; foreach (var item in Lists) { if (item.Id == dr.Id) { dr.IsChecked = !dr.IsChecked; } else { item.IsChecked = false; } } long dt2 = DateTime.Now.Ticks; MessageBox.Show($"{dt2 - dt1} \t 此数据的:{dr.Id}"); }); }
public Task WriteActionLogAsync(ActionOperationLogModel model) { return(Task.Factory.StartNew(() => { //Thread.Sleep(20000); string sql = @" insert into SJActionOperationLog(MainMenuId,UserId,ActionName,ActionDesc,PKId,HostName) values(@MainMenuId,@UserId,@ActionName,@ActionDesc,@PKId,@HostName) ;"; using (var connection = SqlDb.UpdateConnection) { connection.Execute(sql, model); } })); }