private void System_SyncChangeStatus(object sender, EnumTableSyncStatus status) { for (int i = 0; i < gvSystem.RowCount; i++) { int handle = gvSystem.GetRowHandle(i); DataRow row = gvSystem.GetDataRow(handle); if ((int)row[ColName.Id] == ((SystemSync)sender).SyncInfo.Id) { row[ColName.Status] = EnumTableSyncStatusText.GetText(status); break; } } }
public void SetData() { tableCore.Clear(); _coreSyncList = DataSync.GetSyncCoreList(Company.CurrentId); _coreSyncList.ForEach(x => x.SyncChangeStatus += Core_SyncChangeStatus); _coreSyncList.ForEach(x => { tableCore.Rows.Add( x.SyncInfo.Id, x.SyncInfo.DisplayName, EnumTableSyncStatusText.GetText(x.SyncInfo.Status) ); }); tableLookup.Clear(); _lookupSyncList = DataSync.GetSyncLookupList(Company.CurrentId); _lookupSyncList.ForEach(x => x.SyncChangeStatus += Lookup_SyncChangeStatus); _lookupSyncList.ForEach(x => { tableLookup.Rows.Add( x.SyncInfo.Id, x.SyncInfo.DisplayName, EnumTableSyncStatusText.GetText(x.SyncInfo.Status), x.SyncInfo.DoSync, x ); }); tableSystem.Clear(); _systemSyncList = DataSync.GetSyncSystemList(); _systemSyncList.ForEach(x => x.SyncChangeStatus += System_SyncChangeStatus); _systemSyncList.ForEach(x => { tableSystem.Rows.Add( x.SyncInfo.Id, x.SyncInfo.DisplayName, EnumTableSyncStatusText.GetText(x.SyncInfo.Status), x.SyncInfo.DoSync, x ); }); tabControl.ShowTabHeader = DevExpress.Utils.DefaultBoolean.False; SetupButtons(); }