private void StartUpdate() { Cursor = Cursors.WaitCursor; try { _ordersDataVisible = false; _inventoryDataVisible = false; _transactionsDataVisible = false; _ordersGettingData = true; _inventoryGettingData = true; _transactionsGettingData = true; RefreshGUI(); _inventory = new AssetList(); _transactions = new TransactionList(); inventoryView.DataSource = _inventory; transactionsView.DataSource = _transactions; // Generate finance access parameters _finParams = new List<FinanceAccessParams>(); Dictionary<long, List<int>>.Enumerator enumerator = _useDataFrom.GetEnumerator(); while (enumerator.MoveNext()) { // If we are accessing all wallets for a corp then no need to bether with this // as the default is to access everything when a blank list is supplied. List<short> walletIDs = new List<short>(); if (enumerator.Current.Value.Count < 7) { foreach (short walletId in enumerator.Current.Value) { walletIDs.Add(walletId); } } _finParams.Add(new FinanceAccessParams(enumerator.Current.Key, walletIDs)); } // Generate asset access parameters _assetParams = new List<AssetAccessParams>(); foreach (object item in chkOwners.CheckedItems) { bool done = false; CharCorpOption owner = (CharCorpOption)item; foreach (AssetAccessParams character in _assetParams) { if (character.OwnerID == owner.Data.ID) { // If the specified ownerID is already in the access parameter list then // don't add it again. done = true; } } if (!done) { _assetParams.Add(new AssetAccessParams(owner.Data.ID)); } } _itemIDs = new List<int>(); foreach (object item in chkItems.CheckedItems) { _itemIDs.Add(((ItemInfo)item).ID); } _orderPlaceholderType = OrderPlaceholderType.None; if (rdbItemPlaceholders.Checked) { _orderPlaceholderType = OrderPlaceholderType.PerItem; } else if (rdbAllPlaceholders.Checked) { _orderPlaceholderType = OrderPlaceholderType.PerItemPerEntity; } // Kick off the threads that will do the updating of the data tables. _ordersUpdateThread = new Thread(new ThreadStart(UpdateOrders)); _ordersUpdateThread.Start(); _transactionsUpdateThread = new Thread(new ThreadStart(UpdateTransactions)); _transactionsUpdateThread.Start(); _inventoryUpdateThread = new Thread(new ThreadStart(UpdateInventory)); _inventoryUpdateThread.Start(); } catch (Exception ex) { new EMMAException(ExceptionSeverity.Error, "Error when starting data update in item detail", ex); } finally { Cursor = Cursors.Default; } }
private void rdbPlaceholders_CheckedChanged(object sender, EventArgs e) { _orderPlaceholderType = OrderPlaceholderType.None; if (rdbItemPlaceholders.Checked) { _orderPlaceholderType = OrderPlaceholderType.PerItem; } else if (rdbAllPlaceholders.Checked) { _orderPlaceholderType = OrderPlaceholderType.PerItemPerEntity; } RefreshGUI(); }